diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-08-22 19:27:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 19:27:40 +0800 |
commit | 0bc9083bff341cc7841fb1ccd84fa50e6749151d (patch) | |
tree | c188a96044d78d9446213fe565152d13a33a0858 /src/utils/assert.ts | |
parent | e376189bc69682b2445f344966332c63d8e9fa4d (diff) | |
parent | 4207400f8a9ebd8e7cbf0b7f9edf72e6f01db7db (diff) | |
download | dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.gz dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.bz2 dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.lz dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.xz dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.tar.zst dexon-sol-tools-0bc9083bff341cc7841fb1ccd84fa50e6749151d.zip |
Merge pull request #124 from 0xProject/reject-checksummed-addresses
Reject checksummed addresses
Diffstat (limited to 'src/utils/assert.ts')
-rw-r--r-- | src/utils/assert.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/assert.ts b/src/utils/assert.ts index 969209208..0e6169b44 100644 --- a/src/utils/assert.ts +++ b/src/utils/assert.ts @@ -24,6 +24,10 @@ export const assert = { isETHAddressHex(variableName: string, value: string): void { const web3 = new Web3(); this.assert(web3.isAddress(value), this.typeAssertionMessage(variableName, 'ETHAddressHex', value)); + this.assert( + web3.isAddress(value) && !web3.isChecksumAddress(value), + `Checksummed addresses are not supported. Convert ${variableName} to lower case before passing`, + ); }, doesBelongToStringEnum(variableName: string, value: string, stringEnum: any /* There is no base type for every string enum */): void { |