Build
Verify a contract
Verified source lets anyone read your contract and use it from Lib Explorer. Self-serve verification isn't enabled on Lib Testnet yet; here is what to do meanwhile.
A verified contract shows its Solidity source on Lib Explorer, gets a green verified badge, and its Read and Write tabs show real function names. WtLIB is an example: see its source.
Self-serve verification isn't enabled on Lib Testnet yet. The explorer's Verify & publish form and the forge verify-contract / hardhat verify commands will return an error for now. It's planned for the Open testnet phase of the roadmap.
#Until then
- Publish your source in your repository and link it from your project's README and website, with the compiler version and settings you used.
- Share the ABI so apps can call your contract. Foundry writes it to
out/<Contract>.sol/<Contract>.json; Hardhat toartifacts/. - Make builds reproducible. Pin the compiler (
solc_versionin Foundry,solidity.versionin Hardhat), the optimiser settings and the EVM version (cancun). That's what verification will check.
#When it's enabled
Verification will use the explorer's Blockscout verifier. With Foundry it will look like this:
forge verify-contract 0xYourContract src/Counter.sol:Counter \
--chain-id 54210 \
--verifier blockscout \
--verifier-url https://testnet.libchain.tech/api/This page will be updated, and the command above will start working, as soon as verification is switched on.