diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-05-27 00:25:17 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-05-27 00:25:45 +0800 |
commit | 7e96b45ea0c51ca5589640018172a91a35596148 (patch) | |
tree | 65cf6cb8e0364eaf9cc2eb912b0fecb202d8021e /src/ts | |
parent | 95f07a428b440d1e840b1020ed427ce51dd8a51c (diff) | |
download | dexon-sol-tools-7e96b45ea0c51ca5589640018172a91a35596148.tar dexon-sol-tools-7e96b45ea0c51ca5589640018172a91a35596148.tar.gz dexon-sol-tools-7e96b45ea0c51ca5589640018172a91a35596148.tar.bz2 dexon-sol-tools-7e96b45ea0c51ca5589640018172a91a35596148.tar.lz dexon-sol-tools-7e96b45ea0c51ca5589640018172a91a35596148.tar.xz dexon-sol-tools-7e96b45ea0c51ca5589640018172a91a35596148.tar.zst dexon-sol-tools-7e96b45ea0c51ca5589640018172a91a35596148.zip |
Make zero address regex stricter
Diffstat (limited to 'src/ts')
-rw-r--r-- | src/ts/web3_wrapper.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ts/web3_wrapper.ts b/src/ts/web3_wrapper.ts index 97d04db8c..3b460e4da 100644 --- a/src/ts/web3_wrapper.ts +++ b/src/ts/web3_wrapper.ts @@ -50,7 +50,7 @@ export class Web3Wrapper { public async doesContractExistAtAddressAsync(address: string): Promise<boolean> { const code = await promisify(this.web3.eth.getCode)(address); // Regex matches 0x0, 0x00, 0x in order to accomodate poorly implemented clients - const zeroHexAddressRegex = /^0x0*$/i; + const zeroHexAddressRegex = /^0x0\{0,40\}$/i; const didFindCode = _.isNull(code.match(zeroHexAddressRegex)); return didFindCode; } |