Skip to main content

Overview

The tenderly contracts verify command uploads and verifies your smart contracts on Tenderly. Unlike push, this command only verifies the contracts without enabling active monitoring.
Use verify when you only need contract verification for debugging existing transactions. Use push when you want both verification and active monitoring of new transactions.

Usage

tenderly contracts verify [flags]

Prerequisites

1

Authentication

Log in to Tenderly:
tenderly login
2

Compile contracts

Build your contracts to generate artifacts:
# Hardhat
npx hardhat compile

# Truffle
truffle compile

# Foundry
forge build
3

Initialize project

Connect to your Tenderly project:
tenderly init

Flags

--networks
string
A comma-separated list of network IDs to verify. Only contracts deployed to the specified networks will be verified.
tenderly contracts verify --networks "1,5"
Common Network IDs:
  • 1 - Ethereum Mainnet
  • 5 - Goerli Testnet
  • 11155111 - Sepolia Testnet
  • 137 - Polygon Mainnet
  • 80001 - Polygon Mumbai Testnet
  • 56 - BNB Smart Chain Mainnet
  • 97 - BNB Smart Chain Testnet
  • 42161 - Arbitrum One
  • 421614 - Arbitrum Sepolia
  • 10 - Optimism Mainnet
  • 8453 - Base Mainnet

Configuration

Configure your tenderly.yaml file:
tenderly.yaml
account_id: your-username-or-org
project_slug: your-project-name
The verify command uses the project slug from tenderly.yaml. Unlike push, it does not support multiple projects in a single command.

Examples

Verify All Contracts

Verify all deployed contracts in your build directory:
tenderly contracts verify

Verify Specific Networks

Verify contracts deployed only to Ethereum Mainnet and Polygon:
tenderly contracts verify --networks "1,137"

Verify Testnet Contracts

Verify contracts on test networks:
tenderly contracts verify --networks "5,11155111,80001"

Verification Process

When you run the verify command:
1

Contract detection

The CLI scans your build directory for compiled contracts:
Analyzing provider configuration...
We have detected the following Smart Contracts:
 ERC20Token
 NFTMarketplace
 Governance (not deployed to any network, will be used as a library contract)
2

Upload to Tenderly

Contract source code, ABI, and metadata are uploaded to Tenderly servers for verification.
3

Verification confirmation

Once complete, contracts are verified and available for transaction debugging:
Smart Contracts successfully verified.

What Gets Verified

The verification process includes:
  • Source code: Solidity files with original structure
  • Contract ABI: Interface definitions
  • Bytecode: Compiled contract code
  • Compiler settings: Version, optimization, and other metadata
  • Dependencies: Imported libraries and contracts

Verify vs Push

tenderly contracts verify

Use when:
  • You only need source code verification
  • Debugging specific past transactions
  • One-time contract verification
  • No monitoring needed
Result: Contract verified, no active monitoring

tenderly contracts push

Use when:
  • You want transaction monitoring
  • Need real-time alerts
  • Tracking contract activity
  • Active development/production
Result: Contract verified + active monitoring enabled

Troubleshooting

Cause: Missing or invalid build artifacts.Solution:
# Recompile your contracts
npx hardhat compile  # or truffle compile / forge build

# Verify build directory exists
ls -la artifacts/    # Hardhat
ls -la build/        # Truffle
ls -la out/          # Foundry
Cause: Contracts haven’t been deployed to any network.Solution:
  1. Deploy contracts to a network first
  2. Ensure deployment information is in build artifacts
  3. For OpenZeppelin projects, run:
    npx oz add ContractName
    npx oz deploy
    
Cause: CLI can’t find framework configuration files.Solution:
  1. Ensure you’re in the project root directory
  2. Use --project-dir flag to specify directory:
    tenderly contracts verify --project-dir /path/to/project
    
  3. Or use --force flag to bypass structure check:
    tenderly contracts verify --force
    
Cause: Contracts may be on unsupported networks or have issues.Solution:
  1. Check the network IDs in error output
  2. Verify deployment addresses are correct
  3. Ensure all networks are supported by Tenderly
  4. Check compiler version compatibility

Supported Frameworks

The verify command works with:
  • Hardhat: Reads from artifacts/ directory
  • Truffle: Reads from build/contracts/ directory
  • Foundry: Reads from out/ directory
  • Brownie: Reads from build/contracts/ directory
  • OpenZeppelin: Requires special setup (see troubleshooting)

Advanced Usage

Verify with Project Directory Flag

Specify a custom project directory:
tenderly contracts verify --project-dir ./my-contracts

Force Verification

Bypass directory structure validation:
tenderly contracts verify --force

Verify Specific Network Deployments

Combine with network filtering for precise control:
# Verify only mainnet deployments
tenderly contracts verify --networks "1"

# Verify multiple specific networks
tenderly contracts verify --networks "137,42161,10"

Network ID Reference

Common network IDs for verification:
NetworkChain IDNetwork ID
Ethereum Mainnet1"1"
Sepolia11155111"11155111"
Polygon137"137"
Polygon Mumbai80001"80001"
BSC56"56"
Arbitrum One42161"42161"
Optimism10"10"
Base8453"8453"
Avalanche C-Chain43114"43114"
Network IDs should be passed as strings in the --networks flag.

Best Practices

  1. Verify immediately after deployment: This ensures your contracts are debuggable right away
  2. Use network filters: Only verify networks you’re actively working with
  3. Keep build artifacts: Don’t delete build directories between deployment and verification
  4. Check framework compatibility: Ensure your framework is supported
  5. Upgrade to push: Consider using push instead if you need monitoring

See Also

Build docs developers (and LLMs) love