TypeError: simpleStorage.deploymentTransaction.wait is not a function #6099
Answered
by
tusharr1411
Aideepakchaudhary
asked this question in
Q&A
-
I'm on lesson 6, But I'm getting this error when I tried to deploy on sepolia testnet
deploy.js Code async function main() {
const SimpleStorageFactory = await ethers.getContractFactory(
"SimpleStorage" // contract name
);
console.log("Deploying contract...");
const simpleStorage = await SimpleStorageFactory.deploy();
// await simpleStorage.deployed();
console.log(`Deploying Address to ${simpleStorage.target}`); // target fetch the contract address.
if(network.config.chainId === 11155111 && process.env.ETHERSCAN_API_KEY) {
await simpleStorage.deploymentTransaction.wait(6); // we are waiting so that the transaction get reflect on ethscan.
await verify(simpleStorage.target, []);
console.log(`contract verified!`);
}
// Interact with the contract
const currentValue = await simpleStorage.retrieve();
console.log(`current value is: ${currentValue}`);
// Update the current value
const transactionResponse = await simpleStorage.store(7);
await transactionResponse.wait(1);
const updatedValue = await simpleStorage.retrieve();
console.log(`Updated Value is: ${updatedValue}`);
} |
Beta Was this translation helpful? Give feedback.
Answered by
tusharr1411
Sep 6, 2023
Replies: 1 comment 1 reply
-
use parentheses after deploymentTransaction... |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Aideepakchaudhary
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use parentheses after deploymentTransaction...
It should be like this :
await simpleStorage.deploymentTransaction().wait(6);