aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-05-27 00:25:17 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-05-27 00:25:45 +0800
commit7e96b45ea0c51ca5589640018172a91a35596148 (patch)
tree65cf6cb8e0364eaf9cc2eb912b0fecb202d8021e /src
parent95f07a428b440d1e840b1020ed427ce51dd8a51c (diff)
downloaddexon-0x-contracts-7e96b45ea0c51ca5589640018172a91a35596148.tar.gz
dexon-0x-contracts-7e96b45ea0c51ca5589640018172a91a35596148.tar.zst
dexon-0x-contracts-7e96b45ea0c51ca5589640018172a91a35596148.zip
Make zero address regex stricter
Diffstat (limited to 'src')
-rw-r--r--src/ts/web3_wrapper.ts2
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;
}