Get Contract State

The Contract state from a contract on the network

This method will use 20 Compute Units.


The contract state from a contract on the network

get

Returns a list of all contract's slots. If no timestamp is provided, returns the current state.

Path parameters
contractIdOrAddressstringRequired

The ID or hex encoded EVM address (with or without 0x prefix) associated with this contract.

Pattern: ^(\d{1,10}\.){0,2}(\d{1,10}|(0x)?[A-Fa-f0-9]{40})$
Query parameters
limitinteger · int32 · min: 1 · max: 100Optional

The maximum number of items to return

Default: 25Example: 2
orderundefined · enumOptional

The order in which items are listed

Default: ascExample: descPossible values:
slotstringOptional

The slot's number

Example: {"summary":"--","value":""}Pattern: ^((eq|gte?|lte?)\:)?(0x)?[0-9A-Fa-f]{1,64}$
timestampstringOptional

The timestamp at which the contract state is

Example: 1234567890.0000007Pattern: ^\d{1,10}(.\d{1,9})?$
Responses
200
OK
application/json
get
GET /v1/YOUR_API_KEY/api/v1/contracts/{contractIdOrAddress}/state HTTP/1.1
Host: mainnet.hedera.validationcloud.io
Accept: */*
{
  "state": [
    {
      "address": "0000000000000000000000000000000000001f41",
      "contract_id": "0.1.2",
      "timestamp": "1586567700.453054000",
      "slot": "0x00000000000000000000000000000000000000000000000000000000000000fa",
      "value": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925"
    }
  ],
  "links": {
    "next": "/api/v1/transactions?timestamp=lt:1657598275.517984411"
  }
}

Last updated

Was this helpful?