Skip to content

Verify contracts ​

The explorer at explorer.bkc.network is Blockscout. It verifies Solidity and Vyper sources and supports the standard methods: single file (flattened), multi-part, standard JSON input, and Vyper variants. Compilers are fetched on demand; any released solc 0.4.x–0.8.x version is available.

With Hardhat ​

Set bkc.explorerUrl in the network config (see Hardhat plugin) — the plugin registers the chain with @nomicfoundation/hardhat-verify for you, no etherscan.customChains needed:

bash
npx hardhat verify --network bkc 0xContract
npx hardhat verify --network bkc 0xContract "constructor" "arguments"

The warning about Etherscan v2 API keys is harmless: Blockscout ignores the key and the plugin supplies a placeholder.

In the explorer UI ​

Open the contract → Code → Verify & Publish, then fill in exactly what you compiled with:

FieldMust match
Compilerthe exact solc version, e.g. v0.8.28+commit.7893614a
EVM versionthe evmVersion you compiled with (paris, shanghai, cancun, …) — do not leave "default" if you set one
Optimizationenabled/disabled and the number of runs
Constructor argumentsABI-encoded, if the constructor takes any

Standard JSON input is the most reliable: upload the same JSON you fed to solc --standard-json and every setting travels with it.

Through the API ​

Blockscout exposes verification over HTTP — useful in CI:

bash
curl -X POST "https://explorer.bkc.network/api/v2/smart-contracts/0xContract/verification/via/standard-input" \
  -F "compiler_version=v0.8.28+commit.7893614a" \
  -F "contract_name=MyToken" \
  -F "license_type=mit" \
  -F "files[0]=@standard-input.json"

GET /api/v2/smart-contracts/verification/config lists the compiler and EVM versions on offer.

Two things Blockscout does that Etherscan does not ​

  • It matches by bytecode. Deploy a contract byte-identical to one already verified and its page shows that source under a banner saying it is not verified itself. hardhat verify then reports "already verified". Re-run with --force to verify your address in its own right (the starter's npm run verify does this automatically) — it still only succeeds if your source really produces the bytecode.
  • It verifies asynchronously. The address page can take a few seconds to update after the command returns.

Choosing an EVM version ​

BKC's EVM supports the EVM versions the explorer lists, up to cancun/prague. If you are unsure, compiling with paris avoids every newer opcode (PUSH0, MCOPY, transient storage) and always runs.

BKC testnet is unaudited. Do not hold value on it.