Contract Verification
Overview

Smart Contract Verification

Smart contract verification involves submitting the source code of your smart contracts to ensure that the deployed bytecode on the blockchain matches the source code provided. Verification is essential for Tenderly’s development tooling to work properly.

Tenderly supports multiple verification methods.


Infrastructure compatibility

Tenderly exposes an Etherscan-compliant verification API able to verify contracts that are deployed on:

Verification on Tenderly development infrastructure

Tenderly development, staging, and testing infrastructure - Forks, DevNets, and TestNets, expose an RPC URL for access. You get the Etherscan-compliant verification URL by:

  • adding /verify/etherscan to the URL,
  • replacing the $TENDERLY_ACCOUNT and $TENDERLY_PROJECT with your account details. Follow this guide,
  • adhering to the following formats, depending on the technology you’re using:
## For TestNets
VERIFIER_URL=$TENDERLY_VIRTUAL_TESTNET_RPC/verify/etherscan
 
## For DevNets
VERIFIER_URL=https://api.tenderly.co/api/v1/account/$TENDERLY_ACCOUNT/project/$TENDERLY_PROJECT/etherscan/verify/devnet/<resourceId>
 
## For Forks
VERIFIER_URL=https://api.tenderly.co/api/v1/account/$TENDERLY_ACCOUNT/project/$TENDERLY_PROJECT/etherscan/verify/fork/<resourceId>

Examples:

## TestNets
https://virtual.base.rpc.tenderly.co/872ac073-1de1-4422-b01d-8d057781d77d/verify/etherscan
 
## For DevNets
## https://rpc.vnet.tenderly.co/devnet/test/c6a552cd-3064-4e95-9fb3-8cee2e317296/
 
https://api.tenderly.co/api/v1/account/$TENDERLY_ACCOUNT/project/$TENDERLY_PROJECT/etherscan/verify/devnet/c6a552cd-3064-4e95-9fb3-8cee2e317296/
 
## Forks
## Fork RPC: https://rpc.tenderly.co/fork/68cc4cd5-2a3b-441a-afbb-4dea745a22c2
https://api.tenderly.co/api/v1/account/$TENDERLY_ACCOUNT/project/$TENDERLY_PROJECT/etherscan/verify/fork/68cc4cd5-2a3b-441a-afbb-4dea745a22c2

Verification visibility modes

You can verify contracts in two modes of visibility:

  • Privately on public networks (mainnets and testnets). Your contracts will be verified only in your Tenderly project and organization.
  • Publicly on public networks (mainnets and testnets). This is the default verification method.

Verification modeAll Tenderly UsersVerifier AllianceProject CollaboratorsOrganization Members
Public verification
on public mainnet and testnets
Private verification
on public mainnet and testnets
TestNets
DevNets
Forks

Configuring private verification

When verifying with hardhat, it’s necessary to set the config.tenderly.private flag in hardhat.config.ts . Contracts will be verified publicly unless you specify this flag.

When verifying with Foundry, the Verifier URL should end with /public:

## private verification URL
https://api.tenderly.co/api/v1/account/me/project/project/etherscan/verify/network/8253
 
## public verification URL
https://api.tenderly.co/api/v1/account/me/project/project/etherscan/verify/network/8253/public

The importance of smart contract verification

Having your contracts verified unlocks powerful Tenderly tools designed to streamline your development process. If your smart contract is not verified either privately or publicly, your use of Tenderly tooling will be limited.

  • Decoded transactions: Gain insights into transactions with decoded call traces, events, state changes, and gas usage.
  • Debugging: Use decoded information for efficient debugging and transaction analysis, making it easier to identify and fix issues.
  • Optimization opportunities: Access precise gas usage profiling to identify and implement optimizations, reducing costs and improving performance.
  • Enhanced collaboration: Share verified contracts with team members and auditors securely to facilitate collaboration and speed up auditing processes.