-
I get the following error trying to verify the This is my main function from async function main() {
const SimpleStorageFactory = await ethers.getContractFactory("SimpleStorage");
console.log("Deploying SimpleStorage...");
const simpleStorage = await SimpleStorageFactory.deploy();
await simpleStorage.waitForDeployment();
console.log(
"Contract deployed to address: ",
await simpleStorage.getAddress()
);
if (network.config.chainId === 11155111 && process.env.ETHERSCAN_API_KEY) {
console.log("Waiting for 5 blocks to be mined...");
await simpleStorage.deployTransaction.wait(5); //wait is flagged as not existing on deployTransaction
await verify(simpleStorage.address.toString(), []);
}
} To be more specific, the error on the line containing |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
if (network.config.chainId === 11155111 && process.env.ETHERSCAN_API_KEY) {
console.log("Waiting for 5 blocks to be mined...");
await simpleStorage.waitForDeployment();
await verify(simpleStorage.address.toString(), []);
} |
Beta Was this translation helpful? Give feedback.
-
You have more than way, |
Beta Was this translation helpful? Give feedback.
You have more than way,
one way, using ethersJS
wait
method,another way, using Javascript
sleep
method.or manually, deploy, wait about one minute, then verify the contract.
See here (Hardhat Verify contract issue #5773)