Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
AxiomV0StoragePf
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 16000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // WARNING! This smart contract and the associated zk-SNARK verifiers have not been audited. // DO NOT USE THIS CONTRACT FOR PRODUCTION pragma solidity ^0.8.12; import "./IAxiomV0.sol"; uint8 constant SLOT_NUMBER = 10; contract AxiomV0StoragePf { address private axiomAddress; // address of deployed AxiomV0 contract address private verifierAddress; // address of deployed ZKP verifier for storage proofs // slotAttestations[keccak256(blockNumber || addr || slot || slotValue)] = true // if and only if it has been checked that: // at block number `blockNumber`, the account storage of `addr` has value `slotValue` at slot `slot` mapping(bytes32 => bool) public slotAttestations; event SlotAttestationEvent(uint32 blockNumber, address addr, uint256 slot, uint256 slotValue); constructor(address _axiomAddress, address _verifierAddress) { axiomAddress = _axiomAddress; verifierAddress = _verifierAddress; } function isSlotAttestationValid(uint32 blockNumber, address addr, uint256 slot, uint256 slotValue) external view returns (bool) { return slotAttestations[keccak256(abi.encodePacked(blockNumber, addr, slot, slotValue))]; } // Verify a storage proof for 10 storage slots in a single account at a single block function attestSlots(IAxiomV0.BlockHashWitness calldata blockData, bytes calldata proof) external { if (block.number - blockData.blockNumber <= 256) { require(IAxiomV0(axiomAddress).isRecentBlockHashValid(blockData.blockNumber, blockData.claimedBlockHash), "Block hash was not validated in cache"); } else { require(IAxiomV0(axiomAddress).isBlockHashValid(blockData), "Block hash was not validated in cache"); } // Extract instances from proof uint256 _blockHash = (uint256(bytes32(proof[384:384 + 32])) << 128) | uint128(bytes16(proof[384 + 48:384 + 64])); uint256 _blockNumber = uint256(bytes32(proof[384 + 64:384 + 96])); address account = address(bytes20(proof[384 + 108:384 + 128])); // Check block hash and block number require(_blockHash == uint256(blockData.claimedBlockHash), "Invalid block hash in instance"); require(_blockNumber == blockData.blockNumber, "Invalid block number in instance"); (bool success,) = verifierAddress.call(proof); if (!success) { revert("Proof verification failed"); } for (uint16 i = 0; i < SLOT_NUMBER; i++) { uint256 slot = (uint256(bytes32(proof[384 + 128 + 128 * i:384 + 160 + 128 * i])) << 128) | uint128(bytes16(proof[384 + 176 + 128 * i:384 + 192 + 128 * i])); uint256 slotValue = (uint256(bytes32(proof[384 + 192 + 128 * i:384 + 224 + 128 * i])) << 128) | uint128(bytes16(proof[384 + 240 + 128 * i:384 + 256 + 128 * i])); slotAttestations[keccak256(abi.encodePacked(blockData.blockNumber, account, slot, slotValue))] = true; emit SlotAttestationEvent(blockData.blockNumber, account, slot, slotValue); } } }
// SPDX-License-Identifier: MIT // WARNING! This smart contract and the associated zk-SNARK verifiers have not been audited. // DO NOT USE THIS CONTRACT FOR PRODUCTION pragma solidity ^0.8.12; interface IAxiomV0 { // historicalRoots(startBlockNumber) is 0 unless (startBlockNumber % 1024 == 0) // historicalRoots(startBlockNumber) holds the hash of // prevHash || root || numFinal // where // - prevHash is the parent hash of block startBlockNumber // - root is the partial Merkle root of blockhashes of block numbers // [startBlockNumber, startBlockNumber + 1024) // where unconfirmed block hashes are 0's // - numFinal is the number of confirmed consecutive roots in [startBlockNumber, startBlockNumber + 1024) function historicalRoots(uint32 startBlockNumber) external view returns (bytes32); event UpdateEvent(uint32 startBlockNumber, bytes32 prevHash, bytes32 root, uint32 numFinal); struct BlockHashWitness { uint32 blockNumber; bytes32 claimedBlockHash; bytes32 prevHash; uint32 numFinal; bytes32[10] merkleProof; } // returns Merkle root of a tree of depth `depth` with 0's as leaves function getEmptyHash(uint256 depth) external pure returns (bytes32); // update blocks in the "backward" direction, anchoring on a "recent" end blockhash that is within last 256 blocks // * startBlockNumber must be a multiple of 1024 // * roots[idx] is the root of a Merkle tree of height 2**(10 - idx) in a Merkle mountain // range which stores block hashes in the interval [startBlockNumber, endBlockNumber] function updateRecent(bytes calldata proofData) external; // update older blocks in "backwards" direction, anchoring on more recent trusted blockhash // must be batch of 1024 blocks function updateOld(bytes32 nextRoot, uint32 nextNumFinal, bytes calldata proofData) external; // Update older blocks in "backwards" direction, anchoring on more recent trusted blockhash // Must be batch of 128 * 1024 blocks // `roots` should contain 128 merkle roots, one per batch of 1024 blocks // For all except the last batch of 1024 blocks, a Merkle inclusion proof of the `endHash` of the batch // must be provided, with respect to the corresponding Merkle root in `roots` function updateHistorical( bytes32 nextRoot, uint32 nextNumFinal, bytes32[128] calldata roots, bytes32[11][127] calldata endHashProofs, bytes calldata proofData ) external; function isRecentBlockHashValid(uint32 blockNumber, bytes32 claimedBlockHash) external view returns (bool); function isBlockHashValid(BlockHashWitness calldata witness) external view returns (bool); }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/" ], "optimizer": { "enabled": true, "runs": 16000, "details": { "constantOptimizer": true, "yul": true } }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_axiomAddress","type":"address"},{"internalType":"address","name":"_verifierAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"blockNumber","type":"uint32"},{"indexed":false,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"slotValue","type":"uint256"}],"name":"SlotAttestationEvent","type":"event"},{"inputs":[{"components":[{"internalType":"uint32","name":"blockNumber","type":"uint32"},{"internalType":"bytes32","name":"claimedBlockHash","type":"bytes32"},{"internalType":"bytes32","name":"prevHash","type":"bytes32"},{"internalType":"uint32","name":"numFinal","type":"uint32"},{"internalType":"bytes32[10]","name":"merkleProof","type":"bytes32[10]"}],"internalType":"struct IAxiomV0.BlockHashWitness","name":"blockData","type":"tuple"},{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"attestSlots","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"blockNumber","type":"uint32"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"slot","type":"uint256"},{"internalType":"uint256","name":"slotValue","type":"uint256"}],"name":"isSlotAttestationValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"slotAttestations","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051610d44380380610d4483398101604081905261002f9161007c565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100af565b80516001600160a01b038116811461007757600080fd5b919050565b6000806040838503121561008f57600080fd5b61009883610060565b91506100a660208401610060565b90509250929050565b610c86806100be6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80633618762d146100465780636eaca77c1461005b57806399c94d701461011c575b600080fd5b6100596100543660046108f2565b61013f565b005b610108610069366004610998565b6040805160e09590951b7fffffffff000000000000000000000000000000000000000000000000000000001660208087019190915260609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660248601526038850192909252605880850191909152815180850390910181526078909301815282519282019290922060009081526002909152205460ff1690565b604051901515815260200160405180910390f35b61010861012a3660046109f5565b60026020526000908152604090205460ff1681565b61010061014f6020850185610a0e565b61015f9063ffffffff1643610a5f565b116102ad5760005473ffffffffffffffffffffffffffffffffffffffff1663c1f7cae261018f6020860186610a0e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815263ffffffff91909116600482015260208601356024820152604401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102179190610a78565b6102a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f426c6f636b206861736820776173206e6f742076616c69646174656420696e2060448201527f636163686500000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103d0565b6000546040517f6f193b8300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690636f193b8390610303908690600401610a9a565b602060405180830381865afa158015610320573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103449190610a78565b6103d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f426c6f636b206861736820776173206e6f742076616c69646174656420696e2060448201527f6361636865000000000000000000000000000000000000000000000000000000606482015260840161029f565b60006103e26101c06101b08486610aeb565b6103eb91610b15565b608090811c906104016101a06101808688610aeb565b61040a91610b5d565b901b17905060006104216101e06101c08587610aeb565b61042a91610b5d565b9050600061043e6102006101ec8688610aeb565b61044791610b99565b60601c9050602086013583146104b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496e76616c696420626c6f636b206861736820696e20696e7374616e63650000604482015260640161029f565b6104c66020870187610a0e565b63ffffffff168214610534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f496e76616c696420626c6f636b206e756d62657220696e20696e7374616e6365604482015260640161029f565b60015460405160009173ffffffffffffffffffffffffffffffffffffffff16906105619088908890610bdf565b6000604051808303816000865af19150503d806000811461059e576040519150601f19603f3d011682016040523d82523d6000602084013e6105a3565b606091505b505090508061060e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f50726f6f6620766572696669636174696f6e206661696c656400000000000000604482015260640161029f565b60005b600a61ffff821610156108e8576000878761062d846080610bef565b61063990610230610c0d565b61ffff1690610649856080610bef565b61065590610240610c0d565b61ffff169261066693929190610aeb565b61066f91610b15565b608090811c9089896106818684610bef565b61068d90610200610c0d565b61ffff169061069d876080610bef565b6106a990610220610c0d565b61ffff16926106ba93929190610aeb565b6106c391610b5d565b901b179050600088886106d7856080610bef565b6106e390610270610c0d565b61ffff16906106f3866080610bef565b6106ff90610280610c0d565b61ffff169261071093929190610aeb565b61071991610b15565b608090811c908a8a61072b8784610bef565b61073790610240610c0d565b61ffff1690610747886080610bef565b61075390610260610c0d565b61ffff169261076493929190610aeb565b61076d91610b5d565b901b17905060016002600061078560208e018e610a0e565b60405160e09190911b7fffffffff00000000000000000000000000000000000000000000000000000000166020820152606089901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660248201526038810186905260588101859052607801604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00181529181528151602092830120835282820193909352910160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016921515929092179091557f4fc7a1059ad7b74c5e3b624433afcc0628922ab027dfbca3a42e605bdba5627590610892908c018c610a0e565b6040805163ffffffff909216825273ffffffffffffffffffffffffffffffffffffffff8816602083015281018490526060810183905260800160405180910390a1505080806108e090610c2f565b915050610611565b5050505050505050565b60008060008385036101e081121561090957600080fd5b6101c08082121561091957600080fd5b859450840135905067ffffffffffffffff8082111561093757600080fd5b818601915086601f83011261094b57600080fd5b81358181111561095a57600080fd5b87602082850101111561096c57600080fd5b6020830194508093505050509250925092565b803563ffffffff8116811461099357600080fd5b919050565b600080600080608085870312156109ae57600080fd5b6109b78561097f565b9350602085013573ffffffffffffffffffffffffffffffffffffffff811681146109e057600080fd5b93969395505050506040820135916060013590565b600060208284031215610a0757600080fd5b5035919050565b600060208284031215610a2057600080fd5b610a298261097f565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610a7257610a72610a30565b92915050565b600060208284031215610a8a57600080fd5b81518015158114610a2957600080fd5b6101c0810163ffffffff80610aae8561097f565b168352602084013560208401526040840135604084015280610ad26060860161097f565b1660608401525061014060808401608084013792915050565b60008085851115610afb57600080fd5b83861115610b0857600080fd5b5050820193919092039150565b7fffffffffffffffffffffffffffffffff000000000000000000000000000000008135818116916010851015610b555780818660100360031b1b83161692505b505092915050565b80356020831015610a72577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008135818116916014851015610b555760149490940360031b84901b1690921692915050565b8183823760009101908152919050565b61ffff818116838216028082169190828114610b5557610b55610a30565b61ffff818116838216019080821115610c2857610c28610a30565b5092915050565b600061ffff808316818103610c4657610c46610a30565b600101939250505056fea26469706673582212204e3f3fbfec50518aa718177e1dcb2a6975bcc3ac8b8004a4cc53392dc181f7fd64736f6c6343000811003300000000000000000000000001d5b501c1fc0121e1411970fb79c322737025c2000000000000000000000000f9a86d0a0e0a8eddee4d518b257b185b717a543a
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c80633618762d146100465780636eaca77c1461005b57806399c94d701461011c575b600080fd5b6100596100543660046108f2565b61013f565b005b610108610069366004610998565b6040805160e09590951b7fffffffff000000000000000000000000000000000000000000000000000000001660208087019190915260609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660248601526038850192909252605880850191909152815180850390910181526078909301815282519282019290922060009081526002909152205460ff1690565b604051901515815260200160405180910390f35b61010861012a3660046109f5565b60026020526000908152604090205460ff1681565b61010061014f6020850185610a0e565b61015f9063ffffffff1643610a5f565b116102ad5760005473ffffffffffffffffffffffffffffffffffffffff1663c1f7cae261018f6020860186610a0e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815263ffffffff91909116600482015260208601356024820152604401602060405180830381865afa1580156101f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102179190610a78565b6102a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f426c6f636b206861736820776173206e6f742076616c69646174656420696e2060448201527f636163686500000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103d0565b6000546040517f6f193b8300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690636f193b8390610303908690600401610a9a565b602060405180830381865afa158015610320573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103449190610a78565b6103d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f426c6f636b206861736820776173206e6f742076616c69646174656420696e2060448201527f6361636865000000000000000000000000000000000000000000000000000000606482015260840161029f565b60006103e26101c06101b08486610aeb565b6103eb91610b15565b608090811c906104016101a06101808688610aeb565b61040a91610b5d565b901b17905060006104216101e06101c08587610aeb565b61042a91610b5d565b9050600061043e6102006101ec8688610aeb565b61044791610b99565b60601c9050602086013583146104b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f496e76616c696420626c6f636b206861736820696e20696e7374616e63650000604482015260640161029f565b6104c66020870187610a0e565b63ffffffff168214610534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f496e76616c696420626c6f636b206e756d62657220696e20696e7374616e6365604482015260640161029f565b60015460405160009173ffffffffffffffffffffffffffffffffffffffff16906105619088908890610bdf565b6000604051808303816000865af19150503d806000811461059e576040519150601f19603f3d011682016040523d82523d6000602084013e6105a3565b606091505b505090508061060e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f50726f6f6620766572696669636174696f6e206661696c656400000000000000604482015260640161029f565b60005b600a61ffff821610156108e8576000878761062d846080610bef565b61063990610230610c0d565b61ffff1690610649856080610bef565b61065590610240610c0d565b61ffff169261066693929190610aeb565b61066f91610b15565b608090811c9089896106818684610bef565b61068d90610200610c0d565b61ffff169061069d876080610bef565b6106a990610220610c0d565b61ffff16926106ba93929190610aeb565b6106c391610b5d565b901b179050600088886106d7856080610bef565b6106e390610270610c0d565b61ffff16906106f3866080610bef565b6106ff90610280610c0d565b61ffff169261071093929190610aeb565b61071991610b15565b608090811c908a8a61072b8784610bef565b61073790610240610c0d565b61ffff1690610747886080610bef565b61075390610260610c0d565b61ffff169261076493929190610aeb565b61076d91610b5d565b901b17905060016002600061078560208e018e610a0e565b60405160e09190911b7fffffffff00000000000000000000000000000000000000000000000000000000166020820152606089901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660248201526038810186905260588101859052607801604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00181529181528151602092830120835282820193909352910160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016921515929092179091557f4fc7a1059ad7b74c5e3b624433afcc0628922ab027dfbca3a42e605bdba5627590610892908c018c610a0e565b6040805163ffffffff909216825273ffffffffffffffffffffffffffffffffffffffff8816602083015281018490526060810183905260800160405180910390a1505080806108e090610c2f565b915050610611565b5050505050505050565b60008060008385036101e081121561090957600080fd5b6101c08082121561091957600080fd5b859450840135905067ffffffffffffffff8082111561093757600080fd5b818601915086601f83011261094b57600080fd5b81358181111561095a57600080fd5b87602082850101111561096c57600080fd5b6020830194508093505050509250925092565b803563ffffffff8116811461099357600080fd5b919050565b600080600080608085870312156109ae57600080fd5b6109b78561097f565b9350602085013573ffffffffffffffffffffffffffffffffffffffff811681146109e057600080fd5b93969395505050506040820135916060013590565b600060208284031215610a0757600080fd5b5035919050565b600060208284031215610a2057600080fd5b610a298261097f565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610a7257610a72610a30565b92915050565b600060208284031215610a8a57600080fd5b81518015158114610a2957600080fd5b6101c0810163ffffffff80610aae8561097f565b168352602084013560208401526040840135604084015280610ad26060860161097f565b1660608401525061014060808401608084013792915050565b60008085851115610afb57600080fd5b83861115610b0857600080fd5b5050820193919092039150565b7fffffffffffffffffffffffffffffffff000000000000000000000000000000008135818116916010851015610b555780818660100360031b1b83161692505b505092915050565b80356020831015610a72577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008135818116916014851015610b555760149490940360031b84901b1690921692915050565b8183823760009101908152919050565b61ffff818116838216028082169190828114610b5557610b55610a30565b61ffff818116838216019080821115610c2857610c28610a30565b5092915050565b600061ffff808316818103610c4657610c46610a30565b600101939250505056fea26469706673582212204e3f3fbfec50518aa718177e1dcb2a6975bcc3ac8b8004a4cc53392dc181f7fd64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000001d5b501c1fc0121e1411970fb79c322737025c2000000000000000000000000f9a86d0a0e0a8eddee4d518b257b185b717a543a
-----Decoded View---------------
Arg [0] : _axiomAddress (address): 0x01d5b501C1fc0121e1411970fb79c322737025c2
Arg [1] : _verifierAddress (address): 0xf9a86D0A0e0a8eDDEE4d518B257b185B717A543A
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000001d5b501c1fc0121e1411970fb79c322737025c2
Arg [1] : 000000000000000000000000f9a86d0a0e0a8eddee4d518b257b185b717a543a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.