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.

State

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 States:

States consist of the following fields:

FieldDescriptionType
blockNumberthe block number at which this call was madeblknum
timestampthe timestamp of the block for this calltimestamp
datethe timestamp as a date (calculated)datetime
addressthe address of contract being calledaddress
accountTypethe type of account at the given blockstring
balancethe balance of the account at the given blockwei
codethe code of the accountstring
deployedfor smart contracts only, the block number at which the contract was deployedblknum
noncethe nonce of the account at the given blockuint64
proxythe proxy address of the account at the given blockaddress

Token

The token data model represents the name, decmials, token symbol, and optionally the totalSupply of an ERC-20 token.

The following commands produce and manage Tokens:

Tokens consist of the following fields:

FieldDescriptionType
blockNumberthe block at which the report is madeblknum
transactionIndexthe transaction index (if applicable) at which the report is madeblknum
timestampthe timestamp of the blocktimestamp
datethe timestamp as a date (calculated)datetime
totalSupplythe total supply of the token contractint256
addressthe address of the token contractaddress
holderthe holder address for which we are reportingaddress
priorBalancethe holder’s asset balance at its prior appearanceint256
balancethe holder’s asset balance at the given block heightint256
diffthe difference#&44; if any#&44; between the prior and current balanceint256
namethe name of the token contract, if availablestring
symbolthe symbol of the token contractstring
decimalsthe number of decimals for the token contractuint64
typethe type of token (ERC20 or ERC721) or noneTokenType

Result

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 Results:

Results consist of the following fields:

FieldDescriptionType
blockNumberthe block number at which this call was madeblknum
timestampthe timestamp of the block for this calltimestamp
datethe timestamp as a date (calculated)datetime
addressthe address of contract being calledaddress
namethe name of the function callstring
encodingthe encoding for the function callstring
signaturethe canonical signature of the interfacestring
encodedArgumentsthe bytes data following the encoding of the callstring
articulatedOutthe result of the call articulated as other modelsFunction

Base types

This documentation mentions the following basic data types.

TypeDescriptionNotes
addressan ‘0x’-prefixed 20-byte hex stringlowercase
blknuman alias for a uint64
datetimea JSON formatted dateas a string
int256a signed big numberas a string
stringa normal character string
timestampa 64-bit unsigned integerUnix timestamp
uint64a 64-bit unsigned integer
weian unsigned big numberas a string

Copyright (c) 2024, TrueBlocks, LLC. All rights reserved. Generated with goMaker.

Edit this page on GitHub