Contract Table
GET /tables/contract?args
List creation-time information about smart contracts with embedded code and initial storage.
- Schema
- Response
- Example
Field | Description |
---|---|
row_id uint64 | Unique row identifier. |
address hash | Contract address base58check encoded. |
account_id uint64 | Unique row_id of related account entry. |
creator_id uint64 | Manager account row_id (deprecated in v005 Babylon). |
first_seen int64 | Block height of contract creation. |
last_seen int64 | Block height of last activity. |
storage_size int64 | Storage size allocated in bytes. |
storage_paid int64 | Storage bytes paid for in bytes. |
storage_burn money | Value burned for storage allocation. |
script bytes | Binary encoded Michelson script and initial contract storage. |
storage bytes | Binary encoded Michelson storage. |
iface_hash bytes | Short hash to uniquely identify the contract interface, first 8 bytes of the SHA256 hash over binary encoded Michelson script parameters. |
code_hash bytes | Short hash to uniquely identify the contract code, first 8 bytes of the SHA256 hash over binary encoded Michelson script code. |
storage_hash bytes | Short hash to uniquely identify the contract storage, first 8 bytes of the SHA256 hash over binary encoded Michelson storage. |
call_stats bytes | Big-endian uint32 call statistic counters per entrypoint. Only used on smart contracts. |
features string | Comma separated list of Michelson features used by this contract. Any of account_factory , contract_factory , set_delegate , lambda , transfer_tokens , chain_id , ticket , sapling . |
interfaces string | Comma separated list of standard interfaces implemented by this contract. Any of MANAGER , SET_DELEGATE , TZIP-005 , TZIP-007 , TZIP-012 , DEXTER (list may be extended). |
creator hash | Contract creator address. |
[
[
80, // row_id
"KT1Puc9St8wdNoGtLiD2WXaHbWU7styaxYhD", // address
289804, // account_id
289784, // creator_id
438378, // first_seen
655361, // last_seen
3805, // storage_size
3805, // storage_paid
0.951250, // storage_burn
"00000fb20200000fad...", // script
"07070a0000001601b6...", // storage
"18e4c571a45b1557", // iface_hash
"4c50617eaadde218", // code_hash
"0457ad54dd6d141f", // storage_hash
"000000000000000...", // call_stats
"lambda", // features
"", // interfaces
"tz1N74dH3VSeRTeKobbXUbyU82G8pqT2YYEM" // creator
]
]
curl "https://api.tzpro.io/tables/contract?address=KT1REHQ183LzfoVoqiDR87mCrt7CLUH1MbcV"
import (
"context"
"github.com/trilitech/tzpro-go/tzpro"
)
// create a new query object
q := tzpro.DefaultClient.Contract.NewQuery()
// add filters and configure the query
q.WithFilter(tzpro.FilterModeEqual, "iface_hash", "18e4c571a45b1557")
// execute the query
list, err := q.Run(context.Background())
// process contracts
if _, row := range list.Rows {
}