aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-08-09 08:58:04 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-08-09 08:58:04 +0800
commitc4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b (patch)
treed3c9aa67714c0b9494762bff3ca7e545d36789dc /packages
parent5b7774f9d00a0f80601e6ff4ed0920c6a150a350 (diff)
downloaddexon-0x-contracts-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar
dexon-0x-contracts-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.gz
dexon-0x-contracts-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.bz2
dexon-0x-contracts-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.lz
dexon-0x-contracts-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.xz
dexon-0x-contracts-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.zst
dexon-0x-contracts-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.zip
Update comment about ethers checksummed address behavior
Diffstat (limited to 'packages')
-rw-r--r--packages/utils/src/abi_utils.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/utils/src/abi_utils.ts b/packages/utils/src/abi_utils.ts
index fc64a2a89..c9b70966c 100644
--- a/packages/utils/src/abi_utils.ts
+++ b/packages/utils/src/abi_utils.ts
@@ -96,9 +96,9 @@ function isAbiDataEqual(name: ethers.ParamName, type: string, x: any, y: any): b
}
return true;
} else if (type === 'address' || type === 'bytes') {
- // HACK(albrow): ethers.js sometimes changes the case of addresses/bytes
- // when decoding/encoding. To account for that, we convert to lowercase
- // before comparing.
+ // HACK(albrow): ethers.js returns the checksummed address even when
+ // initially passed in a non-checksummed address. To account for that,
+ // we convert to lowercase before comparing.
return _.isEqual(_.toLower(x), _.toLower(y));
} else if (_.startsWith(type, 'uint') || _.startsWith(type, 'int')) {
return new BigNumber(x).eq(new BigNumber(y));