5.5 KiB
5.5 KiB
Cronos Explorer Operations
Reference for Cronos Explorer API, contract verification, and deployment confirmation based on official Cronos docs.
Overview
| Resource | URL |
|---|---|
| Explorer | https://explorer.cronos.org |
| API Docs | https://explorer-api-doc.cronos.org/mainnet |
| API Base | https://explorer-api.cronos.org/mainnet/api |
| Contract Verification | https://explorer.cronos.org/verifyContract |
API Key (CRONOSCAN_API_KEY)
- Source: explorer.cronos.org/register
- Usage:
?apikey={key}on API requests - Rate limits: Higher with key (see Block Explorer and API Keys)
- Account dashboard: View API keys, contract verification status
API Format
Per Cronos docs:
GET https://explorer-api.cronos.org/mainnet/api/v1/{module}/{action}?apikey={key}
Working endpoint (tested):
api/v1/ethproxy/getBlockNumber— returns current block
Blockscout-style (?module=X&action=Y) is documented at cronos.org/explorer/api-docs. Forge verify-contract --verifier blockscout is incompatible (Cronos API path/format differs). Use manual verification at explorer.cronos.org/verifyContract.
Contract Verification
Per Contract Deployment and Verification:
1. Web interface (recommended for Foundry users)
- Mainnet: https://explorer.cronos.org/verifyContract
- Testnet: https://explorer.cronos.org/testnet/verifyContract
2. Programmatic (Hardhat)
- Cronos supports Hardhat out of the box
- See cronos-hardhat-boilerplate
- Requires API key in Hardhat config
3. Foundry
forge verify-contractdoes not successfully submit verification to Cronos Explorer (legacy Etherscan-style POST returns 404; Etherscan v2 does not support chain id 25).- Run
./scripts/deployment/verify-cronos-contracts.shto confirm bytecode on RPC and print manual steps (optionalCRONOS_EXPORT_SOURCES=1to regenerate Standard-JSON). - Recommended: Manual verification via the web interface above and
docs/deployment/CRONOS_VERIFICATION_RUNBOOK.md
Deployed Contracts (Cronos Chain 25)
| Contract | Address |
|---|---|
| WETH9 | 0x99B3511A2d315A497C8112C1fdd8D508d4B1E506 |
| WETH10 | 0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 |
| CCIPWETH9Bridge | 0x3Cc23d086fCcbAe1e5f3FE2bA4A263E1D27d8Cab |
| CCIPWETH10Bridge | 0x105F8A15b819948a89153505762444Ee9f324684 |
Confirmation Tasks
On-chain confirmation (RPC)
Use eth_getCode to confirm contracts have bytecode:
RPC="https://evm.cronos.org"
for addr in 0x99B3511A2d315A497C8112C1fdd8D508d4B1E506 0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 0x3Cc23d086fCcbAe1e5f3FE2bA4A263E1D27d8Cab 0x105F8A15b819948a89153505762444Ee9f324684; do
code=$(cast code $addr --rpc-url $RPC 2>/dev/null)
echo "$addr: $([ ${#code} -gt 10 ] && echo 'OK' || echo 'MISSING')"
done
API confirmation
./scripts/deployment/check-cronos-api.sh # Tests CRONOSCAN_API_KEY, block number
Manual verification
- Run
./scripts/deployment/export-cronos-verification-sources.shto generate flattened sources in.cronos-verify/ - Follow the step-by-step runbook:
docs/deployment/CRONOS_VERIFICATION_RUNBOOK.md - Check status:
./scripts/deployment/check-cronos-verification-status.sh - Or: Open https://explorer.cronos.org/verifyContract, enter address, select compiler/optimization, paste flattened source
- If the API returns
Invalid parameter(s)orJSON files not found, prefer the web UI and upload the generated*_standard_input.jsonfile instead of retrying the API blindly.
Cronos Explorer API Operations (per cronos.org/explorer/api-docs)
The Blockscout-style API supports:
| Module | Actions | Description |
|---|---|---|
| account | balance, balancemulti, txlist, txlistinternal, tokentx, tokenbalance, tokenlist, getminedblocks, listaccounts, eth_get_balance, pendingtxlist | Account balances, transactions |
| logs | getLogs | Event logs |
| token | getToken, getTokenHolders | ERC-20/721 info |
| stats | tokensupply, ethsupply, ethsupplyexchange, coinsupply, coinprice, totalfees | Supply and price |
| block | getblockreward, getblocknobytime, eth_block_number | Block data |
| contract | getsourcecode, getabi ( Blockscout) | Contract source/ABI |
Note: Actual base URL for module/action format on Cronos may differ; explorer.cronos.org/api returns HTML. Use RPC for reliable on-chain checks.
Related Scripts
scripts/deployment/check-cronos-api.sh— Test API key, block number, list deployed addressesscripts/deployment/export-cronos-verification-sources.sh— Export flattened source for manual verificationscripts/deployment/check-cronos-verification-status.sh— Check deployment status and verification linksscripts/deployment/verify-deployed-contracts.sh— Avalanche/Arbitrum automated; Cronos manual instructionsscripts/deployment/check-balances-gas-and-deploy.sh— Balance check includes Cronos
Related Docs
docs/deployment/CRONOS_VERIFICATION_RUNBOOK.md— Step-by-step manual verification with addresses and constructor args