Skip to main content
POST
/
v1
/
account
/
{accountSlug}
/
project
/
{projectSlug}
/
contracts
/
encode-states
Encode state overrides
curl --request POST \
  --url https://api.tenderly.co/api/v1/account/{accountSlug}/project/{projectSlug}/contracts/encode-states \
  --header 'Content-Type: application/json' \
  --header 'X-Access-Key: <api-key>' \
  --data '
{
  "networkID": "1",
  "stateOverrides": {
    "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": {
      "value": {
        "balanceAndBlacklistStates[0xAd4A638e2476C5645c1adF659EA8105FE3C1031e]": "1000"
      }
    }
  },
  "blockNumber": "-1"
}
'
{}

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

Encode contract state overrides payload

networkID
string
required

ID of the network.

Example:

"1"

stateOverrides
stateOverrides · object
required

Overrides for specific state objects.

Example:
{
  "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": {
    "value": {
      "balanceAndBlacklistStates[0xAd4A638e2476C5645c1adF659EA8105FE3C1031e]": "1000"
    }
  }
}
blockNumber
string

Number of the block to be used for the encoding states.

Example:

"-1"

Response

A successful response.

An object with details about state overrides.