From 7e96b45ea0c51ca5589640018172a91a35596148 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 26 May 2017 18:25:17 +0200 Subject: Make zero address regex stricter --- src/ts/web3_wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { 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; } -- cgit v1.2.3