Data Functions
Used to add data queries into your AxiomREPL circuits
All data fetching results will return a CircuitValue256. If an input value is of type string, number, or bigint, it will be treated as a constant (regardless of the input to your circuit, it will need to remain the same). If you pass in a CircuitValue instead, it will be a variable input to your circuit. All inputs defined in the JSON input panel at the bottom of axiom-repl will be auto-converted to CircuitValues (or CircuitValue256 if it exceeds 253 bits) and injected into your circuit.
Account Subquery
const account = getAccount(blockNumber, address)
const nonce: CircuitValue256 = account.nonce()
const balance: CircuitValue256 = account.balance()
const storageRoot: CircuitValue256 = account.storageRoot()
const codeHash: CircuitValue256 = account.codeHash()See for more details and limitations:
Account SubqueryHeader Subquery
const header = getHeader(blockNumber)
const parentHash: CircuitValue256 = header.parentHash()
const sha3Uncles: CircuitValue256 = header.sha3Uncles()
const miner: CircuitValue256 = header.miner()
const stateRoot: CircuitValue256 = header.stateRoot()
const transactionsRoot: CircuitValue256 = header.transactionsRoot()
const receiptsRoot: CircuitValue256 = header.receiptsRoot()
const difficulty: CircuitValue256 = header.difficulty()
const blockNumber: CircuitValue256 = header.number()
const gasLimit: CircuitValue256 = header.gasLimit()
const gasUsed: CircuitValue256 = header.gasUsed()
const timestamp: CircuitValue256 = header.timestamp()
const extraData: CircuitValue256 = header.extraData()
const mixHash: CircuitValue256 = header.mixHash()
const nonce: CircuitValue256 = header.nonce()
const baseFeePerGas: CircuitValue256 = header.baseFeePerGas()
//gets the 32 bytes chunk of logsBloom, idx in [0, 8)
const logsBloom: CircuitValue256 = header.logsBloom(bytes32Idx)
See for more details and limitations:
Header SubquerySolidity Nested Mapping Subquery
See for more details and limitations:
Solidity Nested Mapping SubqueryReceipt Subquery
See for more details and limitations:
Receipt SubqueryTransaction Subquery
To find a the index of a transaction from its transaction hash, open up the transaction in Etherscan, and then click on more details. The txIdx is labeled "Position in Block":

See for more details and limitations:
Transaction SubqueryStorage Subquery
See for more details and limitations:
Storage SubqueryLast updated