Skip to main content
POST
/
v1
/
account
/
{accountSlug}
/
project
/
{projectSlug}
/
address
Add contract to project
curl --request POST \
  --url https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/address \
  --header 'Content-Type: application/json' \
  --header 'X-Access-Key: <api-key>' \
  --data '
{
  "network_id": "1",
  "address": "0x94C87A7b26980AE7AAA361c5C7e03E632ab36e6C",
  "display_name": "My new contract name"
}
'
{
  "id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
  "contract": {
    "id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
    "contract_id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
    "network_id": "1",
    "public": true,
    "verified_by": "etherscan",
    "address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
    "contract_name": "ERC20ByMetadrop",
    "type": "contract",
    "compiler_version": "v0.8.21+commit.d9974bed",
    "optimizations_used": true,
    "optimization_runs": "200",
    "created_at": "2023-12-08 22:36:21 +0000 UTC",
    "language": "solidity"
  },
  "account": {
    "id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
    "contract_id": "eth:1:0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
    "network_id": "1",
    "public": true,
    "verified_by": "etherscan",
    "address": "0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c",
    "contract_name": "ERC20ByMetadrop",
    "type": "contract",
    "compiler_version": "v0.8.21+commit.d9974bed",
    "optimizations_used": true,
    "optimization_runs": "200",
    "created_at": "2023-12-08 22:36:21 +0000 UTC",
    "language": "solidity"
  },
  "project_id": "1830efff-aa75-481e-b464-cedaf8b90960",
  "added_by_id": "7d5e8b1f-8bf8-4eae-a70f-fb7d354b1cc2",
  "details_visible": true,
  "include_in_transaction_listing": true,
  "display_name": "My new contract name",
  "account_type": "contract",
  "added_at": "2023-12-08 22:36:26.410442295 +0000 UTC m=+33221.750982874"
}

Authorizations

X-Access-Key
string
header
required

An API key is a token that a client provides when making API calls. The key can be sent as a request header:

curl 'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate' \
  -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
  ...

Learn how to generate API access tokens at Tenderly Docs.

Path Parameters

accountSlug
string
required

Account slug of the user

projectSlug
string
required

Project slug of the account

Body

application/json

Add contract to project payload

network_id
string
required

ID of the network.

Example:

"1"

address
string
required

A verified smart contract address.

Example:

"0x94C87A7b26980AE7AAA361c5C7e03E632ab36e6C"

display_name
string

Optional name of the contract to be displayed.

Example:

"My new contract name"

Response

A successful response.

An object with details about added contract.