Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(async (resolve, reject) => {
try {
let address = await ensResolve(domain, { provider: require('../../provider'), registryAddress })
if (address.replace('0x', '')) return resolve(address)
throw new Error('Invalid address')
} catch (e) {
reject(new Error(`Unable to resolve DAO ${domain} on current network`))
}
})
}