npm init
, and following the instructions. Recommend npm 7 or higher.
Once your project is ready:
npm instructions
npx hardhat
in your project folder and follow the instructions to create (more info here).
hardhat.config.js
.
hardhat.config.ts.
More info on using typescript with hardhat available here.
hardhat.config.js
or hardhat.config.ts
) will be setup to support the network you are working on. In this example we use the Optimism Sepolia test network and a .js
file.
Here we add an RPC url without an API key, however some value is still required. You can use any arbitrary string. More info.
If you prefer, you can migrate to hardhat-toolbox to use a plugin bundle.
In order to use Blockscout explorer for the verification, you have to specify the explorer details under a customChains
object. It includes:
chainID
- Network chain ID
apiURL
- Block explorer API URL
browserURL
- Block explorer URL
customChains
must match the network name in the apiKey
object.
--force
flag*.
It prevents Hardhat to check if the contract is already verified, and force it to send verification request anyway. Notice, that it is helpful only if the contract was automatically verified partially. That way, a new verification sources would be saved. If the contract was fully verified already, that just returns an error.
@nomicfoundation/[email protected]
I am using an OpenZeppelin upgrades plugin implementation and receive an error on proxy contract verification. What should I do?