Via hardhat plugin
Hardhat is a full-featured development environment for contract compilation, deployment and verification. The Hardhat Etherscan plugin supports contract verification on U2U Chain blockchain explorer.
Last updated
Hardhat is a full-featured development environment for contract compilation, deployment and verification. The Hardhat Etherscan plugin supports contract verification on U2U Chain blockchain explorer.
Last updated
If you are starting from scratch, create an npm project by going to an empty folder (npm version 7 or higher is recommended):
Once your project is ready:
npm instructions
Run npx hardhat init
in your project folder and follow the instructions to create ().
If you select Create a Typescript project, a simple project creation wizard will ask you some questions, please proceed with all "y" (yes).
After that, the wizard will create a sample project with some directories and files and install the necessary dependencies. The initialized project has the following structure:
You can include constructor arguments with the verify task.
In that:
DEPLOYED_CONTRACT_ADDRESS
: your deployed contract address
[ARG_1 ARG_2 ...]
: arguments that have been passed to the constructor or initialize function. More detail please see:
Back to our sample project, you can take a look at contract verification:
After the task is successfully executed, you'll see a link to the publicly verified code of your contract.
Your basic (hardhat.config.js
or hardhat.config.ts
) will be setup to support the network you are working on.
Here we add an RPC url without an API key, however some value is still required. You can use any arbitrary string. .
Read more: