Skip to main content

Overview

The tenderly contracts push command uploads your deployed smart contracts to your Tenderly project. Once pushed, contracts are actively monitored and can be debugged using Tenderly’s advanced tools.
This command is intended for contracts deployed to public networks. For local development, consider using Tenderly DevNets or the Hardhat plugin.

Usage

tenderly contracts push [flags]

Prerequisites

1

Build your contracts

Ensure your contracts are compiled and build artifacts exist:
# For Hardhat
npx hardhat compile

# For Truffle
truffle compile

# For Foundry
forge build
2

Initialize Tenderly

Connect your project to Tenderly:
tenderly init
3

Deploy contracts

Deploy your contracts to a supported network. The CLI will read deployment information from your framework’s build directory.

Flags

--networks
string
A comma-separated list of network IDs to push. Only contracts deployed to these networks will be uploaded.
tenderly contracts push --networks "1,5,137"
Common Network IDs:
  • 1 - Ethereum Mainnet
  • 5 - Goerli Testnet
  • 11155111 - Sepolia Testnet
  • 137 - Polygon Mainnet
  • 80001 - Polygon Mumbai
  • 56 - BSC Mainnet
  • 42161 - Arbitrum One
  • 10 - Optimism Mainnet
--tag
string
Optional tag for filtering and referencing pushed contracts. Tags help organize and identify contract deployments.
tenderly contracts push --tag "v1.0.0"
tenderly contracts push --tag "production"
Tags are useful for:
  • Version tracking
  • Environment identification (staging, production)
  • Deployment grouping
--project-slug
string
The slug of a specific project to push contracts to. Use this when pushing to a single project from a multi-project configuration.
tenderly contracts push --project-slug "my-project"

Configuration

Single Project Setup

Configure your tenderly.yaml file with a single project:
tenderly.yaml
account_id: your-username
project_slug: my-project

Multiple Projects Setup

Push contracts to multiple projects simultaneously by defining a projects map:
tenderly.yaml
projects:
  my-mainnet-project:
    networks:
      - "1"    # Ethereum Mainnet
      - "137"  # Polygon Mainnet
  
  my-testnet-project:
    networks:
      - "5"        # Goerli
      - "11155111" # Sepolia
  
  my-all-networks-project:
    # Empty networks array pushes to all detected networks
  
  company-account/shared-project:
    # Use full identifier for shared/organization projects
    networks:
      - "1"
When using multiple projects, remove the project_slug property from your configuration. The CLI will push to all configured projects unless you specify --project-slug.

Examples

Basic Push

Push all deployed contracts from the current project:
tenderly contracts push

Push Specific Networks

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

Push with Tag

Push contracts with a version tag for tracking:
tenderly contracts push --tag "v2.1.0"

Push to Specific Project

When you have multiple projects configured, push to only one:
tenderly contracts push --project-slug "my-mainnet-project" --tag "production"

Combined Flags

Push specific networks with a tag to a specific project:
tenderly contracts push \
  --project-slug "my-project" \
  --networks "1,137" \
  --tag "release-2024-03"

What Gets Pushed

The CLI analyzes your build directory and pushes:
  • Deployed contracts: Contracts with network deployment information
  • Library contracts: Non-deployed contracts used as libraries
  • Source code: Solidity source files for verification
  • ABI and bytecode: Contract interfaces and compiled code
  • Compiler metadata: Compiler version and settings

Output

Successful push displays:
Analyzing Hardhat configuration...
We have detected the following Smart Contracts:
 MyToken
 MyNFT
 Governance (not deployed to any network, will be used as a library contract)

Successfully pushed Smart Contracts for project my-project. 
You can view your contracts at https://dashboard.tenderly.co/username/my-project/contracts

Troubleshooting

Cause: Build artifacts don’t exist or are in the wrong location.Solution:
  1. Run your framework’s compile command
  2. Ensure the build directory exists
  3. Check that contracts were actually deployed
Cause: Contracts haven’t been deployed to any network.Solution:
  1. Deploy your contracts to a network first
  2. Ensure deployment was successful
  3. Check that network information is in build artifacts
Cause: Contracts may be deployed to unsupported networks.Solution:
  1. Check the network IDs in the error message
  2. Verify the networks are supported by Tenderly
  3. Ensure deployment addresses are correct
Cause: Invalid project slug or missing configuration.Solution:
  1. Run tenderly init to set up configuration
  2. Verify project slug in tenderly.yaml
  3. Check that the project exists in your Tenderly dashboard

Best Practices

  1. Use tags for organization: Tag deployments by version, environment, or feature
  2. Filter networks: Use --networks to push only relevant deployments
  3. Multi-project workflows: Configure multiple projects for different environments
  4. Verify after push: Check the Tenderly dashboard to confirm contracts are visible
  5. Combine with CI/CD: Automate contract pushing in deployment pipelines

See Also

Build docs developers (and LLMs) love