- Manual verification (Berascan) — Verification via the block explorer UI
- Hardhat — Verification using Hardhat’s Etherscan plugin
- Forge — Verification using Foundry’s
forge verify-contract - Remix — Verification from the Remix IDE Contract Verification plugin
Requirements
- A deployed smart contract on Berachain
- The contract’s source code
- The contract address
- Tooling for the chosen method (see sections below)
Manual Verification (Berascan)
Step 1: Open the contract on Berascan
Open the block explorer and go to the contract’s page by searching for its address:- Mainnet: berascan.com
- Bepolia testnet: testnet.berascan.com
Step 2: Start verification
On the contract page, open the Verify and Publish link. You are taken to the verification form: testnet.berascan.com/verifyContract on Bepolia, or the mainnet equivalent on Berascan.Step 3: Enter contract details
Fill in the form:- Contract Address — The deployed contract address (often pre-filled if opened from the contract page).
- Compiler Type — Choose Solidity (Single file) for a flattened contract.
- Compiler Version — The exact Solidity version used to compile the deployed contract (e.g.
v0.8.28+commit.7893614a). - Open Source License Type — e.g. MIT License.
- Terms of Service — Accept the terms.
- Click Continue.
Step 4: Upload source code
On the Verify & Publish step:- Confirm the shown contract address, compiler type (e.g. SINGLE FILE / CONCATENATED METHOD), and compiler version.
- Paste the flattened contract source into the source code field.
- Optionally set optimization, run count, and EVM version under Advanced Configuration.
- Click Verify & Publish.
Contracts that compile in Remix typically compile here as well. Compilation is limited to about 45 seconds per contract. Contracts deployed by another contract (factory pattern) have limited support.
Step 5: Confirmation
Berascan verifies the contract, usually within a few seconds. After success, the contract is readable on the explorer and can be interacted with from Berascan.Troubleshooting
If verification fails, confirm:- The compiler version matches the one used at deployment.
- The source code is complete and matches the deployed bytecode (no edits after deployment).
- Constructor arguments are correct and encoded as used at deployment.
- The contract address is correct and deployed on the selected network.
Hardhat Verification
Use Hardhat’s Etherscan plugin to verify contracts from the command line or after deployment.Requirements
- Hardhat v3.0.0 or later
- An Etherscan API key (V2 API; same key works for Berascan)
- The deployed contract and its constructor arguments
Configuration
Store the API key in Hardhat’s keystore (or use environment variables):hardhat.config.ts, add verification and chain descriptor entries. Merge the following into your existing config:
networks (or equivalent) use the same chain IDs (80069 for Bepolia, 80094 for mainnet) so the correct explorer is used.
Verification command
Add a script inpackage.json:
Example output
Forge Verification
Use Foundry’sforge verify-contract to verify contracts from the command line.
Requirements
- Foundry v1.3.1 or later (Etherscan V2 API support)
- Etherscan API key
- The deployed contract and, if applicable, its constructor arguments
Verification command
Encode constructor arguments withcast abi-encode and pass them to forge verify-contract. Use the chain name that Forge uses for Berachain (e.g. Berachain Bepolia for testnet). Set ETHERSCAN_API_KEY in your environment before running.
Bepolia (testnet):
For contracts with constructor parameters, encode them with
cast abi-encode "constructor(type1,type2,...)" "arg1" "arg2" ... and pass the result to --constructor-args. For contracts with no constructor parameters, omit the --constructor-args flag.Example output
Remix Verification
The Remix IDE Contract Verification plugin supports Berascan and Beratrail. Use it when you develop or deploy from Remix and want to verify in the same environment.Requirements
- Contract deployed on a public Berachain network (mainnet or Bepolia)
- Contract compiled in Remix
- Constructor arguments used at deployment (if any)
- Etherscan API key for Berascan verification
Enabling the plugin
- Open remix.ethereum.org.
- In the Plugin Manager, enable CONTRACT VERIFICATION.
- Open the Contract Verification plugin from the sidebar.
Supported explorers
- Berascan — Etherscan-based; requires an Etherscan API key.
- Beratrail — Routescan-based; enabled by default.
Verification steps
- Compile the contract in Remix.
- In the plugin, select the verification service (Beratrail and/or Berascan).
- Enter the deployed contract address.
- If the contract has constructor parameters, enter the constructor arguments in the format the plugin expects.
- Submit verification.
Proxy verification
For a contract behind a proxy:- Enable The deployed contract is behind a proxy.
- Enter the proxy contract address.
- Submit; the plugin verifies both proxy and implementation.
Proxy verification is supported only with Berascan (Etherscan-based), not with Beratrail.
Settings
In the plugin or Remix settings you can:- Add and store Etherscan API keys (required for Berascan).
- Adjust API URLs for verification services.
- Manage settings per chain.
Verification results
- Receipts — Verification status and result for each submission.
- Lookup — Check whether a contract is verified and download source.
- Status indicators — Hover for details when verification fails.
For full plugin behavior and options, see the Remix contract verification documentation.