Prerequisites
You should already have a Foundry project set up, and have deployed your smart contract successfully. See the deploy a smart contract using Foundry tutorial for how to do so.What is smart contract verification?
The process of verification does not have any effect on the smart contract itself, or any other state of the network. Instead, it is a standardised process through which network explorers are provided with the original source code of the smart contract deployed at a particular address. The network explorer independently compiles that source code, and verifies that the resultant bytecode is indeed a match with the bytecode present from the smart contract’s deployment transaction. If verification passes (there is a match), the block explorer “unlocks” an enhanced mode within for that particular smart contract’s page. More smart contract details are now displayed, including:- Full source code (Solidity)
- ABI (JSON)
- Transactions and events are shown with higher detail (parsed using ABI)
Run the verification command
Enter the following command:${SC_ADDRESS} with the address at which you deployed your smart contract.
For example, if the smart contract address is 0x213bA803265386C10CE04a2cAa0f31FF3440b9cF, the command is: