getting issue on contract.deployTransaction.wait #6092
-
I am on lesson 5 at this timestamp: lesson 5 7:12:42 this is my code so far: const ethers = require('ethers');
const fs = require('fs-extra')
require('dotenv').config();
async function main(){
const options = {
"gasLimit": 5000000
}
const provider = new ethers.JsonRpcProvider(process.env.RPC_SERVER);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
const abi = fs.readFileSync('./SimpleStorage_sol_SimpleStorage.abi', 'utf-8');
const bin = fs.readFileSync('./SimpleStorage_sol_SimpleStorage.bin', 'utf-8');
const contractFactory = new ethers.ContractFactory(abi, bin, wallet);
console.log('deploying');
const contract = await contractFactory.deploy(options);
console.log(contract);
const transactionReciept = contract.deployTransaction.wait(1);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
}); for some strange reason, when i run this, i get the following error:
from this i have understood that there is an issue on the please help |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
the problem is with ethers version 6; there is no |
Beta Was this translation helpful? Give feedback.
-
This works for me.
|
Beta Was this translation helpful? Give feedback.
the problem is with ethers version 6; there is no
deployTransaction
function in version 6.You can use
const transactionReciept = contract.deploymentTransaction().wait(2);