Chain state

The data structures produced by tools in the Chain State category provide details on the balances (ERC20 or ETH) of an address against a particular token or block. Additionally, direct access to a smart contract’s state may be queries with the chirfa state tool. Data structures in that case are specific to the particular smart contract.

Each data structure is created by one or more tools which are detailed below.

EthState

The state object displays information about the type of account associated with an address, the block the address first appeared on the chain, the proxy address if the address is a proxied smart contract as well as account balance and a few other things.

The following commands produce and manage EthStates:

EthStates consist of the following fields:

FieldDescriptionType
blockNumberthe block number at which this state was takenblknum
addressthe address of the state being queriedaddress
proxyif this is a proxy, this is the proxied-to addressaddress
balancethe balance at the address at the given block heightwei
noncethe nonce of the address at the given block heightuint64
codethe byte code at the address (if this is a smart contract)bytes
deployedthe block number at which this smart contract was deployed (if a smart contract)blknum
accttypethe type of the address at the given blockstring

EthCall

For the chifra state --call tool, the result is the result returned by the call to the smart contract. This is the decoded output value of the smart contract call.

The following commands produce and manage EthCalls:

EthCalls consist of the following fields:

FieldDescriptionType
blockNumberthe block number at which this call was madeblknum
addressthe address of contract being calledaddress
signaturethe canonical signature of the interfacestring
encodingthe encoding for the function callstring
bytesthe bytes data following the encoding of the callstring
callResultthe result of the call to the contractFunction
compressedResultthe compressed version of the result of the call to the contractstring
deployedthe block number at which this smart contract was deployed (if a smart contract)blknum

TokenBalance

The data model displays the token balance records for the chifra tokens tool.

The following commands produce and manage TokenBalances:

TokenBalances consist of the following fields:

FieldDescriptionType
holderthe address for which we are reporting the token balanceaddress
balancethe balance at the address at the given block heightwei
addressthe address of the token contract being queriedaddress
namethe name of the token contract, if availablestring
symbolthe symbol for this token contractstring
decimalsthe number of decimals for the token contractuint64
isContracttrue if the address is a smart contract, false otherwisebool
isErc20true if the address is an ERC20, false otherwisebool
isErc721true if the address is an ERC720, false otherwisebool

Base types

This documentation mentions the following basic data types.

TypeDescriptionNotes
addressan ‘0x’-prefixed 20-byte hex stringlowercase
blknuman alias for a uint64
booleither true, false, 1, or 0
bytesan arbitrarily long string of bytes
stringa normal character string
uint64a 64-bit unsigned integer
weian unsigned big numberas a string

Edit this page on GitHub