Lesson 6 : Verification #1592
Replies: 2 comments
-
const verify = async (contractAddress, args) => {
console.log("Verifying contract...")
try {
await run("verify:verify", {
address: contractAddress,
constructorArguments: args,
})
} catch (e) {
if (e.message.toLowerCase().includes("already verified")) {
console.log("Already Verified!")
} else {
console.log(e)
}
} as you can see here if our contract is already verified first then no need of verifying it again as per our code |
Beta Was this translation helpful? Give feedback.
-
@DhruvalBhuva The primary purpose of verifying the smart contract is to ensure people that the things/values a product is claiming to offer are authentic. If people want, they can easily verify that from the code. Etherscan, on the other hand, gives this guarantee of the code that is uploaded on blockchain and on etherscan are the same, so people can trust that it is the real code. Etherscan has the mechanism that if once a code is verified, next time it will simply tell that this code is already verified. And that thing we are taking care of inside catch block (see code above). Hope it helps you to understand we second time is not important. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In lesson 6 sir get verification of contract on rinkeby network, when I try to verify 2nd time same, it's gives an error :
Why can't we verify same contract twice ?
Beta Was this translation helpful? Give feedback.
All reactions