Prerequisites
You should already have a Hardhat project set up, and have deployed your smart contract successfully. See the deploy a smart contract using Hardhat 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)
Edit smart contract verification configuration
Openhardhat.config.js, and look at the etherscan and sourcify elements.
apiKey value is not needed, so any non-empty value is OK.
The inj_testnet network within customChains is already configured with the appropriate values for Injective Testnet.
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 0x98798cc92651B1876e9Cc91EcBcfe64cac720a1b, the command is: