Feature Tip: Add private address tag to any address under My Name Tag !
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
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
AxiomV1Query
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {AxiomV1Access} from "./AxiomV1Access.sol"; import {IAxiomV1State} from "./interfaces/core/IAxiomV1State.sol"; import {IAxiomV1Verifier} from "./interfaces/core/IAxiomV1Verifier.sol"; import {IAxiomV1Query, QUERY_MERKLE_DEPTH} from "./interfaces/IAxiomV1Query.sol"; import {MerkleTree} from "./libraries/MerkleTree.sol"; import "./libraries/configuration/AxiomV1Configuration.sol"; /// @title AxiomV1Query /// @notice Axiom smart contract that verifies batch queries into block headers, accounts, and storage slots. /// @dev Is a UUPS upgradeable contract. contract AxiomV1Query is IAxiomV1Query, AxiomV1Access, UUPSUpgradeable { using Address for address payable; address public axiomAddress; // address of deployed AxiomV1 contract address public mmrVerifierAddress; // address of deployed ZKP verifier for MMR query verification mapping(bytes32 => bool) public verifiedKeccakResults; mapping(bytes32 => bool) public verifiedPoseidonResults; uint256 public minQueryPrice; uint256 public maxQueryPrice; uint32 public queryDeadlineInterval; mapping(bytes32 => AxiomQueryMetadata) public queries; error BlockHashNotValidatedInCache(); error BlockMerkleRootDoesNotMatchProof(); error ProofVerificationFailed(); error MMRProofVerificationFailed(); error MMREndBlockNotRecent(); error BlockHashWitnessNotRecent(); error ClaimedMMRDoesNotMatchRecent(); error HistoricalMMRKeccakDoesNotMatchProof(); error KeccakQueryResponseDoesNotMatchProof(); error QueryNotInactive(); error PriceNotPaid(); error PriceTooHigh(); error CannotRefundIfNotActive(); error CannotRefundBeforeDeadline(); error CannotFulfillIfNotActive(); /// @custom:oz-upgrades-unsafe-allow constructor /// @notice Prevents the implementation contract from being initialized outside of the upgradeable proxy. constructor() { _disableInitializers(); } function initialize(address _axiomAddress, address _mmrVerifierAddress, uint256 _minQueryPrice, uint256 _maxQueryPrice, uint32 _queryDeadlineInterval, address timelock, address guardian) public initializer { __UUPSUpgradeable_init(); __AxiomV1Access_init_unchained(); require(_axiomAddress != address(0), "AxiomV1Query: Axiom address is zero"); require(_mmrVerifierAddress != address(0), "AxiomV1Query: MMR verifier address is zero"); require(timelock != address(0), "AxiomV1Query: timelock address is zero"); require(guardian != address(0), "AxiomV1Query: guardian address is zero"); axiomAddress = _axiomAddress; mmrVerifierAddress = _mmrVerifierAddress; emit UpdateAxiomAddress(_axiomAddress); emit UpdateMMRVerifierAddress(_mmrVerifierAddress); minQueryPrice = _minQueryPrice; maxQueryPrice = _maxQueryPrice; queryDeadlineInterval = _queryDeadlineInterval; emit UpdateMinQueryPrice(_minQueryPrice); emit UpdateMaxQueryPrice(_maxQueryPrice); emit UpdateQueryDeadlineInterval(_queryDeadlineInterval); // prover is initialized to the contract deployer _grantRole(PROVER_ROLE, msg.sender); _grantRole(DEFAULT_ADMIN_ROLE, timelock); _grantRole(TIMELOCK_ROLE, timelock); _grantRole(GUARDIAN_ROLE, guardian); } /// @notice Updates the address of the AxiomV1Core contract used to validate blockhashes, governed by a 'timelock'. /// @param _axiomAddress the new address function updateAxiomAddress(address _axiomAddress) external onlyRole(TIMELOCK_ROLE) { axiomAddress = _axiomAddress; emit UpdateAxiomAddress(_axiomAddress); } /// @notice Updates the address of the MMR SNARK verifier contract, governed by a 'timelock'. /// @param _mmrVerifierAddress the new address function updateMMRVerifierAddress(address _mmrVerifierAddress) external onlyRole(TIMELOCK_ROLE) { mmrVerifierAddress = _mmrVerifierAddress; emit UpdateMMRVerifierAddress(_mmrVerifierAddress); } /// @notice Set the price of a query, governed by a 'timelock'. /// @param _minQueryPrice query price in wei function updateMinQueryPrice(uint256 _minQueryPrice) external onlyRole(TIMELOCK_ROLE) { minQueryPrice = _minQueryPrice; emit UpdateMinQueryPrice(_minQueryPrice); } /// @notice Set the price of a query, governed by a 'timelock'. /// @param _maxQueryPrice query price in wei function updateMaxQueryPrice(uint256 _maxQueryPrice) external onlyRole(TIMELOCK_ROLE) { maxQueryPrice = _maxQueryPrice; emit UpdateMaxQueryPrice(_maxQueryPrice); } /// @notice Set the query deadline interval, governed by a 'timelock'. /// @param _queryDeadlineInterval interval in blocks function updateQueryDeadlineInterval(uint32 _queryDeadlineInterval) external onlyRole(TIMELOCK_ROLE) { queryDeadlineInterval = _queryDeadlineInterval; emit UpdateQueryDeadlineInterval(_queryDeadlineInterval); } function verifyResultVsMMR( uint32 mmrIdx, RecentMMRWitness calldata mmrWitness, bytes calldata proof) external onlyProver { requireNotFrozen(); _verifyResultVsMMR(mmrIdx, mmrWitness, proof); } function sendQuery(bytes32 keccakQueryResponse, address payable refundee, bytes calldata query) external payable { requireNotFrozen(); // Check for minimum payment if (msg.value < minQueryPrice) { revert PriceNotPaid(); } // Check for maximum payment if (msg.value > maxQueryPrice) { revert PriceTooHigh(); } _sendQuery(keccakQueryResponse, msg.value, refundee); bytes32 queryHash = keccak256(query); emit QueryInitiatedOnchain(keccakQueryResponse, msg.value, uint32(block.number) + queryDeadlineInterval, refundee, queryHash); } function sendOffchainQuery(bytes32 keccakQueryResponse, address payable refundee, bytes32 ipfsHash) external payable { requireNotFrozen(); // Check for minimum payment if (msg.value < minQueryPrice) { revert PriceNotPaid(); } // Check for maximum payment if (msg.value > maxQueryPrice) { revert PriceTooHigh(); } _sendQuery(keccakQueryResponse, msg.value, refundee); emit QueryInitiatedOffchain(keccakQueryResponse, msg.value, uint32(block.number) + queryDeadlineInterval, refundee, ipfsHash); } function fulfillQueryVsMMR( bytes32 keccakQueryResponse, address payable payee, uint32 mmrIdx, RecentMMRWitness calldata mmrWitness, bytes calldata proof ) external onlyProver { requireNotFrozen(); if (queries[keccakQueryResponse].state != AxiomQueryState.Active) { revert CannotFulfillIfNotActive(); } bytes32 proofKeccakQueryResponse = _verifyResultVsMMR(mmrIdx, mmrWitness, proof); if (proofKeccakQueryResponse != keccakQueryResponse) { revert KeccakQueryResponseDoesNotMatchProof(); } AxiomQueryMetadata memory newMetadata = AxiomQueryMetadata({ payment:queries[keccakQueryResponse].payment, state:AxiomQueryState.Fulfilled, deadlineBlockNumber:queries[keccakQueryResponse].deadlineBlockNumber, refundee:queries[keccakQueryResponse].refundee }); queries[keccakQueryResponse] = newMetadata; payee.sendValue(queries[keccakQueryResponse].payment); emit QueryFulfilled(keccakQueryResponse, queries[keccakQueryResponse].payment, payee); } function collectRefund(bytes32 keccakQueryResponse) external { AxiomQueryMetadata memory queryMetadata = queries[keccakQueryResponse]; if (queryMetadata.state != AxiomQueryState.Active) { revert CannotRefundIfNotActive(); } if (block.number <= queryMetadata.deadlineBlockNumber) { revert CannotRefundBeforeDeadline(); } AxiomQueryMetadata memory newMetadata = AxiomQueryMetadata({ payment:0, state:AxiomQueryState.Inactive, deadlineBlockNumber:0, refundee:payable(address(0)) }); queries[keccakQueryResponse] = newMetadata; queryMetadata.refundee.sendValue(queryMetadata.payment); emit QueryRefunded(keccakQueryResponse, queryMetadata.payment, queryMetadata.deadlineBlockNumber, queryMetadata.refundee); } function isKeccakResultValid(bytes32 keccakBlockResponse, bytes32 keccakAccountResponse, bytes32 keccakStorageResponse) external view returns (bool) { return verifiedKeccakResults[keccak256(abi.encodePacked(keccakBlockResponse, keccakAccountResponse, keccakStorageResponse))]; } function isPoseidonResultValid(bytes32 poseidonBlockResponse, bytes32 poseidonAccountResponse, bytes32 poseidonStorageResponse) external view returns (bool) { return verifiedPoseidonResults[keccak256(abi.encodePacked(poseidonBlockResponse, poseidonAccountResponse, poseidonStorageResponse))]; } function areResponsesValid( bytes32 keccakBlockResponse, bytes32 keccakAccountResponse, bytes32 keccakStorageResponse, BlockResponse[] calldata blockResponses, AccountResponse[] calldata accountResponses, StorageResponse[] calldata storageResponses ) external view returns (bool) { if (!verifiedKeccakResults[keccak256(abi.encodePacked(keccakBlockResponse, keccakAccountResponse, keccakStorageResponse))]) { return false; } for (uint32 idx = 0; idx < blockResponses.length; idx++) { bytes32 leaf = keccak256(abi.encodePacked( blockResponses[idx].blockHash, blockResponses[idx].blockNumber )); if (!isMerklePathValid(keccakBlockResponse, leaf, blockResponses[idx].proof, blockResponses[idx].leafIdx)) { return false; } } // `keccakAccountResponse` is the Merkle root of the packed addresses: // * `keccak(blockNumber . addr . keccak(nonce . balance . storageRoot . codeHash))`. for (uint32 idx = 0; idx < accountResponses.length; idx++) { bytes32 leaf = keccak256(abi.encodePacked( accountResponses[idx].blockNumber, accountResponses[idx].addr, keccak256(abi.encodePacked( accountResponses[idx].nonce, accountResponses[idx].balance, accountResponses[idx].storageRoot, accountResponses[idx].codeHash )) )); if (!isMerklePathValid(keccakAccountResponse, leaf, accountResponses[idx].proof, accountResponses[idx].leafIdx)) { return false; } } for (uint32 idx = 0; idx < storageResponses.length; idx++) { bytes32 leaf = keccak256(abi.encodePacked( storageResponses[idx].blockNumber, storageResponses[idx].addr, storageResponses[idx].slot, storageResponses[idx].value )); if (!isMerklePathValid(keccakStorageResponse, leaf, storageResponses[idx].proof, storageResponses[idx].leafIdx)) { return false; } } return true; } /// @notice Record on-chain query. /// @param keccakQueryResponse The hash of the query response. /// @param payment The payment offered, in wei. /// @param refundee The address to send any refund to. function _sendQuery(bytes32 keccakQueryResponse, uint256 payment, address payable refundee) internal { if (queries[keccakQueryResponse].state != AxiomQueryState.Inactive) { revert QueryNotInactive(); } AxiomQueryMetadata memory queryMetadata = AxiomQueryMetadata({ payment:payment, state:AxiomQueryState.Active, deadlineBlockNumber:uint32(block.number) + queryDeadlineInterval, refundee:refundee }); queries[keccakQueryResponse] = queryMetadata; } /// @notice Verify a query result on-chain. /// @param mmrIdx The index of the cached MMR to verify against. /// @param mmrWitness Witness data to reconcile `recentMMR` against `historicalRoots`. /// @param proof The ZK proof data. function _verifyResultVsMMR( uint32 mmrIdx, RecentMMRWitness calldata mmrWitness, bytes calldata proof ) internal returns (bytes32) { requireNotFrozen(); require(mmrIdx < MMR_RING_BUFFER_SIZE); AxiomMMRQueryResponse memory response = getMMRQueryData(proof); // Check that the historical MMR matches a cached value in `mmrRingBuffer` if (IAxiomV1State(axiomAddress).mmrRingBuffer(mmrIdx) != response.historicalMMRKeccak) { revert HistoricalMMRKeccakDoesNotMatchProof(); } // recentMMRKeccak = keccak(mmr[0] . mmr[1] . ... . mmr[9]), where mmr[idx] is either bytes32(0) or the Merkle root of 2 ** idx hashes // historicalRoots(startBlockNumber) = keccak256(prevHash . root . numFinal) // - root is the keccak Merkle root of hash(i) for i in [0, 1024), where // hash(i) is the blockhash of block `startBlockNumber + i` if i < numFinal, // hash(i) = bytes32(0x0) if i >= numFinal // We check that `recentMMRPeaks` is included in `historicalRoots[startBlockNumber].root` via `mmrComplementOrPeaks` // This proves that all block hashes committed to in `recentMMRPeaks` are part of the canonical chain. { bytes32 historicalRoot = IAxiomV1State(axiomAddress).historicalRoots(mmrWitness.startBlockNumber); require(historicalRoot == keccak256(abi.encodePacked(mmrWitness.prevHash, mmrWitness.root, mmrWitness.numFinal))); } require(response.recentMMRKeccak == keccak256(abi.encodePacked(mmrWitness.recentMMRPeaks))); uint32 mmrLen = 0; for (uint32 idx = 0; idx < 10; idx++) { if (mmrWitness.recentMMRPeaks[idx] != bytes32(0)) { mmrLen = mmrLen + uint32(1 << idx); } } // if `mmrLen == 0`, there is no check necessary against blocks if (mmrLen > 0 && mmrLen <= mmrWitness.numFinal) { // In this case, the full `mmrWitness` should be committed to in `mmrWitness.root` // In this branch, `mmrWitness.mmrComplementOrPeaks` holds the complementary MMR which completes `mmrWitness` // We check that // * The MMR in `mmrWitness` can be completed to `mmrWitness.root` // This proves that the MMR in `mmrWitness` is the MMR of authentic block hashes with 0's appended. // Under the random oracle assumption, 0 can never be achieved as keccak of an erroenous block header, // so there is no soundness risk here. (bytes32 runningHash, ) = getMMRComplementRoot(mmrWitness.recentMMRPeaks, mmrWitness.mmrComplementOrPeaks); require(mmrWitness.root == runningHash); } else if (mmrLen > mmrWitness.numFinal) { // Some of the claimed block hashes in `mmrWitness` were not committed to in `mmrWitness` // In this branch, `mmrWitness.mmrComplementOrPeaks` holds the MMR values of the non-zero hashes in `root` // We check that // * block hashes for numbers [startBlockNumber + numFinal, startBlockNumber + mmrLen) are recent // * appending these block hashes to the committed MMR in `mmrWitness` (without 0-padding) yields the MMR in `mmrWitness` if (mmrWitness.startBlockNumber + mmrLen > block.number) { revert MMREndBlockNotRecent(); } if (mmrWitness.startBlockNumber + mmrWitness.numFinal < block.number - 256) { revert BlockHashWitnessNotRecent(); } // zeroHashes[idx] is the Merkle root of a tree of depth idx with 0's as leaves bytes32[10] memory zeroHashes = [ bytes32(0x0000000000000000000000000000000000000000000000000000000000000000), bytes32(0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5), bytes32(0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30), bytes32(0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85), bytes32(0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344), bytes32(0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d), bytes32(0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968), bytes32(0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83), bytes32(0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af), bytes32(0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0) ]; // read the committed MMR without zero-padding (bytes32 runningHash, uint32 runningSize) = getMMRComplementRoot(mmrWitness.mmrComplementOrPeaks, zeroHashes); require(mmrWitness.numFinal == runningSize); require(mmrWitness.root == runningHash); // check appending to the committed MMR with recent blocks will yield the claimed MMR { bytes32[] memory append = new bytes32[](mmrLen - mmrWitness.numFinal); for (uint32 idx = 0; idx < mmrLen - mmrWitness.numFinal; idx++) { append[idx] = blockhash(mmrWitness.startBlockNumber + mmrWitness.numFinal + idx); } uint32 appendLeft = mmrLen - mmrWitness.numFinal; uint32 height = 0; uint32 insert = 0; while (appendLeft > 0) { insert = (mmrWitness.numFinal >> height) & 1; for (uint32 idx = 0; idx < (appendLeft + insert) / 2; idx++) { bytes32 left; bytes32 right; if (insert == 1) { left = (idx == 0 ? mmrWitness.mmrComplementOrPeaks[height] : append[2 * idx - 1]); right = append[2 * idx]; } else { left = append[2 * idx]; right = append[2 * idx + 1]; } append[idx] = keccak256(abi.encodePacked(left, right)); } if ((appendLeft + insert) % 2 == 1) { if (append[appendLeft - 1] != mmrWitness.recentMMRPeaks[height]) { revert ClaimedMMRDoesNotMatchRecent(); } } else { // This should not be possible, but leaving this revert in for safety. if (mmrWitness.recentMMRPeaks[height] != 0) { revert ClaimedMMRDoesNotMatchRecent(); } } height = height + 1; appendLeft = (appendLeft + insert) / 2; } } } // verify the ZKP itself (bool success, ) = mmrVerifierAddress.call(proof); if (!success) { revert MMRProofVerificationFailed(); } // update the cache bytes32 keccakQueryResponse = keccak256(abi.encodePacked(response.keccakBlockResponse, response.keccakAccountResponse, response.keccakStorageResponse)); verifiedKeccakResults[keccakQueryResponse] = true; verifiedPoseidonResults[keccak256(abi.encodePacked(response.poseidonBlockResponse, response.poseidonAccountResponse, response.poseidonStorageResponse))] = true; emit KeccakResultEvent(response.keccakBlockResponse, response.keccakAccountResponse, response.keccakStorageResponse); emit PoseidonResultEvent(response.poseidonBlockResponse, response.poseidonAccountResponse, response.poseidonStorageResponse); return keccakQueryResponse; } /// @dev Given a non-empty MMR `mmr`, compute its `size` and the Merkle root of its completion to 1024 leaves using `mmrComplement` /// @param mmr The peaks of a MMR, where `mmr[idx]` is either `bytes32(0x0)` or the Merkle root of a tree of depth `idx`. /// At least one peak is guaranteed to be non-zero. /// @param mmrComplement Entries which contain peaks of a complementary MMR, where `mmrComplement[idx]` is either `bytes32(0x0)` or the /// Merkle root of a tree of depth `idx`. Only the relevant indices are accessed. /// @dev As an example, if `mmr` has peaks of depth 9 8 6 3, then `mmrComplement` has peaks of depth 3 4 5 7 /// In this example, the peaks of `mmr` are Merkle roots of the first 2^9 leaves, then the next 2^8 leaves, and so on. /// The peaks of `mmrComplement` are Merkle roots of the first 2^3 leaves after `mmr`, then the next 2^4 leaves, and so on. /// @return root The Merkle root of the completion of `mmr`. /// @return size The number of leaves contained in `mmr`. function getMMRComplementRoot(bytes32[10] memory mmr, bytes32[10] memory mmrComplement) internal pure returns (bytes32 root, uint32 size) { bool started = false; root = bytes32(0x0); size = 0; for (uint32 peakIdx = 0; peakIdx < 10; peakIdx++) { if (!started && mmr[peakIdx] != bytes32(0x0)) { root = mmrComplement[peakIdx]; started = true; } if (started) { if (mmr[peakIdx] != bytes32(0x0)) { root = keccak256(abi.encodePacked(mmr[peakIdx], root)); size = size + uint32(1 << peakIdx); } else { root = keccak256(abi.encodePacked(root, mmrComplement[peakIdx])); } } } } /// @dev Verify a Merkle inclusion proof into a Merkle tree with (1 << proof.length) leaves /// @param root The Merkle root. /// @param leaf The claimed leaf in the tree. /// @param proof The Merkle proof, where index 0 corresponds to a leaf in the tree. /// @param leafIdx The claimed index of the leaf in the tree, where index 0 corresponds to the leftmost leaf. function isMerklePathValid(bytes32 root, bytes32 leaf, bytes32[QUERY_MERKLE_DEPTH] memory proof, uint32 leafIdx) internal pure returns (bool) { bytes32 runningHash = leaf; for (uint32 idx = 0; idx < proof.length; idx++) { if ((leafIdx >> idx) & 1 == 0) { runningHash = keccak256(abi.encodePacked(runningHash, proof[idx])); } else { runningHash = keccak256(abi.encodePacked(proof[idx], runningHash)); } } return (root == runningHash); } /// @dev Extract public instances from proof. /// @param proof The ZK proof. // The public instances are laid out in the proof calldata as follows: // ** First 4 * 3 * 32 = 384 bytes are reserved for proof verification data used with the pairing precompile // ** The next blocks of 13 groups of 32 bytes each are: // ** `poseidonBlockResponse` as a field element // ** `keccakBlockResponse` as 2 field elements, in hi-lo form // ** `poseidonAccountResponse` as a field element // ** `keccakAccountResponse` as 2 field elements, in hi-lo form // ** `poseidonStorageResponse` as a field element // ** `keccakStorageResponse` as 2 field elements, in hi-lo form // ** `historicalMMRKeccak` which is `keccak256(abi.encodePacked(mmr[10:]))` as 2 field elements in hi-lo form. // ** `recentMMRKeccak` which is `keccak256(abi.encodePacked(mmr[:10]))` as 2 field elements in hi-lo form. // Here: // ** `{keccak, poseidon}{Block, Account, Storage}Response` are defined as in `AxiomMMRQueryResponse`. // ** hi-lo form means a uint256 `(a << 128) + b` is represented as two uint256's `a` and `b`, each of which is // guaranteed to contain a uint128. // ** `mmr` is a variable length array of bytes32 containing the Merkle Mountain Range that `proof` is proving into. // `mmr[idx]` is either `bytes32(0)` or the Merkle root of `1 << idx` block hashes. // ** `mmr` is guaranteed to have length at least `10` and at most `32`. function getMMRQueryData(bytes calldata proof) internal pure returns (AxiomMMRQueryResponse memory) { return AxiomMMRQueryResponse({ poseidonBlockResponse:bytes32(proof[384:384 + 32]), keccakBlockResponse:bytes32(uint256(bytes32(proof[384 + 32: 384 + 2 * 32])) << 128 | uint256(bytes32(proof[384 + 2 * 32: 384 + 3 * 32]))), poseidonAccountResponse:bytes32(proof[384 + 3 * 32:384 + 4 * 32]), keccakAccountResponse:bytes32(uint256(bytes32(proof[384 + 4 * 32: 384 + 5 * 32])) << 128 | uint256(bytes32(proof[384 + 5 * 32: 384 + 6 * 32]))), poseidonStorageResponse:bytes32(proof[384 + 6 * 32:384 + 7 * 32]), keccakStorageResponse:bytes32(uint256(bytes32(proof[384 + 7 * 32: 384 + 8 * 32])) << 128 | uint256(bytes32(proof[384 + 8 * 32: 384 + 9 * 32]))), historicalMMRKeccak:bytes32(uint256(bytes32(proof[384 + 9 * 32: 384 + 10 * 32])) << 128 | uint256(bytes32(proof[384 + 10 * 32: 384 + 11 * 32]))), recentMMRKeccak:bytes32(uint256(bytes32(proof[384 + 11 * 32: 384 + 12 * 32])) << 128 | uint256(bytes32(proof[384 + 12 * 32: 384 + 13 * 32]))) }); } function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlUpgradeable) returns (bool) { return interfaceId == type(IAxiomV1Query).interfaceId || super.supportsInterface(interfaceId); } function _authorizeUpgrade(address) internal override onlyRole(TIMELOCK_ROLE) {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[40] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate the implementation's compatibility when performing an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(account), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <0.9.0; import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /// @title Axiom V1 Access /// @notice Abstract contract controlling permissions of AxiomV1 /// @dev For use in a UUPS upgradeable contract. abstract contract AxiomV1Access is Initializable, AccessControlUpgradeable { bool public frozen; /// @notice Storage slot for the address with the permission of a 'timelock'. bytes32 public constant TIMELOCK_ROLE = keccak256("TIMELOCK_ROLE"); /// @notice Storage slot for the addresses with the permission of a 'guardian'. bytes32 public constant GUARDIAN_ROLE = keccak256("GUARDIAN_ROLE"); /// @notice Storage slot for the addresses with the permission of a 'prover'. bytes32 public constant PROVER_ROLE = keccak256("PROVER_ROLE"); /// @notice Emitted when the `freezeAll` is called event FreezeAll(); /// @notice Emitted when the `unfreezeAll` is called event UnfreezeAll(); /// @notice Error when trying to call contract while it is frozen error ContractIsFrozen(); /// @notice Error when trying to call contract from address without 'prover' role error NotProverRole(); /** * @dev Modifier to make a function callable only by the 'prover' role. * As an initial safety mechanism, the 'update_' functions are only callable by the 'prover' role. * Granting the prover role to `address(0)` will enable this role for everyone. */ modifier onlyProver() { if (!hasRole(PROVER_ROLE, address(0)) && !hasRole(PROVER_ROLE, _msgSender())) { revert NotProverRole(); } _; } function __AxiomV1Access_init() internal onlyInitializing { __AxiomV1Access_init_unchained(); } function __AxiomV1Access_init_unchained() internal onlyInitializing { frozen = false; } function freezeAll() external onlyRole(GUARDIAN_ROLE) { frozen = true; emit FreezeAll(); } function unfreezeAll() external onlyRole(GUARDIAN_ROLE) { frozen = false; emit UnfreezeAll(); } /// @notice Checks that the contract is not frozen. function requireNotFrozen() internal view { if (frozen) { revert ContractIsFrozen(); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[40] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; interface IAxiomV1State { /// @notice Returns the hash of a batch of consecutive blocks previously verified by the contract /// @dev The reads here will match the emitted #UpdateEvent /// @return historicalRoots(startBlockNumber) is 0 unless (startBlockNumber % 1024 == 0) /// historicalRoots(startBlockNumber) = 0 if block `startBlockNumber` is not verified /// historicalRoots(startBlockNumber) = keccak256(prevHash || root || numFinal) where || is concatenation /// - prevHash is the parent hash of block `startBlockNumber` /// - root is the keccak Merkle root of hash(i) for i in [0, 1024), where /// hash(i) is the blockhash of block `startBlockNumber + i` if i < numFinal, /// hash(i) = bytes32(0x0) if i >= numFinal /// - 0 < numFinal <= 1024 is the number of verified consecutive roots in [startBlockNumber, startBlockNumber + numFinal) function historicalRoots(uint32 startBlockNumber) external view returns (bytes32); /// @notice Returns metadata about the number of consecutive blocks from genesis stored in the contract /// The Merkle mountain range stores a commitment to the variable length list where `list[i]` is the Merkle root of the binary tree with leaves the blockhashes of blocks [1024 * i, 1024 * (i + 1)) /// @return numPeaks = bit_length(len) is the number of peaks in the Merkle mountain range /// @return len indicates that the historicalMMR commits to blockhashes of blocks [0, 1024 * len) /// @return index the current index in the ring buffer storing commitments to historicalMMRs function historicalMMR() external view returns (uint32 numPeaks, uint32 len, uint32 index); /// @notice Returns the i-th Merkle root in the historical Merkle Mountain Range /// @param i The index, `peaks[i] = root(list[((len >> i) << i) - 2^i : ((len >> i) << i)])` if 2^i & len != 0, otherwise 0 /// where root(single element) = single element, /// list is the variable length list where `list[i]` is the Merkle root of the binary tree with leaves the blockhashes of blocks [1024 * i, 1024 * (i + 1)) function historicalMMRPeaks(uint32 i) external view returns (bytes32); /// @notice A ring buffer storing commitments to past historicalMMR states /// @param index The index in the ring buffer function mmrRingBuffer(uint256 index) external view returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {BLOCK_BATCH_DEPTH} from "../../libraries/configuration/AxiomV1Configuration.sol"; interface IAxiomV1Verifier { /// @notice A merkle proof to verify a block against the verified blocks cached by Axiom /// @dev `BLOCK_BATCH_DEPTH = 10` struct BlockHashWitness { uint32 blockNumber; bytes32 claimedBlockHash; bytes32 prevHash; uint32 numFinal; bytes32[BLOCK_BATCH_DEPTH] merkleProof; } /// @notice Verify the blockhash of block blockNumber equals claimedBlockHash. Assumes that blockNumber is within the last 256 most recent blocks. /// @param blockNumber The block number to verify /// @param claimedBlockHash The claimed blockhash of block blockNumber function isRecentBlockHashValid(uint32 blockNumber, bytes32 claimedBlockHash) external view returns (bool); /// @notice Verify the blockhash of block witness.blockNumber equals witness.claimedBlockHash by checking against Axiom's cache of #historicalRoots. /// @dev For block numbers within the last 256, use #isRecentBlockHashValid instead. /// @param witness The block hash to verify and the Merkle proof to verify it /// witness.blockNumber is the block number to verify /// witness.claimedBlockHash is the claimed blockhash of block witness.blockNumber /// witness.prevHash is the prevHash stored in #historicalRoots(witness.blockNumber - witness.blockNumber % 1024) /// witness.numFinal is the numFinal stored in #historicalRoots(witness.blockNumber - witness.blockNumber % 1024) /// witness.merkleProof is the Merkle inclusion proof of witness.claimedBlockHash to the root stored in #historicalRoots(witness.blockNumber - witness.blockNumber % 1024) /// witness.merkleProof[i] is the sibling of the Merkle node at depth 10 - i, for i = 0, ..., 10 function isBlockHashValid(BlockHashWitness calldata witness) external view returns (bool); /// @notice Verify the blockhash of block blockNumber equals claimedBlockHash by checking against Axiom's cache of historical Merkle mountain ranges in #mmrRingBuffer. /// @dev Use event logs to determine the correct bufferId and get the MMR at that index in the ring buffer. /// @param mmr The Merkle mountain range commited to in #mmrRingBuffer(bufferId), must be correct length /// @param bufferId The index in the ring buffer of #mmrRingBuffer /// @param blockNumber The block number to verify /// @param claimedBlockHash The claimed blockhash of block blockNumber /// @param merkleProof The Merkle inclusion proof of claimedBlockHash to the corresponding peak in mmr. The correct peak is calculated from mmr.length and blockNumber. function mmrVerifyBlockHash( bytes32[] calldata mmr, uint8 bufferId, uint32 blockNumber, bytes32 claimedBlockHash, bytes32[] calldata merkleProof ) external view; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "./core/IAxiomV1Verifier.sol"; // The depth of the Merkle root of queries in: // `keccakBlockResponse`, `keccakAccountResponse`, and `keccakStorageResponse` uint32 constant QUERY_MERKLE_DEPTH = 6; interface IAxiomV1Query { /// @notice States of an on-chain query /// @param Inactive The query has not been made or was refunded. /// @param Active The query has been requested, but not fulfilled. /// @param Fulfilled The query was successfully fulfilled. enum AxiomQueryState { Inactive, Active, Fulfilled } /// @notice Stores metadata about a query /// @param payment The ETH payment received, in wei. /// @param state The state of the query. /// @param deadlineBlockNumber The deadline (in block number) after which a refund may be granted. /// @param refundee The address funds should be returned to if the query is not fulfilled. struct AxiomQueryMetadata { uint256 payment; AxiomQueryState state; uint32 deadlineBlockNumber; address payable refundee; } /// @notice Response values read from ZK proof for query. /// @param poseidonBlockResponse Poseidon Merkle root of `poseidon(blockHash . blockNumber . poseidon_tree_root(block_header))` /// @param keccakBlockResponse Keccak Merkle root of `keccak(blockHash . blockNumber)` /// @param poseidonAccountResponse Poseidon Merkle root of `poseidon(poseidonBlockResponseRow . poseidon(stateRoot . addr . poseidon_tree_root(account_state)))` /// @param keccakAccountResponse Keccak Merkle root of `keccak(blockNumber . addr . keccak(nonce . balance . storageRoot . codeHash))` /// @param poseidonStorageResponse Poseidon Merkle root of `poseidon(poseidonBlockResponseRow . poseidonAccountResponseRow . poseidon(storageRoot . slot . value))` /// @param keccakStorageResponse Keccak Merkle root of `keccak(blockNumber . addr . slot . value)` /// @param historicalMMRKeccak `keccak256(abi.encodePacked(mmr[10:]))` /// @param recentMMRKeccak `keccak256(abi.encodePacked(mmr[:10]))` // Detailed documentation on format here: https://hackmd.io/@axiom/S17K2drf2 // ** `poseidonBlockResponseRow = poseidon(blockHash . blockNumber . poseidon_tree_root(block_header))` // ** `poseidonAccountResponseRow = poseidon(stateRoot . addr . poseidon_tree_root(account_state)))` // ** `mmr` is a variable length array of bytes32 containing the Merkle Mountain Range the ZK proof is proving into. // `mmr[idx]` is either `bytes32(0)` or the Merkle root of `1 << idx` block hashes. // ** `mmr` is guaranteed to have length at least `10` and at most `32`. struct AxiomMMRQueryResponse { bytes32 poseidonBlockResponse; bytes32 keccakBlockResponse; bytes32 poseidonAccountResponse; bytes32 keccakAccountResponse; bytes32 poseidonStorageResponse; bytes32 keccakStorageResponse; bytes32 historicalMMRKeccak; bytes32 recentMMRKeccak; } /// @notice Stores witness data for checking MMRs /// @param prevHash The `prevHash` as in `IAxiomV1State`. /// @param root The `root` as in `IAxiomV1State`. /// @param numFinal The `numFinal` as in `IAxiomV1State`. /// @param startBlockNumber The `startBlockNumber` as in `IAxiomV1State`. /// @param recentMMRPeaks Peaks of the MMR committed to in the public input `recentMMRKeccak` of the ZK proof. /// @param mmrComplementOrPeaks If `len(recentMMRPeaks) <= numFinal`, then this is a complementary MMR containing /// the complement of `recentMMRPeaks` which together with `recentMMRPeaks` forms `root`. /// If `len(recentMMRPeaks) > numFinal`, then this is the MMR peaks of the `numFinal` blockhashes commited /// to in `root`. struct RecentMMRWitness { bytes32 prevHash; bytes32 root; uint32 numFinal; uint32 startBlockNumber; bytes32[10] recentMMRPeaks; bytes32[10] mmrComplementOrPeaks; } /// @notice Store a query result into a single block /// @param blockNumber The block number. /// @param blockHash The block hash. /// @param leafIdx The position of this result in the Merkle tree committed to by `keccakBlockResponse`. /// @param proof A Merkle proof into `keccakBlockResponse`. struct BlockResponse { uint32 blockNumber; bytes32 blockHash; uint32 leafIdx; bytes32[QUERY_MERKLE_DEPTH] proof; } /// @notice Store a query result into a single block /// @param blockNumber The block number. /// @param addr The address. /// @param nonce The nonce. /// @param balance The balance. /// @param storageRoot The storage root. /// @param codeHash The code hash. /// @param leafIdx The position of this result in the Merkle tree committed to by `keccakAccountResponse`. /// @param proof A Merkle proof into `keccakAccountResponse`. // Note: Fields are zero-padded by prefixing with zero bytes to: // * `nonce`: 8 bytes // * `balance`: 12 bytes // * `storageRoot`: 32 bytes // * `codeHash`: 32 bytes struct AccountResponse { uint32 blockNumber; address addr; uint64 nonce; uint96 balance; bytes32 storageRoot; bytes32 codeHash; uint32 leafIdx; bytes32[QUERY_MERKLE_DEPTH] proof; } /// @notice Store a query result into a single block /// @param blockNumber The block number. /// @param addr The address. /// @param slot The storage slot index. /// @param value The storage slot value. /// @param leafIdx The position of this result in the Merkle tree committed to by `keccakStorageResponse`. /// @param proof A Merkle proof into `keccakStorageResponse`. struct StorageResponse { uint32 blockNumber; address addr; uint256 slot; uint256 value; uint32 leafIdx; bytes32[QUERY_MERKLE_DEPTH] proof; } /// @notice Read the set of verified query responses in Keccak form. /// @param hash `verifiedKeccakResults(keccak256(keccakBlockResponse . keccakAccountResponse . keccakStorageResponse)) == true` /// if and only if each of `keccakBlockResponse`, `keccakAccountResponse`, and `keccakStorageResponse` have been verified /// on-chain by a ZK proof. function verifiedKeccakResults(bytes32 hash) external view returns (bool); /// @notice Read the set of verified query responses in Poseidon form. /// @param hash `verifiedPoseidonResults(keccak256(poseidonBlockResponse . poseidonAccountResponse . poseidonStorageResponse)) == true` /// if and only if each of `poseidonBlockResponse`, `poseidonAccountResponse`, and `poseidonStorageResponse` have been /// verified on-chain by a ZK proof. function verifiedPoseidonResults(bytes32 hash) external view returns (bool); /// @notice Returns the metadata associated to a query /// @param keccakQueryResponse The hash of the query response. function queries(bytes32 keccakQueryResponse) external view returns ( uint256 payment, AxiomQueryState state, uint32 deadlineBlockNumber, address payable refundee ); /// @notice Emitted when the `AxiomV1Core` address is updated. /// @param newAddress The updated address. event UpdateAxiomAddress(address newAddress); /// @notice Emitted when the batch query verifier address is updated. /// @param newAddress The updated address. event UpdateMMRVerifierAddress(address newAddress); /// @notice Emitted when a Keccak result is recorded /// @param keccakBlockResponse As documented in `AxiomMMRQueryResponse`. /// @param keccakAccountResponse As documented in `AxiomMMRQueryResponse`. /// @param keccakStorageResponse As documented in `AxiomMMRQueryResponse`. event KeccakResultEvent(bytes32 keccakBlockResponse, bytes32 keccakAccountResponse, bytes32 keccakStorageResponse); /// @notice Emitted when a Poseidon result is recorded /// @param poseidonBlockResponse As documented in `AxiomMMRQueryResponse`. /// @param poseidonAccountResponse As documented in `AxiomMMRQueryResponse`. /// @param poseidonStorageResponse As documented in `AxiomMMRQueryResponse`. event PoseidonResultEvent(bytes32 poseidonBlockResponse, bytes32 poseidonAccountResponse, bytes32 poseidonStorageResponse); /// @notice Emitted when the `minQueryPrice` is updated. /// @param minQueryPrice The new `minQueryPrice`. event UpdateMinQueryPrice(uint256 minQueryPrice); /// @notice Emitted when the `maxQueryPrice` is updated. /// @param maxQueryPrice The new `maxQueryPrice`. event UpdateMaxQueryPrice(uint256 maxQueryPrice); /// @notice Emitted when the `queryDeadlineInterval` is updated. /// @param queryDeadlineInterval The new `queryDeadlineInterval`. event UpdateQueryDeadlineInterval(uint32 queryDeadlineInterval); /// @notice Emitted when a new query with off-chain data availability is requested. /// @param keccakQueryResponse The hash of the claimed query response. /// @param payment The ETH payment offered, in wei. /// @param deadlineBlockNumber The deadline block number after which a refund is possible. /// @param refundee The address of the refundee. /// @param ipfsHash A content-addressed hash on IPFS where the query spec may be found. event QueryInitiatedOffchain(bytes32 keccakQueryResponse, uint256 payment, uint32 deadlineBlockNumber, address refundee, bytes32 ipfsHash); /// @notice Emitted when a new query with on-chain data availability is requested. /// @param keccakQueryResponse The hash of the claimed query response. /// @param payment The ETH payment offered, in wei. /// @param deadlineBlockNumber The deadline block number after which a refund is possible. /// @param refundee The address of the refundee. /// @param queryHash The hash of the on-chain query. event QueryInitiatedOnchain(bytes32 keccakQueryResponse, uint256 payment, uint32 deadlineBlockNumber, address refundee, bytes32 queryHash); /// @notice Emitted when a query is fulfilled. /// @param keccakQueryResponse The hash of the query response. /// @param payment The ETH payment collected, in wei. /// @param prover The address of the prover collecting payment. event QueryFulfilled(bytes32 keccakQueryResponse, uint256 payment, address prover); /// @notice Emitted when a query is refunded. /// @param keccakQueryResponse The hash of the query response. /// @param payment The ETH payment refunded minus gas, in wei. /// @param refundee The address collecting the refund. event QueryRefunded(bytes32 keccakQueryResponse, uint256 payment, uint32 deadlineBlockNumber, address refundee); /// @notice Verify a query result on-chain. /// @param mmrIdx The index of the cached MMR to verify against. /// @param mmrWitness Witness data to reconcile `recentMMR` against `historicalRoots`. /// @param proof The ZK proof data. function verifyResultVsMMR( uint32 mmrIdx, RecentMMRWitness calldata mmrWitness, bytes calldata proof ) external; /// @notice Request proof for query with on-chain query data availability. /// @param keccakQueryResponse The Keccak-encoded query response. /// @param refundee The address refunds should be sent to. /// @param query The serialized query. function sendQuery(bytes32 keccakQueryResponse, address payable refundee, bytes calldata query) external payable; /// @notice Request proof for query with off-chain query data availability. /// @param keccakQueryResponse The Keccak-encoded query response. /// @param refundee The address refunds should be sent to. /// @param ipfsHash The IPFS hash the query should optionally be posted to. function sendOffchainQuery(bytes32 keccakQueryResponse, address payable refundee, bytes32 ipfsHash) external payable; /// @notice Fulfill a query request on-chain. /// @param keccakQueryResponse The hashed query response. /// @param payee The address to send payment to. /// @param mmrIdx The index of the cached MMR to verify against. /// @param mmrWitness Witness data to reconcile `recentMMR` against `historicalRoots`. /// @param proof The ZK proof data. function fulfillQueryVsMMR( bytes32 keccakQueryResponse, address payable payee, uint32 mmrIdx, RecentMMRWitness calldata mmrWitness, bytes calldata proof ) external; /// @notice Trigger refund collection for a query after the deadline has expired. /// @param keccakQueryResponse THe hashed query response. function collectRefund(bytes32 keccakQueryResponse) external; /// @notice Checks whether an unpacked query response has already been verified. /// @param keccakBlockResponse As documented in `AxiomMMRQueryResponse`. /// @param keccakAccountResponse As documented in `AxiomMMRQueryResponse`. /// @param keccakStorageResponse As documented in `AxiomMMRQueryResponse`. function isKeccakResultValid(bytes32 keccakBlockResponse, bytes32 keccakAccountResponse, bytes32 keccakStorageResponse) external view returns (bool); /// @notice Checks whether an unpacked query response has already been verified. /// @param poseidonBlockResponse As documented in `AxiomMMRQueryResponse`. /// @param poseidonAccountResponse As documented in `AxiomMMRQueryResponse`. /// @param poseidonStorageResponse As documented in `AxiomMMRQueryResponse`. function isPoseidonResultValid(bytes32 poseidonBlockResponse, bytes32 poseidonAccountResponse, bytes32 poseidonStorageResponse) external view returns (bool); /// @notice Verify block, account, and storage data against responses which have already been proven. /// @param keccakBlockResponse As documented in `AxiomMMRQueryResponse`. /// @param keccakAccountResponse As documented in `AxiomMMRQueryResponse`. /// @param keccakStorageResponse As documented in `AxiomMMRQueryResponse`. /// @param blockResponses The list of block results. /// @param accountResponses The list of account results. /// @param storageResponses The list of storage results. // block_response = keccak(blockHash . blockNumber) // account_response = hash(blockNumber . address . hash_tree_root(account_state)) // storage_response = hash(blockNumber . address . slot . value) function areResponsesValid( bytes32 keccakBlockResponse, bytes32 keccakAccountResponse, bytes32 keccakStorageResponse, BlockResponse[] calldata blockResponses, AccountResponse[] calldata accountResponses, StorageResponse[] calldata storageResponses ) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {HISTORICAL_NUM_ROOTS} from "./configuration/AxiomV1Configuration.sol"; /// @title Merkle Tree /// @notice Helper functions for computing Merkle roots of Merkle trees library MerkleTree { /// @notice Compute the Merkle root of a Merkle tree with HISTORICAL_NUM_ROOTS leaves /// @param leaves The HISTORICAL_NUM_ROOTS leaves of the Merkle tree function merkleRoot(bytes32[HISTORICAL_NUM_ROOTS] memory leaves) internal pure returns (bytes32) { // we create a new array to avoid mutating `leaves`, which is passed by reference // unnecessary if calldata `leaves` is passed in since it is automatically copied to memory bytes32[] memory hashes = new bytes32[](HISTORICAL_NUM_ROOTS / 2); for (uint256 i = 0; i < HISTORICAL_NUM_ROOTS / 2; i++) { hashes[i] = keccak256(abi.encodePacked(leaves[i << 1], leaves[(i << 1) | 1])); } uint256 len = HISTORICAL_NUM_ROOTS / 4; while (len != 0) { for (uint256 i = 0; i < len; i++) { hashes[i] = keccak256(abi.encodePacked(hashes[i << 1], hashes[(i << 1) | 1])); } len >>= 1; } return hashes[0]; } /// @notice Compute the Merkle root of a Merkle tree with 2^depth leaves all equal to bytes32(0x0) /// @param depth The depth of the Merkle tree, 0 <= depth < BLOCK_BATCH_DEPTH. function getEmptyHash(uint256 depth) internal pure returns (bytes32) { // emptyHashes[idx] is the Merkle root of a tree of depth idx with 0's as leaves if (depth == 0) { return bytes32(0x0000000000000000000000000000000000000000000000000000000000000000); } else if (depth == 1) { return bytes32(0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5); } else if (depth == 2) { return bytes32(0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30); } else if (depth == 3) { return bytes32(0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85); } else if (depth == 4) { return bytes32(0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344); } else if (depth == 5) { return bytes32(0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d); } else if (depth == 6) { return bytes32(0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968); } else if (depth == 7) { return bytes32(0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83); } else if (depth == 8) { return bytes32(0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af); } else if (depth == 9) { return bytes32(0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0); } else { revert("depth must be in range [0, 10)"); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; // Constants and free functions to be inlined into by AxiomV1Core // ZK circuit constants: // AxiomV1 caches blockhashes in batches, stored as Merkle roots of binary Merkle trees uint32 constant BLOCK_BATCH_SIZE = 1024; uint32 constant BLOCK_BATCH_DEPTH = 10; // constants for batch import of historical block hashes // historical uploads a bigger batch of block hashes, stored as Merkle roots of binary Merkle trees uint32 constant HISTORICAL_BLOCK_BATCH_SIZE = 131072; // 2 ** 17 uint32 constant HISTORICAL_BLOCK_BATCH_DEPTH = 17; // we will consider the historical Merkle tree of blocks as a Merkle tree of the block batch roots uint32 constant HISTORICAL_NUM_ROOTS = 128; // HISTORICAL_BATCH_SIZE / BLOCK_BATCH_SIZE // The first 4 * 3 * 32 bytes of proof calldata are reserved for two BN254 G1 points for a pairing check // It will then be followed by (7 + BLOCK_BATCH_DEPTH * 2) * 32 bytes of public inputs/outputs uint32 constant AUX_PEAKS_START_IDX = 608; // PUBLIC_BYTES_START_IDX + 7 * 32 // Historical MMR Ring Buffer constants uint32 constant MMR_RING_BUFFER_SIZE = 8; /// @dev proofData stores bytes32 and uint256 values in hi-lo format as two uint128 values because the BN254 scalar field is 254 bits /// @dev The first 12 * 32 bytes of proofData are reserved for ZK proof verification data // Extract public instances from proof // The public instances are laid out in the proof calldata as follows: // First 4 * 3 * 32 = 384 bytes are reserved for proof verification data used with the pairing precompile // 384..384 + 32 * 2: prevHash (32 bytes) as two uint128 cast to uint256, because zk proof uses 254 bit field and cannot fit uint256 into a single element // 384 + 32 * 2..384 + 32 * 4: endHash (32 bytes) as two uint128 cast to uint256 // 384 + 32 * 4..384 + 32 * 5: startBlockNumber (uint32: 4 bytes) and endBlockNumber (uint32: 4 bytes) are concatenated as `startBlockNumber . endBlockNumber` (8 bytes) and then cast to uint256 // 384 + 32 * 5..384 + 32 * 7: root (32 bytes) as two uint128 cast to uint256, this is the highest peak of the MMR if endBlockNumber - startBlockNumber == 1023, otherwise 0 function getBoundaryBlockData(bytes calldata proofData) pure returns (bytes32 prevHash, bytes32 endHash, uint32 startBlockNumber, uint32 endBlockNumber, bytes32 root) { prevHash = bytes32(uint256(bytes32(proofData[384:416])) << 128 | uint256(bytes32(proofData[416:448]))); endHash = bytes32(uint256(bytes32(proofData[448:480])) << 128 | uint256(bytes32(proofData[480:512]))); startBlockNumber = uint32(bytes4(proofData[536:540])); endBlockNumber = uint32(bytes4(proofData[540:544])); root = bytes32(uint256(bytes32(proofData[544:576])) << 128 | uint256(bytes32(proofData[576:608]))); } // We have a Merkle mountain range of max depth BLOCK_BATCH_DEPTH (so length BLOCK_BATCH_DEPTH + 1 total) ordered in **decreasing** order of peak size, so: // `root` from `getBoundaryBlockData` is the peak for depth BLOCK_BATCH_DEPTH // `getAuxMmrPeak(proofData, i)` is the peaks for depth BLOCK_BATCH_DEPTH - 1 - i // 384 + 32 * 7 + 32 * 2 * i .. 384 + 32 * 7 + 32 * 2 * (i + 1): (32 bytes) as two uint128 cast to uint256, same as blockHash // Note that the decreasing ordering is *different* than the convention in library MerkleMountainRange function getAuxMmrPeak(bytes calldata proofData, uint256 i) pure returns (bytes32) { return bytes32( uint256(bytes32(proofData[AUX_PEAKS_START_IDX + i * 64:AUX_PEAKS_START_IDX + i * 64 + 32])) << 128 | uint256(bytes32(proofData[AUX_PEAKS_START_IDX + i * 64 + 32:AUX_PEAKS_START_IDX + (i + 1) * 64])) ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.3) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/IERC1967Upgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.3) (interfaces/IERC1967.sol) pragma solidity ^0.8.0; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. * * _Available since v4.9._ */ interface IERC1967Upgradeable { /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Emitted when the beacon is changed. */ event BeaconUpgraded(address indexed beacon); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "remappings": [ "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 1000000, "details": { "constantOptimizer": false, "yul": false } }, "metadata": { "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BlockHashNotValidatedInCache","type":"error"},{"inputs":[],"name":"BlockHashWitnessNotRecent","type":"error"},{"inputs":[],"name":"BlockMerkleRootDoesNotMatchProof","type":"error"},{"inputs":[],"name":"CannotFulfillIfNotActive","type":"error"},{"inputs":[],"name":"CannotRefundBeforeDeadline","type":"error"},{"inputs":[],"name":"CannotRefundIfNotActive","type":"error"},{"inputs":[],"name":"ClaimedMMRDoesNotMatchRecent","type":"error"},{"inputs":[],"name":"ContractIsFrozen","type":"error"},{"inputs":[],"name":"HistoricalMMRKeccakDoesNotMatchProof","type":"error"},{"inputs":[],"name":"KeccakQueryResponseDoesNotMatchProof","type":"error"},{"inputs":[],"name":"MMREndBlockNotRecent","type":"error"},{"inputs":[],"name":"MMRProofVerificationFailed","type":"error"},{"inputs":[],"name":"NotProverRole","type":"error"},{"inputs":[],"name":"PriceNotPaid","type":"error"},{"inputs":[],"name":"PriceTooHigh","type":"error"},{"inputs":[],"name":"ProofVerificationFailed","type":"error"},{"inputs":[],"name":"QueryNotInactive","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[],"name":"FreezeAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keccakBlockResponse","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"keccakAccountResponse","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"keccakStorageResponse","type":"bytes32"}],"name":"KeccakResultEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"poseidonBlockResponse","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"poseidonAccountResponse","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"poseidonStorageResponse","type":"bytes32"}],"name":"PoseidonResultEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keccakQueryResponse","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"payment","type":"uint256"},{"indexed":false,"internalType":"address","name":"prover","type":"address"}],"name":"QueryFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keccakQueryResponse","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"payment","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"deadlineBlockNumber","type":"uint32"},{"indexed":false,"internalType":"address","name":"refundee","type":"address"},{"indexed":false,"internalType":"bytes32","name":"ipfsHash","type":"bytes32"}],"name":"QueryInitiatedOffchain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keccakQueryResponse","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"payment","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"deadlineBlockNumber","type":"uint32"},{"indexed":false,"internalType":"address","name":"refundee","type":"address"},{"indexed":false,"internalType":"bytes32","name":"queryHash","type":"bytes32"}],"name":"QueryInitiatedOnchain","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"keccakQueryResponse","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"payment","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"deadlineBlockNumber","type":"uint32"},{"indexed":false,"internalType":"address","name":"refundee","type":"address"}],"name":"QueryRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[],"name":"UnfreezeAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"UpdateAxiomAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"UpdateMMRVerifierAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxQueryPrice","type":"uint256"}],"name":"UpdateMaxQueryPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minQueryPrice","type":"uint256"}],"name":"UpdateMinQueryPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"queryDeadlineInterval","type":"uint32"}],"name":"UpdateQueryDeadlineInterval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GUARDIAN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROVER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TIMELOCK_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"keccakBlockResponse","type":"bytes32"},{"internalType":"bytes32","name":"keccakAccountResponse","type":"bytes32"},{"internalType":"bytes32","name":"keccakStorageResponse","type":"bytes32"},{"components":[{"internalType":"uint32","name":"blockNumber","type":"uint32"},{"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"internalType":"uint32","name":"leafIdx","type":"uint32"},{"internalType":"bytes32[6]","name":"proof","type":"bytes32[6]"}],"internalType":"struct IAxiomV1Query.BlockResponse[]","name":"blockResponses","type":"tuple[]"},{"components":[{"internalType":"uint32","name":"blockNumber","type":"uint32"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"bytes32","name":"storageRoot","type":"bytes32"},{"internalType":"bytes32","name":"codeHash","type":"bytes32"},{"internalType":"uint32","name":"leafIdx","type":"uint32"},{"internalType":"bytes32[6]","name":"proof","type":"bytes32[6]"}],"internalType":"struct IAxiomV1Query.AccountResponse[]","name":"accountResponses","type":"tuple[]"},{"components":[{"internalType":"uint32","name":"blockNumber","type":"uint32"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"slot","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint32","name":"leafIdx","type":"uint32"},{"internalType":"bytes32[6]","name":"proof","type":"bytes32[6]"}],"internalType":"struct IAxiomV1Query.StorageResponse[]","name":"storageResponses","type":"tuple[]"}],"name":"areResponsesValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"axiomAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"keccakQueryResponse","type":"bytes32"}],"name":"collectRefund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freezeAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"frozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"keccakQueryResponse","type":"bytes32"},{"internalType":"address payable","name":"payee","type":"address"},{"internalType":"uint32","name":"mmrIdx","type":"uint32"},{"components":[{"internalType":"bytes32","name":"prevHash","type":"bytes32"},{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"uint32","name":"numFinal","type":"uint32"},{"internalType":"uint32","name":"startBlockNumber","type":"uint32"},{"internalType":"bytes32[10]","name":"recentMMRPeaks","type":"bytes32[10]"},{"internalType":"bytes32[10]","name":"mmrComplementOrPeaks","type":"bytes32[10]"}],"internalType":"struct IAxiomV1Query.RecentMMRWitness","name":"mmrWitness","type":"tuple"},{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"fulfillQueryVsMMR","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_axiomAddress","type":"address"},{"internalType":"address","name":"_mmrVerifierAddress","type":"address"},{"internalType":"uint256","name":"_minQueryPrice","type":"uint256"},{"internalType":"uint256","name":"_maxQueryPrice","type":"uint256"},{"internalType":"uint32","name":"_queryDeadlineInterval","type":"uint32"},{"internalType":"address","name":"timelock","type":"address"},{"internalType":"address","name":"guardian","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"keccakBlockResponse","type":"bytes32"},{"internalType":"bytes32","name":"keccakAccountResponse","type":"bytes32"},{"internalType":"bytes32","name":"keccakStorageResponse","type":"bytes32"}],"name":"isKeccakResultValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poseidonBlockResponse","type":"bytes32"},{"internalType":"bytes32","name":"poseidonAccountResponse","type":"bytes32"},{"internalType":"bytes32","name":"poseidonStorageResponse","type":"bytes32"}],"name":"isPoseidonResultValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxQueryPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minQueryPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mmrVerifierAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"queries","outputs":[{"internalType":"uint256","name":"payment","type":"uint256"},{"internalType":"enum IAxiomV1Query.AxiomQueryState","name":"state","type":"uint8"},{"internalType":"uint32","name":"deadlineBlockNumber","type":"uint32"},{"internalType":"address payable","name":"refundee","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"queryDeadlineInterval","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"keccakQueryResponse","type":"bytes32"},{"internalType":"address payable","name":"refundee","type":"address"},{"internalType":"bytes32","name":"ipfsHash","type":"bytes32"}],"name":"sendOffchainQuery","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"keccakQueryResponse","type":"bytes32"},{"internalType":"address payable","name":"refundee","type":"address"},{"internalType":"bytes","name":"query","type":"bytes"}],"name":"sendQuery","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unfreezeAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_axiomAddress","type":"address"}],"name":"updateAxiomAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_mmrVerifierAddress","type":"address"}],"name":"updateMMRVerifierAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxQueryPrice","type":"uint256"}],"name":"updateMaxQueryPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minQueryPrice","type":"uint256"}],"name":"updateMinQueryPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_queryDeadlineInterval","type":"uint32"}],"name":"updateQueryDeadlineInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"verifiedKeccakResults","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"verifiedPoseidonResults","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"mmrIdx","type":"uint32"},{"components":[{"internalType":"bytes32","name":"prevHash","type":"bytes32"},{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"uint32","name":"numFinal","type":"uint32"},{"internalType":"uint32","name":"startBlockNumber","type":"uint32"},{"internalType":"bytes32[10]","name":"recentMMRPeaks","type":"bytes32[10]"},{"internalType":"bytes32[10]","name":"mmrComplementOrPeaks","type":"bytes32[10]"}],"internalType":"struct IAxiomV1Query.RecentMMRWitness","name":"mmrWitness","type":"tuple"},{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"verifyResultVsMMR","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a0604052306080523480156200001557600080fd5b506200002062000026565b62000164565b600054610100900460ff161562000074576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200006b90620000ec565b60405180910390fd5b60005460ff9081161015620000ea57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660ff9081179091556040517f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249891620000e19162000154565b60405180910390a15b565b602080825281016200014e81602781527f496e697469616c697a61626c653a20636f6e747261637420697320696e69746960208201527f616c697a696e6700000000000000000000000000000000000000000000000000604082015260600190565b92915050565b60ff82168152602081016200014e565b60805161579b6200019c60003960008181610aa401528181610afe01528181610bfd01528181610c570152610d46015261579b6000f3fe6080604052600436106102855760003560e01c8063774a623411610153578063a217fddf116100cb578063d77de0791161007f578063df7e2e2d11610064578063df7e2e2d146107b2578063e741ad80146107c9578063f288a2e2146107fa57600080fd5b8063d77de0791461075e578063dc9a4ef61461077e57600080fd5b8063b691943f116100b0578063b691943f146106f0578063d35a584414610710578063d547741f1461073e57600080fd5b8063a217fddf146106c4578063b1d401cd146106d957600080fd5b8063898b8a1a1161012257806391d148541161010757806391d14854146106495780639755b1fc1461069c57806399464c89146106af57600080fd5b8063898b8a1a146106095780638b4acf281461062957600080fd5b8063774a62341461057e578063798da01a1461059e57806379ce0468146105be578063878bab8c146105e957600080fd5b80633659cfe6116102015780635eac0e23116101b557806366c5c4a01161019a57806366c5c4a0146105295780636ec59b3f1461053e57806375a09b091461055e57600080fd5b80635eac0e23146104d85780636439e9d41461050957600080fd5b8063528bad37116101e6578063528bad371461046857806352d1902d146104a3578063560aa8cd146104b857600080fd5b80633659cfe6146104355780634f1ef2861461045557600080fd5b8063248a9ca3116102585780632f2ff15d1161023d5780632f2ff15d146103e257806332c4cda21461040257806336568abe1461041557600080fd5b8063248a9ca31461037157806324ea54f4146103ae57600080fd5b806301f8fca41461028a57806301ffc9a7146102ac578063054f7d9c146102e257806321dfb600146102fc575b600080fd5b34801561029657600080fd5b506102aa6102a536600461402b565b61082e565b005b3480156102b857600080fd5b506102cc6102c736600461407f565b61089a565b6040516102d991906140aa565b60405180910390f35b3480156102ee57600080fd5b506097546102cc9060ff1681565b34801561030857600080fd5b5061036161031736600461402b565b61012b602052600090815260409020805460019091015460ff811690610100810463ffffffff169065010000000000900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102d99493929190614153565b34801561037d57600080fd5b506103a161038c36600461402b565b60009081526065602052604090206001015490565b6040516102d99190614188565b3480156103ba57600080fd5b506103a17f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504181565b3480156103ee57600080fd5b506102aa6103fd3660046141aa565b6108f6565b6102aa610410366004614239565b610920565b34801561042157600080fd5b506102aa6104303660046141aa565b610a27565b34801561044157600080fd5b506102aa6104503660046142a7565b610a8d565b6102aa610463366004614413565b610be6565b34801561047457600080fd5b50610124546104969073ffffffffffffffffffffffffffffffffffffffff1681565b6040516102d99190614461565b3480156104af57600080fd5b506103a1610d2c565b3480156104c457600080fd5b506102cc6104d336600461446f565b610dc2565b3480156104e457600080fd5b506102cc6104f336600461402b565b6101266020526000908152604090205460ff1681565b34801561051557600080fd5b506102cc6105243660046145a3565b610e2f565b34801561053557600080fd5b506102aa611384565b34801561054a57600080fd5b506102aa6105593660046142a7565b611402565b34801561056a57600080fd5b506102aa6105793660046146bf565b61149d565b34801561058a57600080fd5b506102aa6105993660046142a7565b611578565b3480156105aa57600080fd5b506102aa6105b936600461402b565b611613565b3480156105ca57600080fd5b5061012a546105dc9063ffffffff1681565b6040516102d99190614717565b3480156105f557600080fd5b506102aa610604366004614725565b611673565b34801561061557600080fd5b506102cc61062436600461446f565b6119a5565b34801561063557600080fd5b506102aa61064436600461402b565b6119c1565b34801561065557600080fd5b506102cc6106643660046141aa565b600091825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6102aa6106aa3660046147bd565b611c4a565b3480156106bb57600080fd5b506102aa611d24565b3480156106d057600080fd5b506103a1600081565b3480156106e557600080fd5b506103a16101285481565b3480156106fc57600080fd5b506102aa61070b3660046147f2565b611da5565b34801561071c57600080fd5b50610125546104969073ffffffffffffffffffffffffffffffffffffffff1681565b34801561074a57600080fd5b506102aa6107593660046141aa565b612252565b34801561076a57600080fd5b506102aa610779366004614891565b612277565b34801561078a57600080fd5b506103a17f60044782a422109ac08a415e44260ad5d3bad63d96ebe1fac0363399642ee3f281565b3480156107be57600080fd5b506103a16101295481565b3480156107d557600080fd5b506102cc6107e436600461402b565b6101276020526000908152604090205460ff1681565b34801561080657600080fd5b506103a17ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0581565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561085881612302565b6101298290556040517f45ceffba6cdfd80ac24dded71e7dc1a0e3620f2a2a1433f2c38e0e68acef2a009061088e908490614188565b60405180910390a15050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fff7a5d530000000000000000000000000000000000000000000000000000000014806108f057506108f08261230c565b92915050565b60008281526065602052604090206001015461091181612302565b61091b83836123a3565b505050565b610928612497565b61012854341015610965576040517fde43553100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610129543411156109a2576040517f24fe119200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109ad8434856124d6565b600082826040516109bf9291906148c5565b60405190819003902061012a549091507f51bc40919d53d6a0750201d2087c589a09286b4e9f320919d04ad4545ced4abb9086903490610a059063ffffffff1643614901565b8785604051610a1895949392919061497d565b60405180910390a15050505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614a26565b60405180910390fd5b610a898282612679565b5050565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163003610afc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614a90565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610b717f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610bbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614afa565b610bc781612734565b60408051600080825260208201909252610be39183919061275e565b50565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163003610c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614a90565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610cca7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614afa565b610d2082612734565b610a898282600161275e565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614b64565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b60006101266000858585604051602001610dde93929190614b74565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181528151602092830120835290820192909252016000205460ff1690505b9392505050565b600061012660008b8b8b604051602001610e4b93929190614b74565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181528151602092830120835290820192909252016000205460ff16610e9e57506000611377565b60005b63ffffffff8116871115610fd557600088888363ffffffff16818110610ec957610ec9614bab565b905061012002016020013589898463ffffffff16818110610eec57610eec614bab565b610f03926020610120909202019081019150614891565b604051602001610f14929190614bf5565b604051602081830303815290604052805190602001209050610fb38c828b8b8663ffffffff16818110610f4957610f49614bab565b9050610120020160600160068060200260405190810160405280929190826006602002808284376000920191909152508e91508d905063ffffffff8816818110610f9557610f95614bab565b905061012002016040016020810190610fae9190614891565b6128b1565b610fc257600092505050611377565b5080610fcd81614c1b565b915050610ea1565b5060005b63ffffffff81168511156111e857600086868363ffffffff1681811061100157611001614bab565b6110189260206101a0909202019081019150614891565b87878463ffffffff1681811061103057611030614bab565b90506101a00201602001602081019061104991906142a7565b88888563ffffffff1681811061106157611061614bab565b90506101a00201604001602081019061107a9190614c74565b89898663ffffffff1681811061109257611092614bab565b90506101a0020160600160208101906110ab9190614cb4565b8a8a8763ffffffff168181106110c3576110c3614bab565b90506101a00201608001358b8b8863ffffffff168181106110e6576110e6614bab565b90506101a0020160a001356040516020016111049493929190614d17565b6040516020818303038152906040528051906020012060405160200161112c93929190614d87565b6040516020818303038152906040528051906020012090506111c68b8289898663ffffffff1681811061116157611161614bab565b90506101a0020160e00160068060200260405190810160405280929190826006602002808284376000920191909152508c91508b905063ffffffff88168181106111ad576111ad614bab565b90506101a0020160c0016020810190610fae9190614891565b6111d557600092505050611377565b50806111e081614c1b565b915050610fd9565b5060005b63ffffffff811683111561137157600084848363ffffffff1681811061121457611214614bab565b61122b926020610160909202019081019150614891565b85858463ffffffff1681811061124357611243614bab565b90506101600201602001602081019061125c91906142a7565b86868563ffffffff1681811061127457611274614bab565b905061016002016040013587878663ffffffff1681811061129757611297614bab565b90506101600201606001356040516020016112b59493929190614db3565b60405160208183030381529060405280519060200120905061134f8a8287878663ffffffff168181106112ea576112ea614bab565b9050610160020160a00160068060200260405190810160405280929190826006602002808284376000920191909152508a915089905063ffffffff881681811061133657611336614bab565b905061016002016080016020810190610fae9190614891565b61135e57600092505050611377565b508061136981614c1b565b9150506111ec565b50600190505b9998505050505050505050565b7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a50416113ae81612302565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556040517fe6fdbf73945dd61794a752b9181ea29f77170a7b1ffd37e0a7ff9d2c6f7258b990600090a150565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561142c81612302565b61012580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790556040517f5dcffe9bbb6912962f7ffcea27f330f6aba5de77d262086624d5be74b849fd109061088e908490614461565b600080527f16d6d09ad43c2e13327e8e85b0f16a19ef2e63b72c391bfd77d21c5d499021856020527fdf4fae2a9d03ddefae2c9e431bd1ae49d400972b66abd41187abff73623b3c4b5460ff1615801561152657503360009081527f16d6d09ad43c2e13327e8e85b0f16a19ef2e63b72c391bfd77d21c5d49902185602052604090205460ff16155b1561155d576040517f6692e47700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611565612497565b6115718484848461298f565b5050505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f056115a281612302565b61012480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790556040517f4f58839d9075210378ad47340fc23fab81e060f9fb13f00151841b25bc23d4b79061088e908490614461565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561163d81612302565b6101288290556040517f65bd598c7e893131b1f10bd7e7db583b9af90196f90525922c85b1c2fcc298609061088e908490614188565b600080527f16d6d09ad43c2e13327e8e85b0f16a19ef2e63b72c391bfd77d21c5d499021856020527fdf4fae2a9d03ddefae2c9e431bd1ae49d400972b66abd41187abff73623b3c4b5460ff161580156116fc57503360009081527f16d6d09ad43c2e13327e8e85b0f16a19ef2e63b72c391bfd77d21c5d49902185602052604090205460ff16155b15611733576040517f6692e47700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61173b612497565b6001600087815261012b602052604090206001015460ff166002811115611764576117646140be565b1461179b576040517ff8c22cf100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006117a98585858561298f565b90508681146117e4576040517fc496ba3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051608081018252600089815261012b60209081529281205482529181016002815260008a815261012b602081815260408084206001808201805463ffffffff610100820416868a015273ffffffffffffffffffffffffffffffffffffffff650100000000008204169490980193909352948f9052928252855183559085015194955085949193919290917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016908360028111156118a6576118a66140be565b021790555060408281015160019290920180546060909401517fffffffffffffff000000000000000000000000000000000000000000000000ff90941661010063ffffffff948516027fffffffffffffff0000000000000000000000000000000000000000ffffffffff16176501000000000073ffffffffffffffffffffffffffffffffffffffff9586160217905560008b815261012b602052205461194f928a16916135e716565b600088815261012b6020526040908190205490517f662c835a3bf2a9618618ac34dfe8d5a12be89da82c8423c97b00ba7c658ba68c91611993918b91908b90614ddf565b60405180910390a15050505050505050565b60006101276000858585604051602001610dde93929190614b74565b600081815261012b60209081526040808320815160808101909252805482526001810154919290919083019060ff166002811115611a0157611a016140be565b6002811115611a1257611a126140be565b8152600191820154610100810463ffffffff16602083015265010000000000900473ffffffffffffffffffffffffffffffffffffffff1660409091015290915081602001516002811115611a6857611a686140be565b14611a9f576040517f5f158cf700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806040015163ffffffff164311611ae2576040517f6d542c0d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051608081018252600080825260208083018281528385018390526060840183905286835261012b90915292902081518155915160018084018054939485949093927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911690836002811115611b5d57611b5d6140be565b0217905550604082015160019190910180546060938401517fffffffffffffff000000000000000000000000000000000000000000000000ff90911661010063ffffffff948516027fffffffffffffff0000000000000000000000000000000000000000ffffffffff16176501000000000073ffffffffffffffffffffffffffffffffffffffff9283160217909155845192850151611bff939116916135e716565b8151604080840151606085015191517f38c89cadb339d1bffb61715406f1b242b77f304ef7759730c0094c14c1017f7f93611c3d9388939192614e07565b60405180910390a1505050565b611c52612497565b61012854341015611c8f576040517fde43553100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012954341115611ccc576040517f24fe119200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611cd78334846124d6565b61012a547fea3db7d163ac581226b9faa5f9e5e5efe400bfb1b8a365db5c3e7cbff6d2984d9084903490611d119063ffffffff1643614901565b8585604051611c3d95949392919061497d565b7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041611d4e81612302565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556040517f61340a1b154d5d21d259a74bf95379201799b9d12cc6509bb46cb56dc281df5590600090a150565b600054610100900460ff1615808015611dc55750600054600160ff909116105b80611ddf5750303b158015611ddf575060005460ff166001145b611e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614e96565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611e7357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b611e7b6136c4565b611e83613705565b73ffffffffffffffffffffffffffffffffffffffff8816611ed0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614f00565b73ffffffffffffffffffffffffffffffffffffffff8716611f1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614f6a565b73ffffffffffffffffffffffffffffffffffffffff8316611f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614fd4565b73ffffffffffffffffffffffffffffffffffffffff8216611fb7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a769061503e565b610124805473ffffffffffffffffffffffffffffffffffffffff808b167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179092556101258054928a16929091169190911790556040517f4f58839d9075210378ad47340fc23fab81e060f9fb13f00151841b25bc23d4b79061203e908a90614461565b60405180910390a17f5dcffe9bbb6912962f7ffcea27f330f6aba5de77d262086624d5be74b849fd10876040516120759190614461565b60405180910390a161012886905561012985905561012a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff86161790556040517f65bd598c7e893131b1f10bd7e7db583b9af90196f90525922c85b1c2fcc29860906120ea908890614188565b60405180910390a17f45ceffba6cdfd80ac24dded71e7dc1a0e3620f2a2a1433f2c38e0e68acef2a00856040516121219190614188565b60405180910390a17f266d22101c27a330937ff06442e5289e92a84a449d22bb001c03789f7774b628846040516121589190614717565b60405180910390a161218a7f60044782a422109ac08a415e44260ad5d3bad63d96ebe1fac0363399642ee3f2336123a3565b6121956000846123a3565b6121bf7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05846123a3565b6121e97f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041836123a3565b801561224857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690556040517f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989061199390600190615062565b5050505050505050565b60008281526065602052604090206001015461226d81612302565b61091b8383612679565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f056122a181612302565b61012a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff84161790556040517f266d22101c27a330937ff06442e5289e92a84a449d22bb001c03789f7774b6289061088e908490614717565b610be38133613770565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806108f057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146108f0565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a8957600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556124393390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60975460ff16156124d4576040517f379dfc6300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b600083815261012b602052604081206001015460ff1660028111156124fd576124fd6140be565b14612534576040517f96e41fe900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516080810182528381526001602082015261012a546000928201906125629063ffffffff1643614901565b63ffffffff16815273ffffffffffffffffffffffffffffffffffffffff8416602091820152600086815261012b825260409020825181559082015160018083018054949550859490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116908360028111156125e2576125e26140be565b021790555060408201516001909101805460609093015173ffffffffffffffffffffffffffffffffffffffff1665010000000000027fffffffffffffff0000000000000000000000000000000000000000ffffffffff63ffffffff90931661010002929092167fffffffffffffff000000000000000000000000000000000000000000000000ff9093169290921717905550505050565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610a8957600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05610a8981612302565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156127915761091b8361382a565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612816575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526128139181019061507b565b60015b61284c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906150f6565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146128a5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615160565b5061091b8383836138de565b600083815b60068163ffffffff16101561298157600163ffffffff8581169083161c166000036129275781858263ffffffff16600681106128f4576128f4614bab565b602002015160405160200161290a929190615170565b60405160208183030381529060405280519060200120915061296f565b848163ffffffff166006811061293f5761293f614bab565b602002015182604051602001612956929190615170565b6040516020818303038152906040528051906020012091505b8061297981614c1b565b9150506128b6565b50851490505b949350505050565b6000612999612497565b600863ffffffff8616106129ac57600080fd5b60006129b88484613909565b60c0810151610124546040517f074144d6000000000000000000000000000000000000000000000000000000008152929350909173ffffffffffffffffffffffffffffffffffffffff9091169063074144d690612a19908a906004016151b1565b602060405180830381865afa158015612a36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5a919061507b565b14612a91576040517fd9fcd6a100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101245460009073ffffffffffffffffffffffffffffffffffffffff1663c6ca4753612ac36080890160608a01614891565b6040518263ffffffff1660e01b8152600401612adf9190614717565b602060405180830381865afa158015612afc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b20919061507b565b905085356020870135612b396060890160408a01614891565b604051602001612b4b939291906151bf565b604051602081830303815290604052805190602001208114612b6c57600080fd5b5084608001604051602001612b81919061520c565b604051602081830303815290604052805190602001208160e0015114612ba657600080fd5b6000805b600a8163ffffffff161015612c085760006080880163ffffffff8316600a8110612bd657612bd6614bab565b602002013514612bf657612bf3600163ffffffff83161b83614901565b91505b80612c0081614c1b565b915050612baa565b5060008163ffffffff16118015612c3a5750612c2a6060870160408801614891565b63ffffffff168163ffffffff1611155b15612cb9576000612ca087608001600a806020026040519081016040528092919082600a60200280828437600092019190915250506040805161014081810190925291506101c08b0190600a908390839080828437600092019190915250613adc915050565b50905080876020013514612cb357600080fd5b506133b4565b612cc96060870160408801614891565b63ffffffff168163ffffffff1611156133b4574381612cee6080890160608a01614891565b612cf89190614901565b63ffffffff161115612d36576040517ff5b1753900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d4261010043615222565b612d526060880160408901614891565b612d626080890160608a01614891565b612d6c9190614901565b63ffffffff161015612daa576040517f7df2555400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051610140808201835260008083527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb560208401527fb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30838501527f21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba8560608401527fe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a1934460808401527f0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d60a08401527f887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a196860c08401527fffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f8360e08401527f9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af6101008401527fcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0610120840152835180830190945291928291612f4791906101c08c0190600a908390839080828437600092019190915250869150613adc9050565b909250905063ffffffff8116612f6360608b0160408c01614891565b63ffffffff1614612f7357600080fd5b81896020013514612f8357600080fd5b6000612f9560608b0160408c01614891565b612f9f9086615235565b63ffffffff1667ffffffffffffffff811115612fbd57612fbd6142c8565b604051908082528060200260200182016040528015612fe6578160200160208202803683370190505b50905060005b612ffc60608c0160408d01614891565b6130069087615235565b63ffffffff168163ffffffff16101561308a578061302a60608d0160408e01614891565b61303a60808e0160608f01614891565b6130449190614901565b61304e9190614901565b63ffffffff1640828263ffffffff168151811061306d5761306d614bab565b60209081029190910101528061308281614c1b565b915050612fec565b50600061309d60608c0160408d01614891565b6130a79087615235565b90506000805b63ffffffff8316156133ac578163ffffffff168d60400160208101906130d39190614891565b63ffffffff16901c600116905060005b60026130ef8386614901565b6130f99190615284565b63ffffffff168163ffffffff161015613281576000808363ffffffff166001036131b95763ffffffff831615613164578660016131378560026152a2565b6131419190615235565b63ffffffff168151811061315757613157614bab565b6020026020010151613186565b8f6101c0018563ffffffff16600a811061318057613180614bab565b60200201355b9150866131948460026152a2565b63ffffffff16815181106131aa576131aa614bab565b6020026020010151905061321f565b866131c58460026152a2565b63ffffffff16815181106131db576131db614bab565b60200260200101519150868360026131f391906152a2565b6131fe906001614901565b63ffffffff168151811061321457613214614bab565b602002602001015190505b8181604051602001613232929190615170565b60405160208183030381529060405280519060200120878463ffffffff168151811061326057613260614bab565b6020026020010181815250505050808061327990614c1b565b9150506130e3565b50600261328e8285614901565b61329891906152cc565b63ffffffff1660010361332b578c6080018263ffffffff16600a81106132c0576132c0614bab565b6020020135846132d1600186615235565b63ffffffff16815181106132e7576132e7614bab565b602002602001015114613326576040517f84cca32b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613382565b8c6080018263ffffffff16600a811061334657613346614bab565b602002013515613382576040517f84cca32b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61338d826001614901565b9150600261339b8285614901565b6133a59190615284565b92506130ad565b505050505050505b6101255460405160009173ffffffffffffffffffffffffffffffffffffffff16906133e290889088906148c5565b6000604051808303816000865af19150503d806000811461341f576040519150601f19603f3d011682016040523d82523d6000602084013e613424565b606091505b505090508061345f576040517fbd5dfcb400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000836020015184606001518560a0015160405160200161348293929190614b74565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201206000818152610126835283812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558951948a015160808b01519397509095610127959294613512949101614b74565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd23fa9dc5084a846732fb5ea34d0a34d4457b4236dbc1bce24f2cf686b2650b2846020015185606001518660a0015160405161358c939291906152ea565b60405180910390a17f24e8e7d5b38feee115a633792a47326753618b13f2021b4b0fe2e58e28d80e808460000151856040015186608001516040516135d3939291906152ea565b60405180910390a198975050505050505050565b80471015613621576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615349565b60008273ffffffffffffffffffffffffffffffffffffffff168260405161364790615359565b60006040518083038185875af1925050503d8060008114613684576040519150601f19603f3d011682016040523d82523d6000602084013e613689565b606091505b505090508061091b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906153be565b600054610100900460ff166124d4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615428565b600054610100900460ff16613746576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615428565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a89576137b081613c53565b6137bb836020613c72565b6040516020016137cc92919061547e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610a7691600401615532565b73ffffffffffffffffffffffffffffffffffffffff81163b613878576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a769061559d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6138e783613e85565b6000825111806138f45750805b1561091b576139038383613ed2565b50505050565b604080516101008082018352600080835260208301819052828401819052606083018190526080830181905260a0830181905260c0830181905260e0830152825190810190925290806139626101a061018086886155ad565b61396b916155dd565b81526020016139806101e06101c086886155ad565b613989916155dd565b608061399b6101c06101a0888a6155ad565b6139a4916155dd565b901b1781526020016139bc6102006101e086886155ad565b6139c5916155dd565b81526020016139da61024061022086886155ad565b6139e3916155dd565b60806139f5610220610200888a6155ad565b6139fe916155dd565b901b178152602001613a1661026061024086886155ad565b613a1f916155dd565b8152602001613a346102a061028086886155ad565b613a3d916155dd565b6080613a4f610280610260888a6155ad565b613a58916155dd565b901b178152602001613a706102e06102c086886155ad565b613a79916155dd565b6080613a8b6102c06102a0888a6155ad565b613a94916155dd565b901b178152602001613aac61032061030086886155ad565b613ab5916155dd565b6080613ac76103006102e0888a6155ad565b613ad0916155dd565b901b1790529392505050565b60008080805b600a8163ffffffff161015613c4a5781158015613b1c575060008663ffffffff8316600a8110613b1457613b14614bab565b602002015114155b15613b4557848163ffffffff16600a8110613b3957613b39614bab565b60200201519350600191505b8115613c385760008663ffffffff8316600a8110613b6557613b65614bab565b602002015114613bf057858163ffffffff16600a8110613b8757613b87614bab565b602002015184604051602001613b9e929190615170565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209350613be9600163ffffffff83161b84614901565b9250613c38565b83858263ffffffff16600a8110613c0957613c09614bab565b6020020151604051602001613c1f929190615170565b6040516020818303038152906040528051906020012093505b80613c4281614c1b565b915050613ae2565b50509250929050565b60606108f073ffffffffffffffffffffffffffffffffffffffff831660145b60606000613c81836002615626565b613c8c90600261563e565b67ffffffffffffffff811115613ca457613ca46142c8565b6040519080825280601f01601f191660200182016040528015613cce576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110613d0557613d05614bab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110613d6857613d68614bab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000613da4846002615626565b613daf90600161563e565b90505b6001811115613e4c577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110613df057613df0614bab565b1a60f81b828281518110613e0657613e06614bab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93613e4581615651565b9050613db2565b508315610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906156b8565b613e8e8161382a565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606073ffffffffffffffffffffffffffffffffffffffff83163b613f22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615722565b6000808473ffffffffffffffffffffffffffffffffffffffff1684604051613f4a9190615732565b600060405180830381855af49150503d8060008114613f85576040519150601f19603f3d011682016040523d82523d6000602084013e613f8a565b606091505b5091509150613fb2828260405180606001604052806027815260200161573f60279139613fbb565b95945050505050565b60608315613fca575081610e28565b610e288383815115613fdf5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a769190615532565b805b8114610be357600080fd5b80356108f081614013565b60006020828403121561404057614040600080fd5b60006129878484614020565b7fffffffff000000000000000000000000000000000000000000000000000000008116614015565b80356108f08161404c565b60006020828403121561409457614094600080fd5b60006129878484614074565b8015155b82525050565b602081016108f082846140a0565b806140a4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60038110610be357610be36140be565b80614107816140ed565b919050565b60006108f0826140fd565b6140a48161410c565b63ffffffff81166140a4565b600073ffffffffffffffffffffffffffffffffffffffff82166108f0565b6140a48161412c565b6080810161416182876140b8565b61416e6020830186614117565b61417b6040830185614120565b613fb2606083018461414a565b602081016108f082846140b8565b6140158161412c565b80356108f081614196565b600080604083850312156141c0576141c0600080fd5b60006141cc8585614020565b92505060206141dd8582860161419f565b9150509250929050565b60008083601f8401126141fc576141fc600080fd5b50813567ffffffffffffffff81111561421757614217600080fd5b60208301915083600182028301111561423257614232600080fd5b9250929050565b6000806000806060858703121561425257614252600080fd5b600061425e8787614020565b945050602061426f8782880161419f565b935050604085013567ffffffffffffffff81111561428f5761428f600080fd5b61429b878288016141e7565b95989497509550505050565b6000602082840312156142bc576142bc600080fd5b6000612987848461419f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff8211171561433b5761433b6142c8565b6040525050565b600061434d60405190565b905061410782826142f7565b600067ffffffffffffffff821115614373576143736142c8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011660200192915050565b82818337506000910152565b60006143c16143bc84614359565b614342565b9050828152602081018484840111156143dc576143dc600080fd5b6143e78482856143a2565b509392505050565b600082601f83011261440357614403600080fd5b81356129878482602086016143ae565b6000806040838503121561442957614429600080fd5b6000614435858561419f565b925050602083013567ffffffffffffffff81111561445557614455600080fd5b6141dd858286016143ef565b602081016108f0828461414a565b60008060006060848603121561448757614487600080fd5b60006144938686614020565b93505060206144a486828701614020565b92505060406144b586828701614020565b9150509250925092565b60008083601f8401126144d4576144d4600080fd5b50813567ffffffffffffffff8111156144ef576144ef600080fd5b6020830191508361012082028301111561423257614232600080fd5b60008083601f84011261452057614520600080fd5b50813567ffffffffffffffff81111561453b5761453b600080fd5b602083019150836101a082028301111561423257614232600080fd5b60008083601f84011261456c5761456c600080fd5b50813567ffffffffffffffff81111561458757614587600080fd5b6020830191508361016082028301111561423257614232600080fd5b600080600080600080600080600060c08a8c0312156145c4576145c4600080fd5b60006145d08c8c614020565b99505060206145e18c828d01614020565b98505060406145f28c828d01614020565b97505060608a013567ffffffffffffffff81111561461257614612600080fd5b61461e8c828d016144bf565b965096505060808a013567ffffffffffffffff81111561464057614640600080fd5b61464c8c828d0161450b565b945094505060a08a013567ffffffffffffffff81111561466e5761466e600080fd5b61467a8c828d01614557565b92509250509295985092959850929598565b63ffffffff8116614015565b80356108f08161468c565b600061030082840312156146b9576146b9600080fd5b50919050565b60008060008061034085870312156146d9576146d9600080fd5b60006146e58787614698565b94505060206146f6878288016146a3565b93505061032085013567ffffffffffffffff81111561428f5761428f600080fd5b602081016108f08284614120565b600080600080600080610380878903121561474257614742600080fd5b600061474e8989614020565b965050602061475f89828a0161419f565b955050604061477089828a01614698565b945050606061478189828a016146a3565b93505061036087013567ffffffffffffffff8111156147a2576147a2600080fd5b6147ae89828a016141e7565b92509250509295509295509295565b6000806000606084860312156147d5576147d5600080fd5b60006147e18686614020565b93505060206144a48682870161419f565b600080600080600080600060e0888a03121561481057614810600080fd5b600061481c8a8a61419f565b975050602061482d8a828b0161419f565b965050604061483e8a828b01614020565b955050606061484f8a828b01614020565b94505060806148608a828b01614698565b93505060a06148718a828b0161419f565b92505060c06148828a828b0161419f565b91505092959891949750929550565b6000602082840312156148a6576148a6600080fd5b60006129878484614698565b60006148bf8385846143a2565b50500190565b60006129878284866148b2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b63ffffffff9182169190811690828201908111156108f0576108f06148d2565b60006108f073ffffffffffffffffffffffffffffffffffffffff8316614945565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b60006108f082614921565b60006108f08261495e565b6140a481614969565b60a0810161498b82886140b8565b61499860208301876140b8565b6149a56040830186614120565b6149b26060830185614974565b6149bf60808301846140b8565b9695505050505050565b602f81526000602082017f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636581527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015291505b5060400190565b602080825281016108f0816149c9565b602c81526000602082017f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682081527f64656c656761746563616c6c000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614a36565b602c81526000602082017f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682081527f6163746976652070726f7879000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614aa0565b603881526000602082017f555550535570677261646561626c653a206d757374206e6f742062652063616c81527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060208201529150614a1f565b602080825281016108f081614b0a565b6000614b8082866140b8565b602082019150614b9082856140b8565b602082019150614ba082846140b8565b506020019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006108f08260e01b90565b6140a463ffffffff8216614bda565b6000614c0182856140b8565b602082019150614c118284614be6565b5060040192915050565b63ffffffff1660007fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000018201614c5257614c526148d2565b5060010190565b67ffffffffffffffff8116614015565b80356108f081614c59565b600060208284031215614c8957614c89600080fd5b60006129878484614c69565b6bffffffffffffffffffffffff8116614015565b80356108f081614c95565b600060208284031215614cc957614cc9600080fd5b60006129878484614ca9565b60006108f08260c01b90565b6140a467ffffffffffffffff8216614cd5565b60006108f08260a01b90565b6140a46bffffffffffffffffffffffff8216614cf4565b6000614d238287614ce1565b600882019150614d338286614d00565b600c82019150614d4382856140b8565b602082019150614d5382846140b8565b50602001949350505050565b60006108f08260601b90565b60006108f082614d5f565b6140a4614d828261412c565b614d6b565b6000614d938286614be6565b600482019150614da38285614d76565b601482019150614ba082846140b8565b6000614dbf8287614be6565b600482019150614dcf8286614d76565b601482019150614d4382856140b8565b60608101614ded82866140b8565b614dfa60208301856140b8565b6129876040830184614974565b60808101614e1582876140b8565b614e2260208301866140b8565b614e2f6040830185614120565b613fb26060830184614974565b602e81526000602082017f496e697469616c697a61626c653a20636f6e747261637420697320616c72656181527f647920696e697469616c697a656400000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614e3c565b602381526000602082017f4178696f6d563151756572793a204178696f6d2061646472657373206973207a81527f65726f000000000000000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614ea6565b602a81526000602082017f4178696f6d563151756572793a204d4d5220766572696669657220616464726581527f7373206973207a65726f0000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614f10565b602681526000602082017f4178696f6d563151756572793a2074696d656c6f636b2061646472657373206981527f73207a65726f000000000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614f7a565b602681526000602082017f4178696f6d563151756572793a20677561726469616e2061646472657373206981527f73207a65726f000000000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614fe4565b600060ff82166108f0565b6140a48161504e565b602081016108f08284615059565b80516108f081614013565b60006020828403121561509057615090600080fd5b60006129878484615070565b602e81526000602082017f45524331393637557067726164653a206e657720696d706c656d656e7461746981527f6f6e206973206e6f74205555505300000000000000000000000000000000000060208201529150614a1f565b602080825281016108f08161509c565b602981526000602082017f45524331393637557067726164653a20756e737570706f727465642070726f7881527f6961626c6555554944000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081615106565b600061517c82856140b8565b60208201915061518c82846140b8565b5060200192915050565b60006108f061494263ffffffff841681565b6140a481615196565b602081016108f082846151a8565b60006151cb82866140b8565b6020820191506151db82856140b8565b6020820191506151eb8284614be6565b506004019392505050565b82818337505050565b610a8961014083836151f6565b600061521882846151ff565b5061014001919050565b818103818111156108f0576108f06148d2565b63ffffffff9182169190811690828203908111156108f0576108f06148d2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b63ffffffff918216911660008261529d5761529d615255565b500490565b63ffffffff9182169190811690828202908116908181146152c5576152c56148d2565b5092915050565b63ffffffff91821691166000826152e5576152e5615255565b500690565b606081016152f882866140b8565b61530560208301856140b8565b61298760408301846140b8565b601d81526000602082017f416464726573733a20696e73756666696369656e742062616c616e6365000000815291505b5060200190565b602080825281016108f081615312565b60006108f082614942565b603a81526000602082017f416464726573733a20756e61626c6520746f2073656e642076616c75652c207281527f6563697069656e74206d6179206861766520726576657274656400000000000060208201529150614a1f565b602080825281016108f081615364565b602b81526000602082017f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206981527f6e697469616c697a696e6700000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f0816153ce565b60005b8381101561545357818101518382015260200161543b565b50506000910152565b6000615466825190565b615474818560208601615438565b9290920192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260170160006154b0828561545c565b7f206973206d697373696e6720726f6c652000000000000000000000000000000081526011019150612987828461545c565b60006154ec825190565b808452602084019350615503818560208601615438565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920192915050565b60208082528101610e2881846154e2565b602d81526000602082017f455243313936373a206e657720696d706c656d656e746174696f6e206973206e81527f6f74206120636f6e74726163740000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081615543565b600080858511156155c0576155c0600080fd5b838611156155d0576155d0600080fd5b5050820193919092039150565b80358282602082101561561e576156197fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff836020036008021b90565b831692505b505092915050565b8181028082158382048514176152c5576152c56148d2565b808201808211156108f0576108f06148d2565b600081615660576156606148d2565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60208082527f537472696e67733a20686578206c656e67746820696e73756666696369656e7491019081526000615342565b602080825281016108f081615686565b602681526000602082017f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f81527f6e7472616374000000000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f0816156c8565b6000610e28828461545c56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220dc9d0fde2a2764e88dd343b2e6abddf2883c27c7864c83986ba9599a312eac6f64736f6c63430008130033
Deployed Bytecode
0x6080604052600436106102855760003560e01c8063774a623411610153578063a217fddf116100cb578063d77de0791161007f578063df7e2e2d11610064578063df7e2e2d146107b2578063e741ad80146107c9578063f288a2e2146107fa57600080fd5b8063d77de0791461075e578063dc9a4ef61461077e57600080fd5b8063b691943f116100b0578063b691943f146106f0578063d35a584414610710578063d547741f1461073e57600080fd5b8063a217fddf146106c4578063b1d401cd146106d957600080fd5b8063898b8a1a1161012257806391d148541161010757806391d14854146106495780639755b1fc1461069c57806399464c89146106af57600080fd5b8063898b8a1a146106095780638b4acf281461062957600080fd5b8063774a62341461057e578063798da01a1461059e57806379ce0468146105be578063878bab8c146105e957600080fd5b80633659cfe6116102015780635eac0e23116101b557806366c5c4a01161019a57806366c5c4a0146105295780636ec59b3f1461053e57806375a09b091461055e57600080fd5b80635eac0e23146104d85780636439e9d41461050957600080fd5b8063528bad37116101e6578063528bad371461046857806352d1902d146104a3578063560aa8cd146104b857600080fd5b80633659cfe6146104355780634f1ef2861461045557600080fd5b8063248a9ca3116102585780632f2ff15d1161023d5780632f2ff15d146103e257806332c4cda21461040257806336568abe1461041557600080fd5b8063248a9ca31461037157806324ea54f4146103ae57600080fd5b806301f8fca41461028a57806301ffc9a7146102ac578063054f7d9c146102e257806321dfb600146102fc575b600080fd5b34801561029657600080fd5b506102aa6102a536600461402b565b61082e565b005b3480156102b857600080fd5b506102cc6102c736600461407f565b61089a565b6040516102d991906140aa565b60405180910390f35b3480156102ee57600080fd5b506097546102cc9060ff1681565b34801561030857600080fd5b5061036161031736600461402b565b61012b602052600090815260409020805460019091015460ff811690610100810463ffffffff169065010000000000900473ffffffffffffffffffffffffffffffffffffffff1684565b6040516102d99493929190614153565b34801561037d57600080fd5b506103a161038c36600461402b565b60009081526065602052604090206001015490565b6040516102d99190614188565b3480156103ba57600080fd5b506103a17f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a504181565b3480156103ee57600080fd5b506102aa6103fd3660046141aa565b6108f6565b6102aa610410366004614239565b610920565b34801561042157600080fd5b506102aa6104303660046141aa565b610a27565b34801561044157600080fd5b506102aa6104503660046142a7565b610a8d565b6102aa610463366004614413565b610be6565b34801561047457600080fd5b50610124546104969073ffffffffffffffffffffffffffffffffffffffff1681565b6040516102d99190614461565b3480156104af57600080fd5b506103a1610d2c565b3480156104c457600080fd5b506102cc6104d336600461446f565b610dc2565b3480156104e457600080fd5b506102cc6104f336600461402b565b6101266020526000908152604090205460ff1681565b34801561051557600080fd5b506102cc6105243660046145a3565b610e2f565b34801561053557600080fd5b506102aa611384565b34801561054a57600080fd5b506102aa6105593660046142a7565b611402565b34801561056a57600080fd5b506102aa6105793660046146bf565b61149d565b34801561058a57600080fd5b506102aa6105993660046142a7565b611578565b3480156105aa57600080fd5b506102aa6105b936600461402b565b611613565b3480156105ca57600080fd5b5061012a546105dc9063ffffffff1681565b6040516102d99190614717565b3480156105f557600080fd5b506102aa610604366004614725565b611673565b34801561061557600080fd5b506102cc61062436600461446f565b6119a5565b34801561063557600080fd5b506102aa61064436600461402b565b6119c1565b34801561065557600080fd5b506102cc6106643660046141aa565b600091825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6102aa6106aa3660046147bd565b611c4a565b3480156106bb57600080fd5b506102aa611d24565b3480156106d057600080fd5b506103a1600081565b3480156106e557600080fd5b506103a16101285481565b3480156106fc57600080fd5b506102aa61070b3660046147f2565b611da5565b34801561071c57600080fd5b50610125546104969073ffffffffffffffffffffffffffffffffffffffff1681565b34801561074a57600080fd5b506102aa6107593660046141aa565b612252565b34801561076a57600080fd5b506102aa610779366004614891565b612277565b34801561078a57600080fd5b506103a17f60044782a422109ac08a415e44260ad5d3bad63d96ebe1fac0363399642ee3f281565b3480156107be57600080fd5b506103a16101295481565b3480156107d557600080fd5b506102cc6107e436600461402b565b6101276020526000908152604090205460ff1681565b34801561080657600080fd5b506103a17ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0581565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561085881612302565b6101298290556040517f45ceffba6cdfd80ac24dded71e7dc1a0e3620f2a2a1433f2c38e0e68acef2a009061088e908490614188565b60405180910390a15050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fff7a5d530000000000000000000000000000000000000000000000000000000014806108f057506108f08261230c565b92915050565b60008281526065602052604090206001015461091181612302565b61091b83836123a3565b505050565b610928612497565b61012854341015610965576040517fde43553100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610129543411156109a2576040517f24fe119200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109ad8434856124d6565b600082826040516109bf9291906148c5565b60405190819003902061012a549091507f51bc40919d53d6a0750201d2087c589a09286b4e9f320919d04ad4545ced4abb9086903490610a059063ffffffff1643614901565b8785604051610a1895949392919061497d565b60405180910390a15050505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614a26565b60405180910390fd5b610a898282612679565b5050565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000034a62692915a242441b2135c9c5e115d38b14e96163003610afc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614a90565b7f00000000000000000000000034a62692915a242441b2135c9c5e115d38b14e9673ffffffffffffffffffffffffffffffffffffffff16610b717f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610bbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614afa565b610bc781612734565b60408051600080825260208201909252610be39183919061275e565b50565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000034a62692915a242441b2135c9c5e115d38b14e96163003610c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614a90565b7f00000000000000000000000034a62692915a242441b2135c9c5e115d38b14e9673ffffffffffffffffffffffffffffffffffffffff16610cca7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614afa565b610d2082612734565b610a898282600161275e565b60003073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000034a62692915a242441b2135c9c5e115d38b14e961614610d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614b64565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b60006101266000858585604051602001610dde93929190614b74565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181528151602092830120835290820192909252016000205460ff1690505b9392505050565b600061012660008b8b8b604051602001610e4b93929190614b74565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181528151602092830120835290820192909252016000205460ff16610e9e57506000611377565b60005b63ffffffff8116871115610fd557600088888363ffffffff16818110610ec957610ec9614bab565b905061012002016020013589898463ffffffff16818110610eec57610eec614bab565b610f03926020610120909202019081019150614891565b604051602001610f14929190614bf5565b604051602081830303815290604052805190602001209050610fb38c828b8b8663ffffffff16818110610f4957610f49614bab565b9050610120020160600160068060200260405190810160405280929190826006602002808284376000920191909152508e91508d905063ffffffff8816818110610f9557610f95614bab565b905061012002016040016020810190610fae9190614891565b6128b1565b610fc257600092505050611377565b5080610fcd81614c1b565b915050610ea1565b5060005b63ffffffff81168511156111e857600086868363ffffffff1681811061100157611001614bab565b6110189260206101a0909202019081019150614891565b87878463ffffffff1681811061103057611030614bab565b90506101a00201602001602081019061104991906142a7565b88888563ffffffff1681811061106157611061614bab565b90506101a00201604001602081019061107a9190614c74565b89898663ffffffff1681811061109257611092614bab565b90506101a0020160600160208101906110ab9190614cb4565b8a8a8763ffffffff168181106110c3576110c3614bab565b90506101a00201608001358b8b8863ffffffff168181106110e6576110e6614bab565b90506101a0020160a001356040516020016111049493929190614d17565b6040516020818303038152906040528051906020012060405160200161112c93929190614d87565b6040516020818303038152906040528051906020012090506111c68b8289898663ffffffff1681811061116157611161614bab565b90506101a0020160e00160068060200260405190810160405280929190826006602002808284376000920191909152508c91508b905063ffffffff88168181106111ad576111ad614bab565b90506101a0020160c0016020810190610fae9190614891565b6111d557600092505050611377565b50806111e081614c1b565b915050610fd9565b5060005b63ffffffff811683111561137157600084848363ffffffff1681811061121457611214614bab565b61122b926020610160909202019081019150614891565b85858463ffffffff1681811061124357611243614bab565b90506101600201602001602081019061125c91906142a7565b86868563ffffffff1681811061127457611274614bab565b905061016002016040013587878663ffffffff1681811061129757611297614bab565b90506101600201606001356040516020016112b59493929190614db3565b60405160208183030381529060405280519060200120905061134f8a8287878663ffffffff168181106112ea576112ea614bab565b9050610160020160a00160068060200260405190810160405280929190826006602002808284376000920191909152508a915089905063ffffffff881681811061133657611336614bab565b905061016002016080016020810190610fae9190614891565b61135e57600092505050611377565b508061136981614c1b565b9150506111ec565b50600190505b9998505050505050505050565b7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a50416113ae81612302565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556040517fe6fdbf73945dd61794a752b9181ea29f77170a7b1ffd37e0a7ff9d2c6f7258b990600090a150565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561142c81612302565b61012580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790556040517f5dcffe9bbb6912962f7ffcea27f330f6aba5de77d262086624d5be74b849fd109061088e908490614461565b600080527f16d6d09ad43c2e13327e8e85b0f16a19ef2e63b72c391bfd77d21c5d499021856020527fdf4fae2a9d03ddefae2c9e431bd1ae49d400972b66abd41187abff73623b3c4b5460ff1615801561152657503360009081527f16d6d09ad43c2e13327e8e85b0f16a19ef2e63b72c391bfd77d21c5d49902185602052604090205460ff16155b1561155d576040517f6692e47700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611565612497565b6115718484848461298f565b5050505050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f056115a281612302565b61012480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790556040517f4f58839d9075210378ad47340fc23fab81e060f9fb13f00151841b25bc23d4b79061088e908490614461565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f0561163d81612302565b6101288290556040517f65bd598c7e893131b1f10bd7e7db583b9af90196f90525922c85b1c2fcc298609061088e908490614188565b600080527f16d6d09ad43c2e13327e8e85b0f16a19ef2e63b72c391bfd77d21c5d499021856020527fdf4fae2a9d03ddefae2c9e431bd1ae49d400972b66abd41187abff73623b3c4b5460ff161580156116fc57503360009081527f16d6d09ad43c2e13327e8e85b0f16a19ef2e63b72c391bfd77d21c5d49902185602052604090205460ff16155b15611733576040517f6692e47700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61173b612497565b6001600087815261012b602052604090206001015460ff166002811115611764576117646140be565b1461179b576040517ff8c22cf100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006117a98585858561298f565b90508681146117e4576040517fc496ba3d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051608081018252600089815261012b60209081529281205482529181016002815260008a815261012b602081815260408084206001808201805463ffffffff610100820416868a015273ffffffffffffffffffffffffffffffffffffffff650100000000008204169490980193909352948f9052928252855183559085015194955085949193919290917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016908360028111156118a6576118a66140be565b021790555060408281015160019290920180546060909401517fffffffffffffff000000000000000000000000000000000000000000000000ff90941661010063ffffffff948516027fffffffffffffff0000000000000000000000000000000000000000ffffffffff16176501000000000073ffffffffffffffffffffffffffffffffffffffff9586160217905560008b815261012b602052205461194f928a16916135e716565b600088815261012b6020526040908190205490517f662c835a3bf2a9618618ac34dfe8d5a12be89da82c8423c97b00ba7c658ba68c91611993918b91908b90614ddf565b60405180910390a15050505050505050565b60006101276000858585604051602001610dde93929190614b74565b600081815261012b60209081526040808320815160808101909252805482526001810154919290919083019060ff166002811115611a0157611a016140be565b6002811115611a1257611a126140be565b8152600191820154610100810463ffffffff16602083015265010000000000900473ffffffffffffffffffffffffffffffffffffffff1660409091015290915081602001516002811115611a6857611a686140be565b14611a9f576040517f5f158cf700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806040015163ffffffff164311611ae2576040517f6d542c0d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051608081018252600080825260208083018281528385018390526060840183905286835261012b90915292902081518155915160018084018054939485949093927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911690836002811115611b5d57611b5d6140be565b0217905550604082015160019190910180546060938401517fffffffffffffff000000000000000000000000000000000000000000000000ff90911661010063ffffffff948516027fffffffffffffff0000000000000000000000000000000000000000ffffffffff16176501000000000073ffffffffffffffffffffffffffffffffffffffff9283160217909155845192850151611bff939116916135e716565b8151604080840151606085015191517f38c89cadb339d1bffb61715406f1b242b77f304ef7759730c0094c14c1017f7f93611c3d9388939192614e07565b60405180910390a1505050565b611c52612497565b61012854341015611c8f576040517fde43553100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61012954341115611ccc576040517f24fe119200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611cd78334846124d6565b61012a547fea3db7d163ac581226b9faa5f9e5e5efe400bfb1b8a365db5c3e7cbff6d2984d9084903490611d119063ffffffff1643614901565b8585604051611c3d95949392919061497d565b7f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041611d4e81612302565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556040517f61340a1b154d5d21d259a74bf95379201799b9d12cc6509bb46cb56dc281df5590600090a150565b600054610100900460ff1615808015611dc55750600054600160ff909116105b80611ddf5750303b158015611ddf575060005460ff166001145b611e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614e96565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015611e7357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b611e7b6136c4565b611e83613705565b73ffffffffffffffffffffffffffffffffffffffff8816611ed0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614f00565b73ffffffffffffffffffffffffffffffffffffffff8716611f1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614f6a565b73ffffffffffffffffffffffffffffffffffffffff8316611f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690614fd4565b73ffffffffffffffffffffffffffffffffffffffff8216611fb7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a769061503e565b610124805473ffffffffffffffffffffffffffffffffffffffff808b167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179092556101258054928a16929091169190911790556040517f4f58839d9075210378ad47340fc23fab81e060f9fb13f00151841b25bc23d4b79061203e908a90614461565b60405180910390a17f5dcffe9bbb6912962f7ffcea27f330f6aba5de77d262086624d5be74b849fd10876040516120759190614461565b60405180910390a161012886905561012985905561012a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff86161790556040517f65bd598c7e893131b1f10bd7e7db583b9af90196f90525922c85b1c2fcc29860906120ea908890614188565b60405180910390a17f45ceffba6cdfd80ac24dded71e7dc1a0e3620f2a2a1433f2c38e0e68acef2a00856040516121219190614188565b60405180910390a17f266d22101c27a330937ff06442e5289e92a84a449d22bb001c03789f7774b628846040516121589190614717565b60405180910390a161218a7f60044782a422109ac08a415e44260ad5d3bad63d96ebe1fac0363399642ee3f2336123a3565b6121956000846123a3565b6121bf7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05846123a3565b6121e97f55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041836123a3565b801561224857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690556040517f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989061199390600190615062565b5050505050505050565b60008281526065602052604090206001015461226d81612302565b61091b8383612679565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f056122a181612302565b61012a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff84161790556040517f266d22101c27a330937ff06442e5289e92a84a449d22bb001c03789f7774b6289061088e908490614717565b610be38133613770565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806108f057507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146108f0565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a8957600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556124393390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60975460ff16156124d4576040517f379dfc6300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b600083815261012b602052604081206001015460ff1660028111156124fd576124fd6140be565b14612534576040517f96e41fe900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516080810182528381526001602082015261012a546000928201906125629063ffffffff1643614901565b63ffffffff16815273ffffffffffffffffffffffffffffffffffffffff8416602091820152600086815261012b825260409020825181559082015160018083018054949550859490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116908360028111156125e2576125e26140be565b021790555060408201516001909101805460609093015173ffffffffffffffffffffffffffffffffffffffff1665010000000000027fffffffffffffff0000000000000000000000000000000000000000ffffffffff63ffffffff90931661010002929092167fffffffffffffff000000000000000000000000000000000000000000000000ff9093169290921717905550505050565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610a8957600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b7ff66846415d2bf9eabda9e84793ff9c0ea96d87f50fc41e66aa16469c6a442f05610a8981612302565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156127915761091b8361382a565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612816575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526128139181019061507b565b60015b61284c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906150f6565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146128a5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615160565b5061091b8383836138de565b600083815b60068163ffffffff16101561298157600163ffffffff8581169083161c166000036129275781858263ffffffff16600681106128f4576128f4614bab565b602002015160405160200161290a929190615170565b60405160208183030381529060405280519060200120915061296f565b848163ffffffff166006811061293f5761293f614bab565b602002015182604051602001612956929190615170565b6040516020818303038152906040528051906020012091505b8061297981614c1b565b9150506128b6565b50851490505b949350505050565b6000612999612497565b600863ffffffff8616106129ac57600080fd5b60006129b88484613909565b60c0810151610124546040517f074144d6000000000000000000000000000000000000000000000000000000008152929350909173ffffffffffffffffffffffffffffffffffffffff9091169063074144d690612a19908a906004016151b1565b602060405180830381865afa158015612a36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5a919061507b565b14612a91576040517fd9fcd6a100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101245460009073ffffffffffffffffffffffffffffffffffffffff1663c6ca4753612ac36080890160608a01614891565b6040518263ffffffff1660e01b8152600401612adf9190614717565b602060405180830381865afa158015612afc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b20919061507b565b905085356020870135612b396060890160408a01614891565b604051602001612b4b939291906151bf565b604051602081830303815290604052805190602001208114612b6c57600080fd5b5084608001604051602001612b81919061520c565b604051602081830303815290604052805190602001208160e0015114612ba657600080fd5b6000805b600a8163ffffffff161015612c085760006080880163ffffffff8316600a8110612bd657612bd6614bab565b602002013514612bf657612bf3600163ffffffff83161b83614901565b91505b80612c0081614c1b565b915050612baa565b5060008163ffffffff16118015612c3a5750612c2a6060870160408801614891565b63ffffffff168163ffffffff1611155b15612cb9576000612ca087608001600a806020026040519081016040528092919082600a60200280828437600092019190915250506040805161014081810190925291506101c08b0190600a908390839080828437600092019190915250613adc915050565b50905080876020013514612cb357600080fd5b506133b4565b612cc96060870160408801614891565b63ffffffff168163ffffffff1611156133b4574381612cee6080890160608a01614891565b612cf89190614901565b63ffffffff161115612d36576040517ff5b1753900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d4261010043615222565b612d526060880160408901614891565b612d626080890160608a01614891565b612d6c9190614901565b63ffffffff161015612daa576040517f7df2555400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051610140808201835260008083527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb560208401527fb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30838501527f21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba8560608401527fe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a1934460808401527f0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d60a08401527f887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a196860c08401527fffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f8360e08401527f9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af6101008401527fcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0610120840152835180830190945291928291612f4791906101c08c0190600a908390839080828437600092019190915250869150613adc9050565b909250905063ffffffff8116612f6360608b0160408c01614891565b63ffffffff1614612f7357600080fd5b81896020013514612f8357600080fd5b6000612f9560608b0160408c01614891565b612f9f9086615235565b63ffffffff1667ffffffffffffffff811115612fbd57612fbd6142c8565b604051908082528060200260200182016040528015612fe6578160200160208202803683370190505b50905060005b612ffc60608c0160408d01614891565b6130069087615235565b63ffffffff168163ffffffff16101561308a578061302a60608d0160408e01614891565b61303a60808e0160608f01614891565b6130449190614901565b61304e9190614901565b63ffffffff1640828263ffffffff168151811061306d5761306d614bab565b60209081029190910101528061308281614c1b565b915050612fec565b50600061309d60608c0160408d01614891565b6130a79087615235565b90506000805b63ffffffff8316156133ac578163ffffffff168d60400160208101906130d39190614891565b63ffffffff16901c600116905060005b60026130ef8386614901565b6130f99190615284565b63ffffffff168163ffffffff161015613281576000808363ffffffff166001036131b95763ffffffff831615613164578660016131378560026152a2565b6131419190615235565b63ffffffff168151811061315757613157614bab565b6020026020010151613186565b8f6101c0018563ffffffff16600a811061318057613180614bab565b60200201355b9150866131948460026152a2565b63ffffffff16815181106131aa576131aa614bab565b6020026020010151905061321f565b866131c58460026152a2565b63ffffffff16815181106131db576131db614bab565b60200260200101519150868360026131f391906152a2565b6131fe906001614901565b63ffffffff168151811061321457613214614bab565b602002602001015190505b8181604051602001613232929190615170565b60405160208183030381529060405280519060200120878463ffffffff168151811061326057613260614bab565b6020026020010181815250505050808061327990614c1b565b9150506130e3565b50600261328e8285614901565b61329891906152cc565b63ffffffff1660010361332b578c6080018263ffffffff16600a81106132c0576132c0614bab565b6020020135846132d1600186615235565b63ffffffff16815181106132e7576132e7614bab565b602002602001015114613326576040517f84cca32b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b613382565b8c6080018263ffffffff16600a811061334657613346614bab565b602002013515613382576040517f84cca32b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61338d826001614901565b9150600261339b8285614901565b6133a59190615284565b92506130ad565b505050505050505b6101255460405160009173ffffffffffffffffffffffffffffffffffffffff16906133e290889088906148c5565b6000604051808303816000865af19150503d806000811461341f576040519150601f19603f3d011682016040523d82523d6000602084013e613424565b606091505b505090508061345f576040517fbd5dfcb400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000836020015184606001518560a0015160405160200161348293929190614b74565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201206000818152610126835283812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558951948a015160808b01519397509095610127959294613512949101614b74565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd23fa9dc5084a846732fb5ea34d0a34d4457b4236dbc1bce24f2cf686b2650b2846020015185606001518660a0015160405161358c939291906152ea565b60405180910390a17f24e8e7d5b38feee115a633792a47326753618b13f2021b4b0fe2e58e28d80e808460000151856040015186608001516040516135d3939291906152ea565b60405180910390a198975050505050505050565b80471015613621576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615349565b60008273ffffffffffffffffffffffffffffffffffffffff168260405161364790615359565b60006040518083038185875af1925050503d8060008114613684576040519150601f19603f3d011682016040523d82523d6000602084013e613689565b606091505b505090508061091b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906153be565b600054610100900460ff166124d4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615428565b600054610100900460ff16613746576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615428565b609780547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a89576137b081613c53565b6137bb836020613c72565b6040516020016137cc92919061547e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a0000000000000000000000000000000000000000000000000000000008252610a7691600401615532565b73ffffffffffffffffffffffffffffffffffffffff81163b613878576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a769061559d565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6138e783613e85565b6000825111806138f45750805b1561091b576139038383613ed2565b50505050565b604080516101008082018352600080835260208301819052828401819052606083018190526080830181905260a0830181905260c0830181905260e0830152825190810190925290806139626101a061018086886155ad565b61396b916155dd565b81526020016139806101e06101c086886155ad565b613989916155dd565b608061399b6101c06101a0888a6155ad565b6139a4916155dd565b901b1781526020016139bc6102006101e086886155ad565b6139c5916155dd565b81526020016139da61024061022086886155ad565b6139e3916155dd565b60806139f5610220610200888a6155ad565b6139fe916155dd565b901b178152602001613a1661026061024086886155ad565b613a1f916155dd565b8152602001613a346102a061028086886155ad565b613a3d916155dd565b6080613a4f610280610260888a6155ad565b613a58916155dd565b901b178152602001613a706102e06102c086886155ad565b613a79916155dd565b6080613a8b6102c06102a0888a6155ad565b613a94916155dd565b901b178152602001613aac61032061030086886155ad565b613ab5916155dd565b6080613ac76103006102e0888a6155ad565b613ad0916155dd565b901b1790529392505050565b60008080805b600a8163ffffffff161015613c4a5781158015613b1c575060008663ffffffff8316600a8110613b1457613b14614bab565b602002015114155b15613b4557848163ffffffff16600a8110613b3957613b39614bab565b60200201519350600191505b8115613c385760008663ffffffff8316600a8110613b6557613b65614bab565b602002015114613bf057858163ffffffff16600a8110613b8757613b87614bab565b602002015184604051602001613b9e929190615170565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905280516020909101209350613be9600163ffffffff83161b84614901565b9250613c38565b83858263ffffffff16600a8110613c0957613c09614bab565b6020020151604051602001613c1f929190615170565b6040516020818303038152906040528051906020012093505b80613c4281614c1b565b915050613ae2565b50509250929050565b60606108f073ffffffffffffffffffffffffffffffffffffffff831660145b60606000613c81836002615626565b613c8c90600261563e565b67ffffffffffffffff811115613ca457613ca46142c8565b6040519080825280601f01601f191660200182016040528015613cce576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110613d0557613d05614bab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110613d6857613d68614bab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000613da4846002615626565b613daf90600161563e565b90505b6001811115613e4c577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110613df057613df0614bab565b1a60f81b828281518110613e0657613e06614bab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93613e4581615651565b9050613db2565b508315610e28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906156b8565b613e8e8161382a565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606073ffffffffffffffffffffffffffffffffffffffff83163b613f22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690615722565b6000808473ffffffffffffffffffffffffffffffffffffffff1684604051613f4a9190615732565b600060405180830381855af49150503d8060008114613f85576040519150601f19603f3d011682016040523d82523d6000602084013e613f8a565b606091505b5091509150613fb2828260405180606001604052806027815260200161573f60279139613fbb565b95945050505050565b60608315613fca575081610e28565b610e288383815115613fdf5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a769190615532565b805b8114610be357600080fd5b80356108f081614013565b60006020828403121561404057614040600080fd5b60006129878484614020565b7fffffffff000000000000000000000000000000000000000000000000000000008116614015565b80356108f08161404c565b60006020828403121561409457614094600080fd5b60006129878484614074565b8015155b82525050565b602081016108f082846140a0565b806140a4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60038110610be357610be36140be565b80614107816140ed565b919050565b60006108f0826140fd565b6140a48161410c565b63ffffffff81166140a4565b600073ffffffffffffffffffffffffffffffffffffffff82166108f0565b6140a48161412c565b6080810161416182876140b8565b61416e6020830186614117565b61417b6040830185614120565b613fb2606083018461414a565b602081016108f082846140b8565b6140158161412c565b80356108f081614196565b600080604083850312156141c0576141c0600080fd5b60006141cc8585614020565b92505060206141dd8582860161419f565b9150509250929050565b60008083601f8401126141fc576141fc600080fd5b50813567ffffffffffffffff81111561421757614217600080fd5b60208301915083600182028301111561423257614232600080fd5b9250929050565b6000806000806060858703121561425257614252600080fd5b600061425e8787614020565b945050602061426f8782880161419f565b935050604085013567ffffffffffffffff81111561428f5761428f600080fd5b61429b878288016141e7565b95989497509550505050565b6000602082840312156142bc576142bc600080fd5b6000612987848461419f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff8211171561433b5761433b6142c8565b6040525050565b600061434d60405190565b905061410782826142f7565b600067ffffffffffffffff821115614373576143736142c8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011660200192915050565b82818337506000910152565b60006143c16143bc84614359565b614342565b9050828152602081018484840111156143dc576143dc600080fd5b6143e78482856143a2565b509392505050565b600082601f83011261440357614403600080fd5b81356129878482602086016143ae565b6000806040838503121561442957614429600080fd5b6000614435858561419f565b925050602083013567ffffffffffffffff81111561445557614455600080fd5b6141dd858286016143ef565b602081016108f0828461414a565b60008060006060848603121561448757614487600080fd5b60006144938686614020565b93505060206144a486828701614020565b92505060406144b586828701614020565b9150509250925092565b60008083601f8401126144d4576144d4600080fd5b50813567ffffffffffffffff8111156144ef576144ef600080fd5b6020830191508361012082028301111561423257614232600080fd5b60008083601f84011261452057614520600080fd5b50813567ffffffffffffffff81111561453b5761453b600080fd5b602083019150836101a082028301111561423257614232600080fd5b60008083601f84011261456c5761456c600080fd5b50813567ffffffffffffffff81111561458757614587600080fd5b6020830191508361016082028301111561423257614232600080fd5b600080600080600080600080600060c08a8c0312156145c4576145c4600080fd5b60006145d08c8c614020565b99505060206145e18c828d01614020565b98505060406145f28c828d01614020565b97505060608a013567ffffffffffffffff81111561461257614612600080fd5b61461e8c828d016144bf565b965096505060808a013567ffffffffffffffff81111561464057614640600080fd5b61464c8c828d0161450b565b945094505060a08a013567ffffffffffffffff81111561466e5761466e600080fd5b61467a8c828d01614557565b92509250509295985092959850929598565b63ffffffff8116614015565b80356108f08161468c565b600061030082840312156146b9576146b9600080fd5b50919050565b60008060008061034085870312156146d9576146d9600080fd5b60006146e58787614698565b94505060206146f6878288016146a3565b93505061032085013567ffffffffffffffff81111561428f5761428f600080fd5b602081016108f08284614120565b600080600080600080610380878903121561474257614742600080fd5b600061474e8989614020565b965050602061475f89828a0161419f565b955050604061477089828a01614698565b945050606061478189828a016146a3565b93505061036087013567ffffffffffffffff8111156147a2576147a2600080fd5b6147ae89828a016141e7565b92509250509295509295509295565b6000806000606084860312156147d5576147d5600080fd5b60006147e18686614020565b93505060206144a48682870161419f565b600080600080600080600060e0888a03121561481057614810600080fd5b600061481c8a8a61419f565b975050602061482d8a828b0161419f565b965050604061483e8a828b01614020565b955050606061484f8a828b01614020565b94505060806148608a828b01614698565b93505060a06148718a828b0161419f565b92505060c06148828a828b0161419f565b91505092959891949750929550565b6000602082840312156148a6576148a6600080fd5b60006129878484614698565b60006148bf8385846143a2565b50500190565b60006129878284866148b2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b63ffffffff9182169190811690828201908111156108f0576108f06148d2565b60006108f073ffffffffffffffffffffffffffffffffffffffff8316614945565b90565b73ffffffffffffffffffffffffffffffffffffffff1690565b60006108f082614921565b60006108f08261495e565b6140a481614969565b60a0810161498b82886140b8565b61499860208301876140b8565b6149a56040830186614120565b6149b26060830185614974565b6149bf60808301846140b8565b9695505050505050565b602f81526000602082017f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636581527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015291505b5060400190565b602080825281016108f0816149c9565b602c81526000602082017f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682081527f64656c656761746563616c6c000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614a36565b602c81526000602082017f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682081527f6163746976652070726f7879000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614aa0565b603881526000602082017f555550535570677261646561626c653a206d757374206e6f742062652063616c81527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060208201529150614a1f565b602080825281016108f081614b0a565b6000614b8082866140b8565b602082019150614b9082856140b8565b602082019150614ba082846140b8565b506020019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006108f08260e01b90565b6140a463ffffffff8216614bda565b6000614c0182856140b8565b602082019150614c118284614be6565b5060040192915050565b63ffffffff1660007fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000018201614c5257614c526148d2565b5060010190565b67ffffffffffffffff8116614015565b80356108f081614c59565b600060208284031215614c8957614c89600080fd5b60006129878484614c69565b6bffffffffffffffffffffffff8116614015565b80356108f081614c95565b600060208284031215614cc957614cc9600080fd5b60006129878484614ca9565b60006108f08260c01b90565b6140a467ffffffffffffffff8216614cd5565b60006108f08260a01b90565b6140a46bffffffffffffffffffffffff8216614cf4565b6000614d238287614ce1565b600882019150614d338286614d00565b600c82019150614d4382856140b8565b602082019150614d5382846140b8565b50602001949350505050565b60006108f08260601b90565b60006108f082614d5f565b6140a4614d828261412c565b614d6b565b6000614d938286614be6565b600482019150614da38285614d76565b601482019150614ba082846140b8565b6000614dbf8287614be6565b600482019150614dcf8286614d76565b601482019150614d4382856140b8565b60608101614ded82866140b8565b614dfa60208301856140b8565b6129876040830184614974565b60808101614e1582876140b8565b614e2260208301866140b8565b614e2f6040830185614120565b613fb26060830184614974565b602e81526000602082017f496e697469616c697a61626c653a20636f6e747261637420697320616c72656181527f647920696e697469616c697a656400000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614e3c565b602381526000602082017f4178696f6d563151756572793a204178696f6d2061646472657373206973207a81527f65726f000000000000000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614ea6565b602a81526000602082017f4178696f6d563151756572793a204d4d5220766572696669657220616464726581527f7373206973207a65726f0000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614f10565b602681526000602082017f4178696f6d563151756572793a2074696d656c6f636b2061646472657373206981527f73207a65726f000000000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614f7a565b602681526000602082017f4178696f6d563151756572793a20677561726469616e2061646472657373206981527f73207a65726f000000000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081614fe4565b600060ff82166108f0565b6140a48161504e565b602081016108f08284615059565b80516108f081614013565b60006020828403121561509057615090600080fd5b60006129878484615070565b602e81526000602082017f45524331393637557067726164653a206e657720696d706c656d656e7461746981527f6f6e206973206e6f74205555505300000000000000000000000000000000000060208201529150614a1f565b602080825281016108f08161509c565b602981526000602082017f45524331393637557067726164653a20756e737570706f727465642070726f7881527f6961626c6555554944000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081615106565b600061517c82856140b8565b60208201915061518c82846140b8565b5060200192915050565b60006108f061494263ffffffff841681565b6140a481615196565b602081016108f082846151a8565b60006151cb82866140b8565b6020820191506151db82856140b8565b6020820191506151eb8284614be6565b506004019392505050565b82818337505050565b610a8961014083836151f6565b600061521882846151ff565b5061014001919050565b818103818111156108f0576108f06148d2565b63ffffffff9182169190811690828203908111156108f0576108f06148d2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b63ffffffff918216911660008261529d5761529d615255565b500490565b63ffffffff9182169190811690828202908116908181146152c5576152c56148d2565b5092915050565b63ffffffff91821691166000826152e5576152e5615255565b500690565b606081016152f882866140b8565b61530560208301856140b8565b61298760408301846140b8565b601d81526000602082017f416464726573733a20696e73756666696369656e742062616c616e6365000000815291505b5060200190565b602080825281016108f081615312565b60006108f082614942565b603a81526000602082017f416464726573733a20756e61626c6520746f2073656e642076616c75652c207281527f6563697069656e74206d6179206861766520726576657274656400000000000060208201529150614a1f565b602080825281016108f081615364565b602b81526000602082017f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206981527f6e697469616c697a696e6700000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f0816153ce565b60005b8381101561545357818101518382015260200161543b565b50506000910152565b6000615466825190565b615474818560208601615438565b9290920192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260170160006154b0828561545c565b7f206973206d697373696e6720726f6c652000000000000000000000000000000081526011019150612987828461545c565b60006154ec825190565b808452602084019350615503818560208601615438565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920192915050565b60208082528101610e2881846154e2565b602d81526000602082017f455243313936373a206e657720696d706c656d656e746174696f6e206973206e81527f6f74206120636f6e74726163740000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f081615543565b600080858511156155c0576155c0600080fd5b838611156155d0576155d0600080fd5b5050820193919092039150565b80358282602082101561561e576156197fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff836020036008021b90565b831692505b505092915050565b8181028082158382048514176152c5576152c56148d2565b808201808211156108f0576108f06148d2565b600081615660576156606148d2565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60208082527f537472696e67733a20686578206c656e67746820696e73756666696369656e7491019081526000615342565b602080825281016108f081615686565b602681526000602082017f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f81527f6e7472616374000000000000000000000000000000000000000000000000000060208201529150614a1f565b602080825281016108f0816156c8565b6000610e28828461545c56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220dc9d0fde2a2764e88dd343b2e6abddf2883c27c7864c83986ba9599a312eac6f64736f6c63430008130033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.