Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

Commit c1cbb2e

Browse files
committed
Fix displaying ETH balance in wrap and unwrap commands + lint fixes
1 parent 7877c21 commit c1cbb2e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

libexec/mcd/mcd---to-wad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22
# hex to decimal wad
33
set -e
4-
seth --to-fix 18 $(mcd --to-dec $1)
4+
seth --to-fix 18 "$(mcd --to-dec "$1")"

libexec/mcd/mcd-unwrap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
### mcd-unwrap -- Unwrap WETH to ETH
33
### Usage: mcd unwrap <amount>
44
set -e
5-
mcd --require-from $0
5+
mcd --require-from "$0"
66
[ -n "$1" ] || mcd --fail "mcd-wrap: Please specify an amount to wrap"
7-
seth send ${ETH?} 'withdraw(uint)' $(seth --to-word $(seth --to-wei "$1 eth"))
7+
seth send "${ETH?}" 'withdraw(uint)' "$(seth --to-word "$(seth --to-wei "$1 eth")")"
88

99
[[ $SETH_ASYNC == yes ]] && exit 1
1010

1111
sig="balanceOf(address)(uint)"
12-
weth=$(mcd --to-wad $(seth call ${ETH?} "$sig" "$ETH_FROM"))
13-
eth=$(mcd --to-wad $(seth balance $ETH_FROM))
12+
weth=$(mcd --to-wad "$(seth call "${ETH?}" "$sig" "$ETH_FROM")")
13+
eth=$(seth --to-fix 18 "$(seth balance "$ETH_FROM")")
1414

1515
echo "eth $eth"
1616
echo "weth $weth"

libexec/mcd/mcd-wrap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
### mcd-wrap -- Wrap ETH to WETH
33
### Usage: mcd wrap <amount>
44
set -e
5-
mcd --require-from $0
5+
mcd --require-from "$0"
66
[ -n "$1" ] || mcd --fail "mcd-wrap: Please specify an amount to wrap"
7-
seth send ${ETH?} --value $(seth --to-wei "$1 eth")
7+
seth send "${ETH?}" --value "$(seth --to-wei "$1 eth")"
88

99
[[ $SETH_ASYNC == yes ]] && exit 1
1010

1111
sig="balanceOf(address)(uint)"
12-
weth=$(mcd --to-wad $(seth call ${ETH?} "$sig" "$ETH_FROM"))
13-
eth=$(mcd --to-wad $(seth balance $ETH_FROM))
12+
weth=$(mcd --to-wad "$(seth call "${ETH?}" "$sig" "$ETH_FROM")")
13+
eth=$(seth --to-fix 18 "$(seth balance "$ETH_FROM")")
1414

1515
echo "eth $eth"
1616
echo "weth $weth"

0 commit comments

Comments
 (0)