Chainlens block explorer provides a source code verification feature that allows deployed contracts on blockchain networks to be verified and interacted with via the Chainlens user interface.
Video Walkthrough
The below video demonstrates how to upload smart contract source code and interact with the smart contracts from within Chainlens.
Prerequisites
- You should have a smart contract written in Solidity, compiled, and deployed to your preferred EVM-compatible network. You should be able to locate the contract in Chainlens using the contract's address.
- You have the compiled source code and metadata. Read more about contract metadata.
Getting the Contract Metadata
- Using
solc --metadata
command as explained in the solidity documentation. - The contracts metadata can be found in the
artifacts/build-info/
directory as a .json file for hardhat projects. - Truffle adds the contract's compiled files in the
build/contracts/
folder.
Source Code Verification
On the view of the contract in Chainlens click on the Source Code tab.
From the Source Code tab, upload the contract's solidity source code and the generated metadata.
The source code verification status will be changed, and the contract's source codes and ABI will be visible after successful verification.