Skip to content

Commit 084c96b

Browse files
authored
Merge pull request #796 from dapphub/fix-checksum-lookup
2 parents c09872a + 6ba5630 commit 084c96b

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

src/dapp-tests/integration/tests.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,52 @@ dapp_testnet() {
4949

5050
# dynamic fee transaction (EIP-1559)
5151
seth send "$A_ADDR" "on()" --gas 0xffff --password /dev/null --from "$ACC" --keystore "$TMPDIR"/8545/keystore --prio-fee 2gwei --gas-price 10gwei
52+
53+
# clean up
54+
killall geth
5255
}
5356

5457
dapp_testnet
5558

59+
# checks that seth send works with both checksummed and unchecksummed addresses
60+
seth_send_address_formats() {
61+
TMPDIR=$(mktemp -d)
62+
63+
dapp testnet --dir "$TMPDIR" &
64+
# give it a few secs to start up
65+
sleep 180
66+
read -r ACC BAL <<< "$(seth ls --keystore "$TMPDIR/8545/keystore")"
67+
68+
lower=$(echo "$ACC" | tr '[:upper:]' '[:lower:]')
69+
export ETH_GAS=0xffff
70+
71+
zero=0x0000000000000000000000000000000000000000
72+
73+
# with checksummed
74+
tx=$(seth send "$zero" --from "$ACC" --password /dev/null --value "$(seth --to-wei 1 ether)" --keystore "$TMPDIR"/8545/keystore --async)
75+
[[ $(seth tx "$tx" from) = "$lower" ]]
76+
77+
# without checksum
78+
tx=$(seth send "$zero" --from "$lower" --password /dev/null --value "$(seth --to-wei 1 ether)" --keystore "$TMPDIR"/8545/keystore --async)
79+
[[ $(seth tx "$tx" from) = "$lower" ]]
80+
81+
# try again with eth_rpc_accounts
82+
export ETH_RPC_ACCOUNTS=true
83+
84+
# with checksummed
85+
tx=$(seth send "$zero" --from "$ACC" --password /dev/null --value "$(seth --to-wei 1 ether)" --keystore "$TMPDIR"/8545/keystore --async)
86+
[[ $(seth tx "$tx" from) = "$lower" ]]
87+
88+
# without checksum
89+
tx=$(seth send "$zero" --from "$lower" --password /dev/null --value "$(seth --to-wei 1 ether)" --keystore "$TMPDIR"/8545/keystore --async)
90+
[[ $(seth tx "$tx" from) = "$lower" ]]
91+
92+
# clean up
93+
killall geth
94+
}
95+
96+
seth_send_address_formats
97+
5698
test_hevm_symbolic() {
5799
solc --bin-runtime -o . --overwrite factor.sol
58100
# should find counterexample

src/seth/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- `seth abi-encode` command returns the ABI encoded values without the function signature
1515
- `seth index` command returns the slot number for the specified mapping type and input data
1616

17+
### Fixed
18+
19+
- Address lookup no longer fails if `ETH_RPC_ACCOUNTS` is set, and `ETH_FROM` is an unchecksummed address
20+
1721
## [0.11.0] - 2021-09-08
1822

1923
### Added

src/seth/libexec/seth/seth-send

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function signAndSend() {
5858

5959
if [[ -z $ETH_RPC_ACCOUNTS ]]; then
6060
signAndSend
61-
elif ethsign ls | grep -q $ETH_FROM; then
61+
elif ethsign ls | grep -qI "$ETH_FROM"; then
6262
signAndSend
6363
else
6464
tx=$(seth rpc eth_sendTransaction -- "${jshon[@]}")

0 commit comments

Comments
 (0)