aboutsummaryrefslogtreecommitdiffstats
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
parent5b7774f9d00a0f80601e6ff4ed0920c6a150a350 (diff)
downloaddexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.gz
dexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.tar.zst
dexon-sol-tools-c4c37cafa0d8a77bfdc01b1cc111ba0101e86c8b.zip
Update comment about ethers checksummed address behavior
-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));