AxiomREPL
Specify custom compute over the history of Ethereum in Javascript.
Example
{
"address": "0x897dDbe14c9C7736EbfDC58461355697FbF70048",
"claimedBlockNumber": 9173677
}// example AxiomREPL circuit to prove the first block an account transacted
// get the previous block number
const prevBlock = sub(claimedBlockNumber, constant(1));
//get the account at the previous block
const accountPrevBlock = getAccount(prevBlock, address);
// get the account nonce at the previous block and assert that it is 0
const prevNonce = accountPrevBlock.nonce().toCircuitValue();
checkEqual(prevNonce, constant(0))
// get the account nonce at the claimed block number
const account = getAccount(claimedBlockNumber, address);
const nonce = account.nonce().toCircuitValue();
//checks that nonce > 0 at the claimed block
checkLessThan(constant(0), nonce)
// add the address and blockNumber to the callback, for it to be passed
// as a result to the callback client contract
addToCallback(address)
addToCallback(claimedBlockNumber);Last updated