Error: The constructor for contracts/voting.sol:voting has 1 parameters but 0 arguments were provided instead. #1439
Unanswered
Benrockiee
asked this question in
Q&A
Replies: 2 comments 2 replies
-
There is mistake in const { ethers, network, run } = require("hardhat")
async function main() {
const votingFactory = await ethers.getContractFactory("voting")
console.log("deploying, please wait....")
const voting = await votingFactory.deploy([
"0x48656c6c6f20576f726c64210000000000000000000000000000000000000000",
])
await voting.deployed()
console.log(`contract deployed to :${voting.address}`)
if (network.config.chainId === 4 && process.env.ETHERSCAN_API_KEY) {
console.log("awaiting block confirmation")
await voting.deployTransaction.wait(3)
await verify(
voting.address,
"0x48656c6c6f20576f726c64210000000000000000000000000000000000000000"
)
}
}
const verify = async (contractAddress, bytes32) => {
try {
await run("verify:verify", {
address: contractAddress,
- constructorArgument: bytes32,
+ constructorArguments: [bytes32] })
} catch (e) {
if (e.message.toLowerCase().includes("Already verified")) {
console.log("Already verified")
} else {
console.log(e)
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
Could you please share you contract code...It would be really great if you make a github repo and share |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When i deploy and tries to verify my contract, it deploys successfully but gives errors when trying to verify..
When i deployed, i converted to bytes32 as u can see in the deploy script and it deployed successfully but in the verify section, i had to add the hexadecimals(bytes32) to the args column but something is not right in the verify section
Please check it out
This is my Deploy script
This is the Error it gives
Beta Was this translation helpful? Give feedback.
All reactions