diff --git a/src/lib/modules/ens/ENSFunctions.js b/src/lib/modules/ens/ENSFunctions.js index e13f8f626..f7062d139 100644 --- a/src/lib/modules/ens/ENSFunctions.js +++ b/src/lib/modules/ens/ENSFunctions.js @@ -1,10 +1,10 @@ +import { ZERO_ADDRESS } from '../../utils/addressUtils'; /*global web3*/ const namehash = require('eth-ens-namehash'); // Price of ENS registration contract functions const ENS_GAS_PRICE = 700000; const reverseAddressSuffix = '.addr.reverse'; -const voidAddr = '0x0000000000000000000000000000000000000000'; const NoDecodeAddrErr = 'Error: Couldn\'t decode address from ABI: 0x'; const NoDecodeStringErr = 'ERROR: The returned value is not a convertible string: 0x0'; @@ -66,7 +66,7 @@ function lookupAddress(address, ens, utils, createResolverContract, callback) { if (err) { return cb(err); } - if (resolverAddress === voidAddr) { + if (resolverAddress === ZERO_ADDRESS) { return cb('Address not associated to a resolver'); } createResolverContract(resolverAddress, (_, resolverContract) => { @@ -90,7 +90,7 @@ function resolveName(name, ens, createResolverContract, callback) { if (err) { return cb(err); } - if (resolverAddress === voidAddr) { + if (resolverAddress === ZERO_ADDRESS) { return cb('Name not yet registered'); } createResolverContract(resolverAddress, (_, resolverContract) => { diff --git a/src/lib/modules/ens/index.js b/src/lib/modules/ens/index.js index e5aadad47..528396293 100644 --- a/src/lib/modules/ens/index.js +++ b/src/lib/modules/ens/index.js @@ -5,6 +5,7 @@ const async = require('async'); const embarkJsUtils = require('embarkjs').Utils; const reverseAddrSuffix = '.addr.reverse'; const ENSFunctions = require('./ENSFunctions'); +import { ZERO_ADDRESS } from '../../utils/addressUtils'; const MAINNET_ID = '1'; const ROPSTEN_ID = '3'; @@ -177,7 +178,7 @@ class ENS { if (err) { return cb(err); } - if (resolverAddress === '0x0000000000000000000000000000000000000000') { + if (resolverAddress === ZERO_ADDRESS) { return cb('Name not yet registered'); } next(null, resolverAddress); @@ -455,7 +456,7 @@ class ENS { if (err) { return next(err); } - if(resolverAddress === '0x0000000000000000000000000000000000000000') { + if(resolverAddress === ZERO_ADDRESS) { return next('Name not yet registered'); } next(null, resolverAddress);