I’m attempting to deploy a contract with ethers.js in browser. The code is as follows
const provider = new ethers.providers.Web3Provider(window.ethereum); await provider.send('eth_requestAccounts', ); const factory = new ethers.ContractFactory(contractInterface, bytecode, signer); const contract = await factory.deploy(...tokenParameters);
Yet for some reason it throws the following error in the browser console.
Uncaught (in promise) TypeError: this.interface.encodeDeploy is not a function at ContractFactory.getDeployTransaction (index.ts:1221:28)
Has anyone encountered this or have any idea why it might be happening?