diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-05-26 23:51:16 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-05-27 00:14:39 +0800 |
commit | 75c67f3ce3d762f84f44e669f949adab351c6cad (patch) | |
tree | 68ce1048b80cf42ae29c5e7d3285151b41acd330 /src | |
parent | 4c3c1d049b0d6dd147a56b3ce9e6ccc17686acf1 (diff) | |
download | dexon-sol-tools-75c67f3ce3d762f84f44e669f949adab351c6cad.tar dexon-sol-tools-75c67f3ce3d762f84f44e669f949adab351c6cad.tar.gz dexon-sol-tools-75c67f3ce3d762f84f44e669f949adab351c6cad.tar.bz2 dexon-sol-tools-75c67f3ce3d762f84f44e669f949adab351c6cad.tar.lz dexon-sol-tools-75c67f3ce3d762f84f44e669f949adab351c6cad.tar.xz dexon-sol-tools-75c67f3ce3d762f84f44e669f949adab351c6cad.tar.zst dexon-sol-tools-75c67f3ce3d762f84f44e669f949adab351c6cad.zip |
Simplify zero address regex
Diffstat (limited to 'src')
-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 24938e396..97d04db8c 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 = /^0[xX][0]*$/; + const zeroHexAddressRegex = /^0x0*$/i; const didFindCode = _.isNull(code.match(zeroHexAddressRegex)); return didFindCode; } |