EVM
On-chain Data Sources for EVM chains
Balance
Name: Balance
Type: integer
Gets the ETH balance of an address.
address
address
yes
source balance: integer = Balance {
address: 0xface...cafe
};
balance == 1000Call
Name: Call
Type: varies
Calls a function and gets the return value.
contract
address
yes
signature
string
yes
params
tuple<varies>
depends on signature
eth
integer
no (default 0)
block
integer
no
source addresses: list<address> = Call {
contract: 0xface...ddad,
signature: "function getAddresses(uint256 id) returns (address[])",
params: tuple(1),
eth: 1024
};
addresses == list(0xface...ddadd, 0xcafe..1234)Events
Name: Events
Type: list<tuple<varies>>
Get the parameters of all events with a specific signature emitted by a contract in the evaluated block.
contract
address
no
signature
string
yes
withContract
boolean
no (default false)
source transfers: list<tuple<address, address, integer>> = Events {
contract: 0xface...ddad,
signature: "event Transfer(address indexed from, address indexed to, uint256 value)"
};Calls
Name: Calls
Type: list<tuple<varies>>
Get the arguments of all function calls with a specific signature to a contract in the evaluated block
contract
address
no
signature
string
yes
withReverted
boolean
no (default false)
withSender
boolean
no (default false)
withContract
boolean
no (default false)
Historical Events
Name: HistoricalEvents
Type: list<tuple<varies>>
Get the parameters of all events with a specific signature emitted by a contract since genesis.
contract
address
no
signature
string
yes
withBlocks
boolean
no (default false)
withContract
boolean
no (default false)
blockWindow
integer
no
Historical Calls
Name: HistoricalCalls
Type: list<tuple<varies>>
Get the arguments of all function calls with a specific signature to a contract since genesis.
contract
address
yes
signature
string
yes
withBlocks
boolean
no (default false)
withSender
boolean
no (default false)
withValue
boolean
no (default false)
blockWindow
integer
no
Storage Access
Name: StorageAccess
Type: varies
Fetches storage data from a contract, starting at a specific slot, and decode the data according to a given signature.
contract
address
yes
slot
bytes
yes
signature
string
yes
Storage Map Access
Name: StorageMapAccess
Type: varies
Fetches a value from a mapping in storage, given a key, starting at a specific slot, and decode the data according to a given signature.
contract
address
yes
slot
bytes
yes
mapKey
varies
yes
keySignature
string
yes
valueSignature
string
yes
Filter Addresses In Trace
Name: FilterAddressesInTrace
Type: list<address>
Given a list of addresses, only return the addresses that are active in this block (appear somewhere in the trace of a transaction)
This is useful when trying to run invariants on a large number of addresses.
addresses
list<address>
yes
State Root
Name: StateRoot
Type: bytes
Get the hash of the state root in a given block.
block
integer
yes
Storage hash
Name: StorageHash
Type: bytes
Get the the storage hash of a given contract on a given block. StorageHash is the SHA3 of the Merkle-tree root of a contact's storage.
block
integer
yes
address
address
yes
Block Hash
Name: BlockHash
Type: bytes
Get the hash of a specified block.
block
integer
yes
Last updated