States

Besides a transaction, a state is another type of data storage on the Ethereum blockchain. A smart contract typically has a few variables defined and the values of these variables are called blockchain states. Some key protocol/dApp metrics are stored inside the blockchain states and their values change over time or blocks.

To retrieve the value of a state of a smart contract, you need to call the corresponding smart contract function that would output the value.

contractAddress: The address of the contract that owns the state.

name 🌶: The name of the function that needs to be called to retrieve the state.

methodId: This is a value encoded based on the name and parameters of a function. Its uniqueness is not completely guaranteed. Most time, you don't need to pay attention to it. More technical details can be found here.

inputs: The input arguments of a function. All the arguments are stored in an array. For functions which don't have input arguments, its value is an empty array. Each argument has three attributes: name, type and value. Most time, you only need to pay attention to the value attribute.

outputs: The value of the state. It's stored in an array. Each element of the array has three attributes: name, type and value. Most time, you only need to pay attention to the value attribute.

blockNumber and blockTimestamp: The block number and the time of when the state was retrieved. BlockTimestamp is in UTC format.

Last updated

Was this helpful?