v5 - Do i need to deploy ENS? Error: network does not support ENS
See original GitHub issueRunning a mocha test with gananche-cli. The test calls a library created with ts. The library deploys a contract.
Version
“ethers”: “^5.0.0-beta.158”
test.js
'use strict';
const expect = require('chai').expect;
const ethers = require('ethers')
const ganache = require('ganache-cli');
const MNEMONIC = 'popular stock metal artefact nasty venture oblige horror face glory predict coach'
const { contracts } = require('./../lib/index')
const provider = new ethers.providers.Web3Provider(
ganache.provider({
"mnemonic": MNEMONIC,
"gasLimit": 8000000,
"default_balance_ether": 100000000,
})
)
describe('contracts', async function () {
this.timeout(9000);
it("Setup accounts", async () => {
this.DEVELOPER_SIGNER = ethers.Wallet.fromMnemonic(MNEMONIC).connect(provider)
this.DEVELOPER = await this.DEVELOPER_SIGNER.getAddress()
})
it('deploy moloch', async () => {
const contract = await contracts.moloch.deploy(this.DEVELOPER_SIGNER)
});
});
index.ts
import { ethers, Signer } from "ethers";
import { abi as molochAbi, bytecode as molochBytecode } from "./compiled_contracts/Moloch.json";
const contract = (abi: any, bytecode: any) => {
return {
abi: abi,
bytecode: bytecode,
deploy: async (signer: Signer) => {
return new Promise(async (resolve) => {
const factory = new ethers.ContractFactory(abi, bytecode, signer)
const contract = await factory.deploy()
return resolve(await contract.deployed())
})
}
}
}
export const contracts = {
moloch: contract(molochAbi, molochBytecode)
}
The line const contract = await factory.deploy()
triggers the error `UnhandledPromiseRejectionWarning: Error: network does not support ENS (operation=“ENS”, network=“unknown”``. Do i need to deploy ENS in these scenarios?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
json rpc - Error: network does not support ENS
I am currently trying to build an NFT Marketplace ...
Read more >network does not support ENS
Error : network does not support ENS (operation=“getResolver”, network=“maticmum”, code=UNSUPPORTED_OPERATION, version=providers/5.6.0). Code :
Read more >Using Truffle's ENS Integration
The ENS team has deployed a registry contract to Mainnet and several test networks. ... to by default if no registry address is...
Read more >How to Build a Full Stack NFT Marketplace - V2 (2022)
but i want to deploy this to ropsten not localhost so other can interact with it ... Error: network does not support ENS...
Read more >Error network does not support ENS taking balance
hi everybody… I am trying to capture the balance of the user connecting to my DAPP with ethers.js According to its documentation it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, absolutely. I solved the issue by understanding your explaination. As explained by @ricmoo if you are on a network that dose not have ENS, you must convert the address passed from (in my case frontend React). I had been passing the string address as an param. Official docs ethers.io getAddress. conversion -
ethers.utils.getAddress( address )
converts string address to address required for smart conteract to understand and then compile.Please just tell us how you fixed this for people who find via google