This blog is written by nicholaschin.eth.
Contract verification allows smart contract developers to prove and publish the source code of the contracts deployed on-chain.
As your smart contracts for your NFT marketplace or governance token grows in size, so would the number of parameters and files you have to include in your verification process.
Plugins help automate this as much as possible; detecting compiler settings, metadata, libraries, and imported files to be submitted to Etherscan. They’re usually also baked-in to IDEs and developer tooling that you’re already using.
Here are 4 plugins built by the community that makes contract verification feel like writing “Hello World”!
Uses Solidity Json Input format ✅
Custom constructor arguments ✅
Custom library address inputs ✅
Built-in support for most networks plus custom explorer option ✅
Hardhat is running as one of the most popular Ethereum development environments out there, with features such as compilers, node simulation, tests, and much more.
Once you’ve deployed your contract, simply install the Hardhat Etherscan plugin via npm and run npx hardhat verify
to automatically submit contracts to Etherscan and any similar “scan” explorers your project is supported on.
Hardhat also has a tasks feature, which you can automate and repeat this verification process as needed across multiple chains.
Uses Solidity Json Input or Single File format ✅
Custom constructor arguments ✅
Custom library address inputs ❌
Built-in support for most networks plus custom explorer option ✅
Foundry is a rising development toolkit, focused on the speed and performance of Rust that it’s written in.
A verification module is baked into it, which supports submitting this as a multifile contract or flattening it into a single file using the --flatten
flag.
This plugin goes well with those already within the Rust ecosystem, and can be easily installed with Cargo!
Uses Solidity Json Input format ✅
Custom constructor arguments ✅
Custom library address inputs ❌
Built-in support for most networks plus custom explorer option ✅
One of the earliest Solidity development tools, devs will remember and still go on to love developing with Truffle.
Truffle users can and have always been able to use the verification plugin developed by @rkalis to submit verifications, easily integrated into your project via an npm package.
Once you have it added, simply run truffle run verify YourContractName --network mainnet
or to any chain you need this on!
Uses Solidity Json Input format ✅
Custom constructor arguments ✅
Custom library address inputs ❌
Only Ethereum mainnet and testnets supported ❌
Not leaving out web devs, Remix is an online, no-install web IDE that you can whip up and deploy contracts within your own browser.
The verification plugin comes from activating the Etherscan - Contract Verification
module from plugin manager.
One thing to note is while Remix can be used with any EVM network, the verification module only supports the Ethereum network at the moment.
They do however have a Flattener
plugin which you can manually compile and submit source code to other explorers.
Share your new plugins, thoughts, or issues with us through a contact or via Blockscan Chat to nicholaschin.eth💡
Open source the world, verifyooors!