contract-verification
Skill8 starsChanged 2 months agoApache-2.0View on GitHub
Verify smart contracts on Celo. Use when publishing contract source code to Celoscan or Blockscout.
- Reads credentials
- Sends data out
In this repository15 other files it gives its agents.
- 8004Skill
- bridgingSkill
- celo-composerSkill
- celo-defiSkill
- celo-rpcSkill
- celo-stablecoinsSkill
- evm-foundrySkill
- evm-hardhatSkill
- evm-wallet-integrationSkill
- fee-abstractionSkill
- minipay-integrationSkill
- thirdwebSkill
- viemSkill
- wagmiSkill
- x402Skill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
After deploying a contract to Celo
- Distinctive: line 210
Add constructor arguments (ABI-encoded)
- Distinctive: line 228
Search for your contract address
- Distinctive: line 290
Search for "Sourcify" and activate it
- Distinctive: line 310
Verify contracts directly from Remix IDE using the Etherscan plugin.
- Distinctive: line 351
Verify constructor args are ABI-encoded correctly
- Distinctive: line 365
Wait a few minutes for indexing
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Contract Verification on Celo
This skill covers verifying smart contracts on Celo block explorers, making source code publicly readable.
When to Use
- After deploying a contract to Celo
- Publishing open-source contracts
- Enabling contract interaction via explorer UI
- Building trust with users
Verification Methods
| Method | Best For |
| Hardhat | Automated deployment workflows |
| Foundry | Foundry-based projects |
| Celoscan UI | Quick manual verification |
| Blockscout UI | Alternative explorer UI |
| Blockscout API | Programmatic verification |
| Sourcify | Decentralized verification |
| Remix | Browser-based verification |
Hardhat Verification
Configuration
Source: https://docs.celo.org/developer/verify/hardhat
// hardhat.config.js
require("dotenv").config();
require("@nomicfoundation/hardhat-verify");
module.exports = {
solidity: "0.8.28",
networks: {
celo: {
url: "https://forno.celo.org",
accounts: [process.env.PRIVATE_KEY],
chainId: 42220,
},
celoSepolia: {
url: "https://forno.celo-sepolia.celo-testnet.org/",
accounts: [process.env.PRIVATE_KEY],
chainId: 11142220,
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
customChains: [
{
network: "celo",
chainId: 42220,
urls: {
apiURL: "https://api.etherscan.io/v2/api",
browserURL: "https://celoscan.io/",
},
},
{
network: "celoSepolia",
chainId: 11142220,
urls: {
apiURL: "https://api.etherscan.io/v2/api",
browserURL: "https://sepolia.celoscan.io",
},
},
],
},
};Environment Variables
# .env
PRIVATE_KEY=0xYOUR_PRIVATE_KEY
ETHERSCAN_API_KEY=your_celoscan_api_keyGet an API key from Etherscan or Celoscan.
Verify Commands
Mainnet:
npx hardhat verify --network celo <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS>Testnet:
npx hardhat verify --network celoSepolia <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS>Example with Constructor Arguments
# Contract with constructor: constructor(string memory name, uint256 value)
npx hardhat verify --network celo 0x1234...5678 "MyToken" 1000000Complex Constructor Arguments
For complex arguments, create a file:
// arguments.js
module.exports = [
"MyToken",
"MTK",
1000000,
"0x1234567890123456789012345678901234567890",
];npx hardhat verify --network celo 0x1234...5678 --constructor-args arguments.jsFoundry Verification
Source: https://docs.celo.org/developer/verify/foundry
Configuration
# foundry.toml
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc_version = "0.8.28"
[rpc_endpoints]
celo = "https://forno.celo.org"
celoSepolia = "https://forno.celo-sepolia.celo-testnet.org"Environment Setup
export ETHERSCAN_API_KEY=<your_etherscan_api_key>Verify Commands
Mainnet (Chain ID 42220):
forge verify-contract \
--chain-id 42220 \
<CONTRACT_ADDRESS> \
src/MyContract.sol:MyContract \
--etherscan-api-key $ETHERSCAN_API_KEY \
--watchTestnet (Chain ID 11142220):
forge verify-contract \
--chain-id 11142220 \
<CONTRACT_ADDRESS> \
src/MyContract.sol:MyContract \
--etherscan-api-key $ETHERSCAN_API_KEY \
--watchWith Constructor Arguments
forge verify-contract \
--chain-id 42220 \
--etherscan-api-key $ETHERSCAN_API_KEY \
<CONTRACT_ADDRESS> \
src/MyContract.sol:MyContract \
--constructor-args $(cast abi-encode "constructor(string,uint256)" "MyToken" 1000000) \
--watchDeploy and Verify in One Command
forge create \
--rpc-url https://forno.celo.org \
--private-key $PRIVATE_KEY \
--etherscan-api-key $ETHERSCAN_API_KEY \
--verify \
src/MyContract.sol:MyContract \
--constructor-args "MyToken" 1000000Celoscan UI Verification
- Go to your contract on Celoscan
- Click the Contract tab
- Click Verify & Publish
- Select compiler settings:
- Compiler Type (Solidity Single/Multi-file)
- Compiler Version
- License Type
- Paste your source code
- Add constructor arguments (ABI-encoded)
- Complete CAPTCHA
- Click Verify and Publish
Blockscout Verification
Celo has a Blockscout explorer at celo.blockscout.com that supports contract verification.
Blockscout URLs
| Network | Explorer URL | API Base |
| Mainnet | https://celo.blockscout.com | https://celo.blockscout.com/api/v2 |
| Sepolia | https://celo-sepolia.blockscout.com | https://celo-sepolia.blockscout.com/api/v2 |
UI Verification
- Go to celo.blockscout.com (or celo-sepolia.blockscout.com for testnet)
- Search for your contract address
- Click Code tab
- Click Verify & Publish
- Select verification method:
- Via flattened source code - Single file with all imports inlined
- Via standard input JSON - Compiler standard JSON input
- Via Sourcify - Decentralized verification
- Fill in compiler settings (version, optimization, EVM version)
- Submit verification
API Verification
Blockscout provides a REST API for programmatic verification.
Flattened Source Code:
curl -X POST "https://celo.blockscout.com/api/v2/smart-contracts/0xYOUR_ADDRESS/verification/via/flattened-code" \
-H "Content-Type: application/json" \
-d '{
"compiler_version": "v0.8.28+commit.7893614a",
"source_code": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n...",
"is_optimization_enabled": true,
"optimization_runs": 200,
"contract_name": "MyContract",
"evm_version": "paris",
"license_type": "mit"
}'Standard JSON Input:
curl -X POST "https://celo.blockscout.com/api/v2/smart-contracts/0xYOUR_ADDRESS/verification/via/standard-input" \
-F "compiler_version=v0.8.28+commit.7893614a" \
-F "contract_name=MyContract" \
-F "license_type=mit" \
-F "files[0]=@standard-input.json"API Endpoints:
- Flattened:
POST /api/v2/smart-contracts/{address}/verification/via/flattened-code - Standard JSON:
POST /api/v2/smart-contracts/{address}/verification/via/standard-input - Multi-part:
POST /api/v2/smart-contracts/{address}/verification/via/multi-part - Sourcify:
POST /api/v2/smart-contracts/{address}/verification/via/sourcify
Source: https://docs.blockscout.com/devs/verification
Sourcify Verification
Sourcify provides decentralized contract verification that works across multiple explorers.
Source: https://docs.celo.org/developer/verify/remix
Benefits
- Decentralized storage of verified source code
- Works with Blockscout and other explorers
- Metadata hash verification ensures exact source match
Using Remix Sourcify Plugin
- Open Remix IDE
- Go to Plugin Manager (plug icon)
- Search for "Sourcify" and activate it
- Deploy your contract to Celo
- In the Sourcify plugin:
- Select the deployed contract
- Choose the network (Celo Mainnet: 42220, Sepolia: 11142220)
- Click Verify
- Contract will be verified on Sourcify and visible in Blockscout
Programmatic Sourcify Verification
curl -X POST "https://sourcify.dev/server/verify" \
-F "address=0xYOUR_ADDRESS" \
-F "chain=42220" \
-F "files[0]=@MyContract.sol" \
-F "files[1]=@metadata.json"Remix Verification
Verify contracts directly from Remix IDE using the Etherscan plugin.
Source: https://docs.celo.org/developer/verify/remix
Setup
- Open Remix IDE
- Go to Plugin Manager
- Activate Etherscan - Contract Verification plugin
Verification Steps
- Deploy your contract to Celo via Remix
- Open the Etherscan plugin (checkmark icon)
- Enter your Celoscan API key
- Select the contract to verify
- Choose network:
- Celo Mainnet (Chain ID: 42220)
- Celo Sepolia (Chain ID: 11142220)
- Click Verify
Configuration for Celo
In Remix settings, add custom network:
- Network Name: Celo Mainnet
- Chain ID: 42220
- API URL: https://api.celoscan.io/api
- Browser URL: https://celoscan.io
Troubleshooting
"Unable to verify"
Causes:
- Compiler version mismatch
- Optimizer settings mismatch
- Wrong constructor arguments
Solutions:
- Match exact compiler version used in deployment
- Match optimizer settings (enabled, runs)
- Verify constructor args are ABI-encoded correctly
"Already verified"
Contract is already verified. Check the explorer to see the source code.
"Contract not found"
Causes:
- Wrong contract address
- Contract not yet indexed
Solutions:
- Double-check the address
- Wait a few minutes for indexing
Proxy Contracts
For proxy contracts, verify both:
- The implementation contract
- The proxy contract
Then link them on Celoscan:
- Go to proxy contract
- Click "More Options"
- Select "Is this a proxy?"
- Follow verification steps
API Endpoints
| Network | API URL |
| Mainnet | https://api.celoscan.io/api |
| Sepolia | https://api-sepolia.celoscan.io/api |
Dependencies
For Hardhat:
{
"devDependencies": {
"@nomicfoundation/hardhat-verify": "^2.0.0",
"hardhat": "^2.19.0"
}
}Additional Resources
- verification-config.md - Complete configuration examples
Source of truth: Celopedia
These skills are focused, task-level references. For anything broader — verified contract addresses, ecosystem and protocol data, listing requirements, grants, governance, migration guides, or cross-cutting Celo questions — Celopedia is the canonical source and is kept current. Where this skill and Celopedia disagree, Celopedia wins.
npx skills add celo-org/celopedia-skillsDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

