Skip to main content

Overview

The tenderly contracts remove command removes smart contracts from your Tenderly project. You can remove contracts by tag, by ID, or remove all contracts from a project.
Removing contracts is irreversible. Historical transaction data associated with these contracts will no longer be accessible in your project.

Usage

tenderly contracts remove [flags]

Flags

--tag
string
Remove all contracts with the specified tag from the configured project.
tenderly contracts remove --tag "v1.0.0"
This is useful for:
  • Cleaning up old deployment versions
  • Removing test deployments
  • Managing staged environments
--id
string
Remove a specific contract by its unique identifier. The ID format is eth:{network_id}:{contract_address}.
tenderly contracts remove --id "eth:1:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
ID Format: eth:{network_id}:{contract_address}
  • eth - Protocol prefix
  • {network_id} - Network chain ID (e.g., 1 for Mainnet)
  • {contract_address} - Contract address (checksummed or lowercase)
--project-slug
string
The slug of the project from which to remove contracts. Use this when you have multiple projects configured.
tenderly contracts remove --project-slug "my-project" --tag "staging"

Configuration

Configure your tenderly.yaml file:

Single Project

tenderly.yaml
account_id: your-username
project_slug: my-project

Multiple Projects

tenderly.yaml
projects:
  my-mainnet-project:
    networks:
      - "1"
  my-testnet-project:
    networks:
      - "5"
      - "11155111"
When using multiple projects, specify which project to remove contracts from using the --project-slug flag.

Examples

Remove All Contracts

Remove all contracts from the configured project:
tenderly contracts remove
Without any flags, this command removes ALL contracts from the project. Use with caution!

Remove by Tag

Remove all contracts tagged with a specific version:
tenderly contracts remove --tag "v1.0.0"
Remove staging environment contracts:
tenderly contracts remove --tag "staging"

Remove by Contract ID

Remove a specific contract from Ethereum Mainnet:
tenderly contracts remove --id "eth:1:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
Remove a contract from Polygon:
tenderly contracts remove --id "eth:137:0x1234567890123456789012345678901234567890"

Remove from Specific Project

When you have multiple projects, target a specific one:
tenderly contracts remove --project-slug "my-testnet-project" --tag "old-version"

Combined Flags

Remove specific contracts from a specific project:
tenderly contracts remove \
  --project-slug "my-project" \
  --tag "experimental"

Finding Contract IDs

To find contract IDs for removal:

Method 1: Tenderly Dashboard

  1. Go to your Tenderly Dashboard
  2. Navigate to Contracts in your project
  3. Click on the contract you want to remove
  4. Copy the ID from the URL or contract details

Method 2: Tenderly API

You can also query contract IDs via the Tenderly API:
curl -X GET \
  "https://api.tenderly.co/api/v1/account/{username}/project/{project-slug}/contracts" \
  -H "X-Access-Key: {your-access-key}"

Method 3: From Push Output

When you push contracts, note the contract addresses. The ID format is:
eth:{network_id}:{contract_address}
For example:
  • Contract: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb
  • Network: Ethereum Mainnet (1)
  • ID: eth:1:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb

Removal Behavior

1

Contract selection

The CLI identifies contracts to remove based on your flags:
  • No flags: All contracts in the project
  • --tag: All contracts with matching tag
  • --id: Single specific contract
2

Batch removal

All selected contracts are removed in a single operation:
Removing Smart Contracts for project: my-project
Successfully removed all selected smart contracts.
3

Verification

Verify removal in the Tenderly Dashboard. Removed contracts no longer appear in the contracts list.

Multi-Project Removal

When working with multiple projects:
tenderly.yaml
projects:
  production:
    networks:
      - "1"
      - "137"
  staging:
    networks:
      - "5"
Remove contracts from specific projects:
# Remove from production
tenderly contracts remove --project-slug "production" --tag "deprecated"

# Remove from staging
tenderly contracts remove --project-slug "staging"

What Gets Removed

When you remove a contract:
  • Contract source code and verification data
  • Contract metadata (name, tags, etc.)
  • Association with the project
What is NOT removed:
  • Historical blockchain data (transactions remain on-chain)
  • Forked networks that include the contract
  • Simulations that used the contract
Removed contracts can be re-added to the project by running tenderly contracts push again.

Troubleshooting

Cause: Invalid project slug or missing tenderly.yaml.Solution:
# Verify tenderly.yaml exists
cat tenderly.yaml

# Check project slug
tenderly whoami

# Re-initialize if needed
tenderly init
Cause: Invalid contract ID format or contract doesn’t exist.Solution:
  1. Verify ID format: eth:{network_id}:{address}
  2. Check network ID is correct
  3. Ensure contract exists in the project
  4. Verify address checksum
Cause: No contracts have the specified tag.Solution:
  1. Check available tags in Tenderly Dashboard
  2. Verify tag spelling (case-sensitive)
  3. List all contracts to see their tags
Cause: Multiple projects configured, some may have errors.Solution:
  1. Check error messages for specific projects
  2. Use --project-slug to target one project at a time
  3. Verify project access permissions

Use Cases

Clean Up Old Versions

Remove outdated contract versions:
# Remove old version
tenderly contracts remove --tag "v1.0.0"

# Keep current version (v2.0.0) untouched

Remove Test Deployments

Clean up after testing:
tenderly contracts remove --tag "test" --project-slug "testnet-project"

Manage Staging Environment

Remove staged contracts before production:
tenderly contracts remove --tag "staging"

Remove Specific Failed Deployment

Remove a single problematic contract:
tenderly contracts remove --id "eth:5:0xBADCONTRACTADDRESS"

Best Practices

  1. Use tags consistently: Tag contracts during push for easier removal later
    tenderly contracts push --tag "v1.0.0"
    # Later
    tenderly contracts remove --tag "v1.0.0"
    
  2. Verify before removing: Check which contracts will be removed
    • Review contracts in the Dashboard
    • Confirm tags match expected contracts
  3. Document removals: Keep track of removed contracts for auditing
  4. Test in staging first: Remove from test projects before production
  5. Backup contract data: Export important data before removal
  6. Use specific targeting: Prefer --id or --tag over removing all contracts

See Also

Build docs developers (and LLMs) love