Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 903 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Execute | 7225081 | 3 days ago | IN | 0 ETH | 0.00073701 | ||||
Execute | 7225079 | 3 days ago | IN | 0 ETH | 0.00078369 | ||||
Execute | 7225077 | 3 days ago | IN | 0 ETH | 0.00039888 | ||||
Execute | 7225075 | 3 days ago | IN | 0 ETH | 0.0003604 | ||||
Execute | 7225073 | 3 days ago | IN | 0 ETH | 0.00036409 | ||||
Execute | 7225070 | 3 days ago | IN | 0 ETH | 0.00035809 | ||||
Execute | 7225067 | 3 days ago | IN | 0 ETH | 0.00039599 | ||||
Execute | 7225065 | 3 days ago | IN | 0 ETH | 0.0004092 | ||||
Execute | 7225063 | 3 days ago | IN | 0 ETH | 0.00037694 | ||||
Execute | 7225060 | 3 days ago | IN | 0 ETH | 0.00034776 | ||||
Execute | 7225057 | 3 days ago | IN | 0 ETH | 0.00035334 | ||||
Set Root | 7225025 | 3 days ago | IN | 0 ETH | 0.00024371 | ||||
Execute | 7210823 | 5 days ago | IN | 0 ETH | 0.00034456 | ||||
Execute | 7210819 | 5 days ago | IN | 0 ETH | 0.00039033 | ||||
Execute | 7210817 | 5 days ago | IN | 0 ETH | 0.00021007 | ||||
Execute | 7210815 | 5 days ago | IN | 0 ETH | 0.0001718 | ||||
Execute | 7210808 | 5 days ago | IN | 0 ETH | 0.00019261 | ||||
Execute | 7210806 | 5 days ago | IN | 0 ETH | 0.00019678 | ||||
Execute | 7210804 | 5 days ago | IN | 0 ETH | 0.00020216 | ||||
Execute | 7210802 | 5 days ago | IN | 0 ETH | 0.00016863 | ||||
Execute | 7210798 | 5 days ago | IN | 0 ETH | 0.00017305 | ||||
Execute | 7210796 | 5 days ago | IN | 0 ETH | 0.00017059 | ||||
Set Root | 7210793 | 5 days ago | IN | 0 ETH | 0.0002023 | ||||
Execute | 7203209 | 7 days ago | IN | 0 ETH | 0.00032619 | ||||
Execute | 7203206 | 7 days ago | IN | 0 ETH | 0.00068082 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x14809551...D30Cd2701 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
ManyChainMultiSig
Compiler Version
v0.8.19+commit.7dd6d404
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity =0.8.19; import "openzeppelin-contracts/utils/cryptography/MerkleProof.sol"; import "openzeppelin-contracts/access/Ownable2Step.sol"; import "openzeppelin-contracts/utils/cryptography/ECDSA.sol"; // Should be used as the first 32 bytes of the pre-image of the leaf that holds a // op. This value is for domain separation of the different values stored in the // Merkle tree. bytes32 constant MANY_CHAIN_MULTI_SIG_DOMAIN_SEPARATOR_OP = keccak256("MANY_CHAIN_MULTI_SIG_DOMAIN_SEPARATOR_OP"); // Should be used as the first 32 bytes of the pre-image of the leaf that holds the // root metadata. This value is for domain separation of the different values stored in the // Merkle tree. bytes32 constant MANY_CHAIN_MULTI_SIG_DOMAIN_SEPARATOR_METADATA = keccak256("MANY_CHAIN_MULTI_SIG_DOMAIN_SEPARATOR_METADATA"); /// @notice This is a multi-sig contract that supports signing many transactions (called "ops" in /// the context of this contract to prevent confusion with transactions on the underlying chain) /// targeting many chains with a single set of signatures. Authorized ops along with some metadata /// are stored in a Merkle tree, which is generated offchain. Each op has an associated chain id, /// ManyChainMultiSig contract address and nonce. The nonce enables us to enforce the /// (per-ManyChainMultiSig contract instance) ordering of ops. /// /// At any time, this contract stores at most one Merkle root. In the typical case, all ops /// in the Merkle tree are expected to be executed before another root is set. Since the Merkle root /// itself reveals ~ no information about the tree's contents, we take two measures to improve /// transparency. First, we attach an expiration time to each Merkle root after which it cannot /// be used any more. Second, we embed metadata in the tree itself that has to be proven/revealed /// to the contract when a new root is set; the metadata contains the range of nonces (and thus /// number of ops) in the tree intended for the ManyChainMultiSig contract instance on which the /// root is being set. /// /// Once a root is registered, *anyone* is allowed to furnish proofs of op inclusion in the Merkle /// tree and execute the corresponding op. The contract enforces that ops are executed in the /// correct order and with the correct arguments. A notable exception to this is the gas limit of /// the call, which can be freely determined by the executor. We expect (transitive) callees to /// implement standard behavior of simply reverting if insufficient gas is provided. In particular, /// this means callees should not have non-reverting gas-dependent branches. /// /// Note: In the typical case, we expect the time from a root being set to all of the ops /// therein having been executed to be on the order of a couple of minutes. contract ManyChainMultiSig is Ownable2Step { receive() external payable {} uint8 public constant NUM_GROUPS = 32; uint8 public constant MAX_NUM_SIGNERS = 200; struct Signer { address addr; uint8 index; // index of signer in s_config.signers uint8 group; // 0 <= group < NUM_GROUPS. Each signer can only be in one group. } // s_signers is used to easily validate the existence of the signer by its address. We still // have signers stored in s_config in order to easily deactivate them when a new config is set. mapping(address => Signer) s_signers; // Signing groups are arranged in a tree. Each group is an interior node and has its own quorum. // Signers are the leaves of the tree. A signer/leaf node is successful iff it furnishes a valid // signature. A group/interior node is successful iff a quorum of its children are successful. // setRoot succeeds only if the root group is successful. // Here is an example: // // ┌──────┐ // ┌─►│2-of-3│◄───────┐ // │ └──────┘ │ // │ ▲ │ // │ │ │ // ┌──┴───┐ ┌──┴───┐ ┌───┴────┐ // ┌──►│1-of-2│ │2-of-2│ │signer A│ // │ └──────┘ └──────┘ └────────┘ // │ ▲ ▲ ▲ // │ │ │ │ ┌──────┐ // │ │ │ └─────┤1-of-2│◄─┐ // │ │ │ └──────┘ │ // ┌───────┴┐ ┌────┴───┐ ┌┴───────┐ ▲ │ // │signer B│ │signer C│ │signer D│ │ │ // └────────┘ └────────┘ └────────┘ │ │ // │ │ // ┌──────┴─┐ ┌────┴───┐ // │signer E│ │signer F│ // └────────┘ └────────┘ // // - If signers [A, B] sign, they can set a root. // - If signers [B, D, E] sign, they can set a root. // - If signers [B, D, E, F] sign, they can set a root. (Either E's or F's signature was // superfluous.) // - If signers [B, C, D] sign, they cannot set a root, because the 2-of-2 group on the second // level isn't successful and therefore the root group isn't successful either. // // To map this tree to a Config, we: // - create an entry in signers for each signer (sorted by address in ascending order) // - assign the root group to index 0 and have it be its own parent // - assign an index to each non-root group, such that each group's parent has a lower index // than the group itself // For example, we could transform the above tree structure into: // groupQuorums = [2, 1, 2, 1] + [0, 0, ...] (rightpad with 0s to NUM_GROUPS) // groupParents = [0, 0, 0, 2] + [0, 0, ...] (rightpad with 0s to NUM_GROUPS) // and assuming that address(A) < address(C) < address(E) < address(F) < address(D) < address(B) // signers = [ // {addr: address(A), index: 0, group: 0}, {addr: address(C), index: 1, group: 1}, // {addr: address(E), index: 2, group: 3}, {addr: address(F), index: 3, group: 3}, // {addr: address(D), index: 4, group: 2}, {addr: address(B), index: 5, group: 1}, // ] struct Config { Signer[] signers; // groupQuorums[i] stores the quorum for the i-th signer group. Any group with // groupQuorums[i] = 0 is considered disabled. The i-th group is successful if // it is enabled and at least groupQuorums[i] of its children are successful. uint8[NUM_GROUPS] groupQuorums; // groupParents[i] stores the parent group of the i-th signer group. We ensure that the // groups form a tree structure (where the root/0-th signer group points to itself as // parent) by enforcing // - (i != 0) implies (groupParents[i] < i) // - groupParents[0] == 0 uint8[NUM_GROUPS] groupParents; } Config s_config; // Remember signedHashes that this contract has seen. Each signedHash can only be set once. mapping(bytes32 => bool) s_seenSignedHashes; // MerkleRoots are a bit tricky since they reveal almost no information about the contents of // the tree they authenticate. To mitigate this, we enforce that this contract can only execute // ops from a single root at any given point in time. We further associate an expiry // with each root to ensure that messages are executed in a timely manner. setRoot and various // execute calls are expected to happen in quick succession. We put the expiring root and // opCount in same struct in order to reduce gas costs of reading and writing. struct ExpiringRootAndOpCount { bytes32 root; // We prefer using block.timestamp instead of block.number, as a single // root may target many chains. We assume that block.timestamp can // be manipulated by block producers but only within relatively tight // bounds (a few minutes at most). uint32 validUntil; // each ManyChainMultiSig instance has it own independent opCount. uint40 opCount; } ExpiringRootAndOpCount s_expiringRootAndOpCount; /// @notice Each root also authenticates metadata about itself (stored as one of the leaves) /// which must be revealed when the root is set. /// /// @dev We need to be careful that abi.encode(MANY_CHAIN_MULTI_SIG_DOMAIN_SEPARATOR_METADATA, RootMetadata) /// is greater than 64 bytes to prevent collisions with internal nodes in the Merkle tree. See /// openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol:15 for details. struct RootMetadata { // chainId and multiSig uniquely identify a ManyChainMultiSig contract instance that the // root is destined for. // uint256 since it is unclear if we can represent chainId as uint64. There is a proposal ( // https://ethereum-magicians.org/t/eip-2294-explicit-bound-to-chain-id/11090) to // bound chainid to 64 bits, but it is still unresolved. uint256 chainId; address multiSig; // opCount before adding this root uint40 preOpCount; // opCount after executing all ops in this root uint40 postOpCount; // override whatever root was already stored in this contract even if some of its // ops weren't executed. // Important: it is strongly recommended that offchain code set this to false by default. // Be careful setting this to true as it may break assumptions about what transactions from // the previous root have already been executed. bool overridePreviousRoot; } RootMetadata s_rootMetadata; /// @notice An ECDSA signature. struct Signature { uint8 v; bytes32 r; bytes32 s; } /// @notice setRoot Sets a new expiring root. /// /// @param root is the new expiring root. /// @param validUntil is the time by which root is valid /// @param metadata is the authenticated metadata about the root, which is stored as one of /// the leaves. /// @param metadataProof is the MerkleProof of inclusion of the metadata in the Merkle tree. /// @param signatures the ECDSA signatures on (root, validUntil). /// /// @dev the message (root, validUntil) should be signed by a sufficient set of signers. /// This signature authenticates also the metadata. /// /// @dev this method can be executed by anyone who has the root and valid signatures. /// as we validate the correctness of signatures, this imposes no risk. function setRoot( bytes32 root, uint32 validUntil, RootMetadata calldata metadata, bytes32[] calldata metadataProof, Signature[] calldata signatures ) external { bytes32 signedHash = ECDSA.toEthSignedMessageHash(keccak256(abi.encode(root, validUntil))); // Each (root, validUntil) tuple can only bet set once. For example, this prevents a // scenario where there are two signed roots with overridePreviousRoot = true and // an adversary keeps alternatively calling setRoot(root1), setRoot(root2), // setRoot(root1), ... if (s_seenSignedHashes[signedHash]) { revert SignedHashAlreadySeen(); } // verify ECDSA signatures on (root, validUntil) and ensure that the root group is successful { // verify sigs and count number of signers in each group Signer memory signer; address prevAddress = address(0x0); uint8[NUM_GROUPS] memory groupVoteCounts; // number of votes per group for (uint256 i = 0; i < signatures.length; i++) { Signature calldata sig = signatures[i]; address signerAddress = ECDSA.recover(signedHash, sig.v, sig.r, sig.s); // the off-chain system is required to sort the signatures by the // signer address in an increasing order if (prevAddress >= signerAddress) { revert SignersAddressesMustBeStrictlyIncreasing(); } prevAddress = signerAddress; signer = s_signers[signerAddress]; if (signer.addr != signerAddress) { revert InvalidSigner(); } uint8 group = signer.group; while (true) { groupVoteCounts[group]++; if (groupVoteCounts[group] != s_config.groupQuorums[group]) { // bail out unless we just hit the quorum. we only hit each quorum once, // so we never move on to the parent of a group more than once. break; } if (group == 0) { // reached root break; } group = s_config.groupParents[group]; } } // the group at the root of the tree (with index 0) determines whether the vote passed, // we cannot proceed if it isn't configured with a valid (non-zero) quorum if (s_config.groupQuorums[0] == 0) { revert MissingConfig(); } // did the root group reach its quorum? if (groupVoteCounts[0] < s_config.groupQuorums[0]) { revert InsufficientSigners(); } } if (validUntil < block.timestamp) { revert ValidUntilHasAlreadyPassed(); } { // verify metadataProof bytes32 hashedLeaf = keccak256(abi.encode(MANY_CHAIN_MULTI_SIG_DOMAIN_SEPARATOR_METADATA, metadata)); if (!MerkleProof.verify(metadataProof, root, hashedLeaf)) { revert ProofCannotBeVerified(); } } if (block.chainid != metadata.chainId) { revert WrongChainId(); } if (address(this) != metadata.multiSig) { revert WrongMultiSig(); } uint40 opCount = s_expiringRootAndOpCount.opCount; // don't allow a new root to be set if there are still outstanding ops that have not been // executed, unless overridePreviousRoot is set if (opCount != s_rootMetadata.postOpCount && !metadata.overridePreviousRoot) { revert PendingOps(); } // the signers are responsible for tracking opCount offchain and ensuring that // preOpCount equals to opCount if (opCount != metadata.preOpCount) { revert WrongPreOpCount(); } if (metadata.preOpCount > metadata.postOpCount) { revert WrongPostOpCount(); } // done with validation, persist in in contract state s_seenSignedHashes[signedHash] = true; s_expiringRootAndOpCount = ExpiringRootAndOpCount({ root: root, validUntil: validUntil, opCount: metadata.preOpCount }); s_rootMetadata = metadata; emit NewRoot(root, validUntil, metadata); } /// @notice an op to be executed by the ManyChainMultiSig contract /// /// @dev We need to be careful that abi.encode(LEAF_OP_DOMAIN_SEPARATOR, RootMetadata) /// is greater than 64 bytes to prevent collisions with internal nodes in the Merkle tree. See /// openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol:15 for details. struct Op { uint256 chainId; address multiSig; uint40 nonce; address to; uint256 value; bytes data; } /// @notice Execute the received op after verifying the proof of its inclusion in the /// current Merkle tree. The op should be the next op according to the order /// enforced by the merkle tree whose root is stored in s_expiringRootAndOpCount, i.e., the /// nonce of the op should be equal to s_expiringRootAndOpCount.opCount. /// /// @param op is Op to be executed /// @param proof is the MerkleProof for the op's inclusion in the MerkleTree which its /// root is the s_expiringRootAndOpCount.root. /// /// @dev ANYONE can call this function! That's intentional. Callers can only execute verified, /// ordered ops in the Merkle tree. /// /// @dev we perform a raw call to each target. Raw calls to targets that don't have associated /// contract code will always succeed regardless of data. /// /// @dev the gas limit of the call can be freely determined by the caller of this function. /// We expect callees to revert if they run out of gas. function execute(Op calldata op, bytes32[] calldata proof) external payable { ExpiringRootAndOpCount memory currentExpiringRootAndOpCount = s_expiringRootAndOpCount; if (s_rootMetadata.postOpCount <= currentExpiringRootAndOpCount.opCount) { revert PostOpCountReached(); } if (op.chainId != block.chainid) { revert WrongChainId(); } if (op.multiSig != address(this)) { revert WrongMultiSig(); } if (block.timestamp > currentExpiringRootAndOpCount.validUntil) { revert RootExpired(); } if (op.nonce != currentExpiringRootAndOpCount.opCount) { revert WrongNonce(); } // verify that the op exists in the merkle tree bytes32 hashedLeaf = keccak256(abi.encode(MANY_CHAIN_MULTI_SIG_DOMAIN_SEPARATOR_OP, op)); if (!MerkleProof.verify(proof, currentExpiringRootAndOpCount.root, hashedLeaf)) { revert ProofCannotBeVerified(); } // increase the counter *before* execution to prevent reentrancy issues s_expiringRootAndOpCount.opCount = currentExpiringRootAndOpCount.opCount + 1; _execute(op.to, op.value, op.data); emit OpExecuted(op.nonce, op.to, op.data, op.value); } /// @notice sets a new s_config. If clearRoot is true, then it also invalidates /// s_expiringRootAndOpCount.root. /// /// @param signerAddresses holds the addresses of the active signers. The addresses must be in /// ascending order. /// @param signerGroups maps each signer to its group /// @param groupQuorums holds the required number of valid signatures in each group. /// A group i is called successful group if at least groupQuorum[i] distinct signers provide a /// valid signature. /// @param groupParents holds each group's parent. The groups must be arranged in a tree s.t. /// group 0 is the root of the tree and the i-th group's parent has index j less than i. /// Iff setRoot is called with a set of signatures that causes the root group to be successful, /// setRoot allows a root to be set. /// @param clearRoot, if set to true, invalidates the current root. This option is needed to /// invalidate the current root, so to prevent further ops from being executed. This /// might be used when the current root was signed under a loser group configuration or when /// some previous signers aren't trusted any more. function setConfig( address[] calldata signerAddresses, uint8[] calldata signerGroups, uint8[NUM_GROUPS] calldata groupQuorums, uint8[NUM_GROUPS] calldata groupParents, bool clearRoot ) external onlyOwner { if (signerAddresses.length == 0 || signerAddresses.length > MAX_NUM_SIGNERS) { revert OutOfBoundsNumOfSigners(); } if (signerAddresses.length != signerGroups.length) { revert SignerGroupsLengthMismatch(); } { // validate group structure // counts the number of children of each group uint8[NUM_GROUPS] memory groupChildrenCounts; // first, we count the signers as children for (uint256 i = 0; i < signerGroups.length; i++) { if (signerGroups[i] >= NUM_GROUPS) { revert OutOfBoundsGroup(); } groupChildrenCounts[signerGroups[i]]++; } // second, we iterate backwards so as to check each group and propagate counts from // child group to parent groups up the tree to the root for (uint256 j = 0; j < NUM_GROUPS; j++) { uint256 i = NUM_GROUPS - 1 - j; // ensure we have a well-formed group tree. the root should have itself as parent if ((i != 0 && groupParents[i] >= i) || (i == 0 && groupParents[i] != 0)) { revert GroupTreeNotWellFormed(); } bool disabled = groupQuorums[i] == 0; if (disabled) { // a disabled group shouldn't have any children if (0 < groupChildrenCounts[i]) { revert SignerInDisabledGroup(); } } else { // ensure that the group quorum can be met if (groupChildrenCounts[i] < groupQuorums[i]) { revert OutOfBoundsGroupQuorum(); } groupChildrenCounts[groupParents[i]]++; // the above line clobbers groupChildrenCounts[0] in last iteration, don't use it after the loop ends } } } Signer[] memory oldSigners = s_config.signers; // remove any old signer addresses for (uint256 i = 0; i < oldSigners.length; i++) { address oldSignerAddress = oldSigners[i].addr; delete s_signers[oldSignerAddress]; s_config.signers.pop(); } // we cannot just write s_config = Config({...}) because solc doesn't support that assert(s_config.signers.length == 0); s_config.groupQuorums = groupQuorums; s_config.groupParents = groupParents; // add new signers' addresses, we require that the signers' list be a strictly monotone // increasing sequence address prevSigner = address(0x0); for (uint256 i = 0; i < signerAddresses.length; i++) { if (prevSigner >= signerAddresses[i]) { revert SignersAddressesMustBeStrictlyIncreasing(); } Signer memory signer = Signer({addr: signerAddresses[i], index: uint8(i), group: signerGroups[i]}); s_signers[signerAddresses[i]] = signer; s_config.signers.push(signer); prevSigner = signerAddresses[i]; } if (clearRoot) { // clearRoot is equivalent to overriding with a completely empty root uint40 opCount = s_expiringRootAndOpCount.opCount; s_expiringRootAndOpCount = ExpiringRootAndOpCount({root: 0, validUntil: 0, opCount: opCount}); s_rootMetadata = RootMetadata({ chainId: block.chainid, multiSig: address(this), preOpCount: opCount, postOpCount: opCount, overridePreviousRoot: true }); } emit ConfigSet(s_config, clearRoot); } /// @notice Execute an op's call. Performs a raw call that always succeeds if the /// target isn't a contract. function _execute(address target, uint256 value, bytes calldata data) internal virtual { (bool success, bytes memory ret) = target.call{value: value}(data); if (!success) { revert CallReverted(ret); } } /* * Getters */ function getConfig() public view returns (Config memory) { return s_config; } function getOpCount() public view returns (uint40) { return s_expiringRootAndOpCount.opCount; } function getRoot() public view returns (bytes32 root, uint32 validUntil) { ExpiringRootAndOpCount memory currentRootAndOpCount = s_expiringRootAndOpCount; return (currentRootAndOpCount.root, currentRootAndOpCount.validUntil); } function getRootMetadata() public view returns (RootMetadata memory) { return s_rootMetadata; } /* * Events and Errors */ /// @notice Emitted when a new root is set. event NewRoot(bytes32 indexed root, uint32 validUntil, RootMetadata metadata); /// @notice Emitted when a new config is set. event ConfigSet(Config config, bool isRootCleared); /// @notice Emitted when an op gets successfully executed. event OpExecuted(uint40 indexed nonce, address to, bytes data, uint256 value); /// @notice Thrown when number of signers is 0 or greater than MAX_NUM_SIGNERS. error OutOfBoundsNumOfSigners(); /// @notice Thrown when signerAddresses and signerGroups have different lengths. error SignerGroupsLengthMismatch(); /// @notice Thrown when number of some signer's group is greater than (NUM_GROUPS-1). error OutOfBoundsGroup(); /// @notice Thrown when the group tree isn't well-formed. error GroupTreeNotWellFormed(); /// @notice Thrown when the quorum of some group is larger than the number of signers in it. error OutOfBoundsGroupQuorum(); /// @notice Thrown when a disabled group contains a signer. error SignerInDisabledGroup(); /// @notice Thrown when the signers' addresses are not a strictly increasing monotone sequence. /// Prevents signers from including more than one signature. error SignersAddressesMustBeStrictlyIncreasing(); /// @notice Thrown when the signature corresponds to invalid signer. error InvalidSigner(); /// @notice Thrown when there is no sufficient set of valid signatures provided to make the /// root group successful. error InsufficientSigners(); /// @notice Thrown when attempt to set metadata or execute op for another chain. error WrongChainId(); /// @notice Thrown when the multiSig address in metadata or op is /// incompatible with the address of this contract. error WrongMultiSig(); /// @notice Thrown when the preOpCount <= postOpCount invariant is violated. error WrongPostOpCount(); /// @notice Thrown when attempting to set a new root while there are still pending ops /// from the previous root without explicitly overriding it. error PendingOps(); /// @notice Thrown when preOpCount in metadata is incompatible with the current opCount. error WrongPreOpCount(); /// @notice Thrown when the provided merkle proof cannot be verified. error ProofCannotBeVerified(); /// @notice Thrown when attempt to execute an op after /// s_expiringRootAndOpCount.validUntil has passed. error RootExpired(); /// @notice Thrown when attempt to bypass the enforced ops' order in the merkle tree or /// re-execute an op. error WrongNonce(); /// @notice Thrown when attempting to execute an op even though opCount equals /// metadata.postOpCount. error PostOpCountReached(); /// @notice Thrown when the underlying call in _execute() reverts. error CallReverted(bytes error); /// @notice Thrown when attempt to set past validUntil for the root. error ValidUntilHasAlreadyPassed(); /// @notice Thrown when setRoot() is called before setting a config. error MissingConfig(); /// @notice Thrown when attempt to set the same (root, validUntil) in setRoot(). error SignedHashAlreadySeen(); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol) pragma solidity ^0.8.0; import "./Ownable.sol"; /** * @dev Contract module which provides access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { 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 = Math.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 `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// 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 Math { 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) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 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 256, 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 << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract MockLinkToken { uint256 public constant totalSupply = 10 ** 27; mapping(address => uint256) public balances; constructor() { balances[msg.sender] = totalSupply; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { balances[msg.sender] = balances[msg.sender] - _value; balances[_to] = balances[_to] + _value; return true; } function transferAndCall( address _to, uint256 _value, bytes calldata _data ) public validRecipient(_to) returns (bool success) { transfer(_to, _value); if (isContract(_to)) { contractFallback(_to, _value, _data); } return true; } function balanceOf(address _a) public view returns (uint256 balance) { return balances[_a]; } modifier validRecipient(address _recipient) { require(_recipient != address(0) && _recipient != address(this)); _; } function contractFallback(address _to, uint256 _value, bytes calldata _data) private { ERC677Receiver receiver = ERC677Receiver(_to); receiver.onTokenTransfer(msg.sender, _value, _data); } function isContract(address _addr) private returns (bool hasCode) { uint256 length; assembly { length := extcodesize(_addr) } return length > 0; } } interface ERC677Receiver { function onTokenTransfer(address _sender, uint256 _value, bytes calldata _data) external; }
{ "remappings": [ "@eth-optimism/=node_modules/@eth-optimism/", "@openzeppelin/=node_modules/@openzeppelin/", "ds-test/=foundry-lib/forge-std/lib/ds-test/src/", "erc4626-tests/=foundry-lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=foundry-lib/forge-std/src/", "hardhat/=node_modules/hardhat/", "openzeppelin-contracts/=foundry-lib/openzeppelin-contracts/contracts/" ], "optimizer": { "enabled": false, "runs": 200 }, "metadata": { "bytecodeHash": "none", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
[{"inputs":[{"internalType":"bytes","name":"error","type":"bytes"}],"name":"CallReverted","type":"error"},{"inputs":[],"name":"GroupTreeNotWellFormed","type":"error"},{"inputs":[],"name":"InsufficientSigners","type":"error"},{"inputs":[],"name":"InvalidSigner","type":"error"},{"inputs":[],"name":"MissingConfig","type":"error"},{"inputs":[],"name":"OutOfBoundsGroup","type":"error"},{"inputs":[],"name":"OutOfBoundsGroupQuorum","type":"error"},{"inputs":[],"name":"OutOfBoundsNumOfSigners","type":"error"},{"inputs":[],"name":"PendingOps","type":"error"},{"inputs":[],"name":"PostOpCountReached","type":"error"},{"inputs":[],"name":"ProofCannotBeVerified","type":"error"},{"inputs":[],"name":"RootExpired","type":"error"},{"inputs":[],"name":"SignedHashAlreadySeen","type":"error"},{"inputs":[],"name":"SignerGroupsLengthMismatch","type":"error"},{"inputs":[],"name":"SignerInDisabledGroup","type":"error"},{"inputs":[],"name":"SignersAddressesMustBeStrictlyIncreasing","type":"error"},{"inputs":[],"name":"ValidUntilHasAlreadyPassed","type":"error"},{"inputs":[],"name":"WrongChainId","type":"error"},{"inputs":[],"name":"WrongMultiSig","type":"error"},{"inputs":[],"name":"WrongNonce","type":"error"},{"inputs":[],"name":"WrongPostOpCount","type":"error"},{"inputs":[],"name":"WrongPreOpCount","type":"error"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint8","name":"index","type":"uint8"},{"internalType":"uint8","name":"group","type":"uint8"}],"internalType":"struct ManyChainMultiSig.Signer[]","name":"signers","type":"tuple[]"},{"internalType":"uint8[32]","name":"groupQuorums","type":"uint8[32]"},{"internalType":"uint8[32]","name":"groupParents","type":"uint8[32]"}],"indexed":false,"internalType":"struct ManyChainMultiSig.Config","name":"config","type":"tuple"},{"indexed":false,"internalType":"bool","name":"isRootCleared","type":"bool"}],"name":"ConfigSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"root","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"validUntil","type":"uint32"},{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"multiSig","type":"address"},{"internalType":"uint40","name":"preOpCount","type":"uint40"},{"internalType":"uint40","name":"postOpCount","type":"uint40"},{"internalType":"bool","name":"overridePreviousRoot","type":"bool"}],"indexed":false,"internalType":"struct ManyChainMultiSig.RootMetadata","name":"metadata","type":"tuple"}],"name":"NewRoot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint40","name":"nonce","type":"uint40"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"OpExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"MAX_NUM_SIGNERS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NUM_GROUPS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"multiSig","type":"address"},{"internalType":"uint40","name":"nonce","type":"uint40"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct ManyChainMultiSig.Op","name":"op","type":"tuple"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"execute","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getConfig","outputs":[{"components":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint8","name":"index","type":"uint8"},{"internalType":"uint8","name":"group","type":"uint8"}],"internalType":"struct ManyChainMultiSig.Signer[]","name":"signers","type":"tuple[]"},{"internalType":"uint8[32]","name":"groupQuorums","type":"uint8[32]"},{"internalType":"uint8[32]","name":"groupParents","type":"uint8[32]"}],"internalType":"struct ManyChainMultiSig.Config","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOpCount","outputs":[{"internalType":"uint40","name":"","type":"uint40"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRoot","outputs":[{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"uint32","name":"validUntil","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRootMetadata","outputs":[{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"multiSig","type":"address"},{"internalType":"uint40","name":"preOpCount","type":"uint40"},{"internalType":"uint40","name":"postOpCount","type":"uint40"},{"internalType":"bool","name":"overridePreviousRoot","type":"bool"}],"internalType":"struct ManyChainMultiSig.RootMetadata","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"signerAddresses","type":"address[]"},{"internalType":"uint8[]","name":"signerGroups","type":"uint8[]"},{"internalType":"uint8[32]","name":"groupQuorums","type":"uint8[32]"},{"internalType":"uint8[32]","name":"groupParents","type":"uint8[32]"},{"internalType":"bool","name":"clearRoot","type":"bool"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"uint32","name":"validUntil","type":"uint32"},{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"multiSig","type":"address"},{"internalType":"uint40","name":"preOpCount","type":"uint40"},{"internalType":"uint40","name":"postOpCount","type":"uint40"},{"internalType":"bool","name":"overridePreviousRoot","type":"bool"}],"internalType":"struct ManyChainMultiSig.RootMetadata","name":"metadata","type":"tuple"},{"internalType":"bytes32[]","name":"metadataProof","type":"bytes32[]"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct ManyChainMultiSig.Signature[]","name":"signatures","type":"tuple[]"}],"name":"setRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Deployed Bytecode
0x6080604052600436106100e15760003560e01c8063846c67ef1161007f578063b759d68511610059578063b759d68514610270578063c3f909d41461028c578063e30c3978146102b7578063f2fde38b146102e2576100e8565b8063846c67ef146101f15780638da5cb5b1461021a578063a76f559814610245576100e8565b80636b45fb3e116100bb5780636b45fb3e1461016f578063715018a61461019a57806379ba5097146101b15780637cc38b28146101c8576100e8565b80635a2519ef146100ed5780635ca1e16514610118578063627e8a3b14610144576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b5061010261030b565b60405161010f9190612762565b60405180910390f35b34801561012457600080fd5b5061012d610310565b60405161013b9291906127b5565b60405180910390f35b34801561015057600080fd5b50610159610390565b60405161016691906127fe565b60405180910390f35b34801561017b57600080fd5b506101846103ae565b6040516101919190612905565b60405180910390f35b3480156101a657600080fd5b506101af610495565b005b3480156101bd57600080fd5b506101c66104a9565b005b3480156101d457600080fd5b506101ef60048036038101906101ea9190612a61565b610536565b005b3480156101fd57600080fd5b5061021860048036038101906102139190612c18565b610df6565b005b34801561022657600080fd5b5061022f611960565b60405161023c9190612ce6565b60405180910390f35b34801561025157600080fd5b5061025a611989565b6040516102679190612762565b60405180910390f35b61028a60048036038101906102859190612d20565b61198e565b005b34801561029857600080fd5b506102a1611d69565b6040516102ae9190612f8a565b60405180910390f35b3480156102c357600080fd5b506102cc611f44565b6040516102d99190612ce6565b60405180910390f35b3480156102ee57600080fd5b5061030960048036038101906103049190612fd8565b611f6e565b005b602081565b60008060006007604051806060016040529081600082015481526020016001820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016001820160049054906101000a900464ffffffffff1664ffffffffff1664ffffffffff168152505090508060000151816020015192509250509091565b6000600760010160049054906101000a900464ffffffffff16905090565b6103b66125aa565b60096040518060a0016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160149054906101000a900464ffffffffff1664ffffffffff1664ffffffffff1681526020016001820160199054906101000a900464ffffffffff1664ffffffffff1664ffffffffff16815260200160018201601e9054906101000a900460ff161515151581525050905090565b61049d61201b565b6104a76000612099565b565b60006104b36120ca565b90508073ffffffffffffffffffffffffffffffffffffffff166104d4611f44565b73ffffffffffffffffffffffffffffffffffffffff161461052a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052190613088565b60405180910390fd5b61053381612099565b50565b6000610569888860405160200161054e9291906127b5565b604051602081830303815290604052805190602001206120d2565b90506006600082815260200190815260200160002060009054906101000a900460ff16156105c3576040517f48c2688b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105cb6125ff565b60006105d561263c565b60005b868690508110156108c857368787838181106105f7576105f66130a8565b5b90506060020190506000610627878360000160208101906106189190613103565b84602001358560400135612108565b90508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161061068e576040517f4a36ec0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b809450600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460ff1660ff1660ff1681526020016000820160159054906101000a900460ff1660ff1660ff168152505095508073ffffffffffffffffffffffffffffffffffffffff16866000015173ffffffffffffffffffffffffffffffffffffffff16146107d6576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000866040015190505b6001156108b257848160ff16602081106107fd576107fc6130a8565b5b60200201805180919061080f9061315f565b60ff1660ff168152505060036001018160ff1660208110610833576108326130a8565b5b602091828204019190069054906101000a900460ff1660ff16858260ff1660208110610862576108616130a8565b5b602002015160ff16036108b25760008160ff1603156108b25760036002018160ff1660208110610895576108946130a8565b5b602091828204019190069054906101000a900460ff1690506107e0565b50505080806108c090613188565b9150506105d8565b50600060036001016000602081106108e3576108e26130a8565b5b602091828204019190069054906101000a900460ff1660ff1603610933576040517faa6185ca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600360010160006020811061094b5761094a6130a8565b5b602091828204019190069054906101000a900460ff1660ff1681600060208110610978576109776130a8565b5b602002015160ff1610156109b8576040517fc2ee9b9e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050428763ffffffff1610156109fb576040517fb057a45200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60007fe6b82be989101b4eb519770114b997b97b3c8707515286748a871717f0e4ea1c87604051602001610a30929190613314565b604051602081830303815290604052805190602001209050610a94868680806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508a83612133565b610aca576040517f2522a1c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5085600001354614610b08576040517f5f87bc0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b856020016020810190610b1b9190612fd8565b73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff1614610b7f576040517f9a84601500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600760010160049054906101000a900464ffffffffff169050600960010160199054906101000a900464ffffffffff1664ffffffffff168164ffffffffff1614158015610bde5750866080016020810190610bdc919061333d565b155b15610c15576040517f3230825b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b866040016020810190610c28919061336a565b64ffffffffff168164ffffffffff1614610c6e576040517fa255a76300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b866060016020810190610c81919061336a565b64ffffffffff16876040016020810190610c9b919061336a565b64ffffffffff161115610cda576040517fc61352f800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60016006600084815260200190815260200160002060006101000a81548160ff02191690831515021790555060405180606001604052808a81526020018963ffffffff168152602001886040016020810190610d36919061336a565b64ffffffffff1681525060076000820151816000015560208201518160010160006101000a81548163ffffffff021916908363ffffffff16021790555060408201518160010160046101000a81548164ffffffffff021916908364ffffffffff1602179055509050508660098181610dae919061377d565b905050887f7ea643ae44677f24e0d6f40168893712daaf729b0a38fe7702d21cb544c841018989604051610de392919061378b565b60405180910390a2505050505050505050565b610dfe61201b565b6000878790501480610e16575060c860ff1687879050115b15610e4d576040517ff0ec1ca400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b848490508787905014610e8c576040517ff1f3053000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e9461263c565b60005b86869050811015610f7557602060ff16878783818110610eba57610eb96130a8565b5b9050602002016020810190610ecf9190613103565b60ff1610610f09576040517fb9ae8e5200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81878783818110610f1d57610f1c6130a8565b5b9050602002016020810190610f329190613103565b60ff1660208110610f4657610f456130a8565b5b602002018051809190610f589061315f565b60ff1660ff16815250508080610f6d90613188565b915050610e97565b5060005b602060ff168110156111cd5760008160016020610f9691906137b4565b60ff16610fa391906137e9565b905060008114158015610fde575080858260208110610fc557610fc46130a8565b5b602002016020810190610fd89190613103565b60ff1610155b8061101e575060008114801561101d57506000858260208110611004576110036130a8565b5b6020020160208101906110179190613103565b60ff1614155b5b15611055576040517fff063a2600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008087836020811061106b5761106a6130a8565b5b60200201602081019061107e9190613103565b60ff1614905080156110e45783826020811061109d5761109c6130a8565b5b602002015160ff16600010156110df576040517f8db4e75d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111b8565b8682602081106110f7576110f66130a8565b5b60200201602081019061110a9190613103565b60ff168483602081106111205761111f6130a8565b5b602002015160ff161015611160576040517fbb00136e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83868360208110611174576111736130a8565b5b6020020160208101906111879190613103565b60ff166020811061119b5761119a6130a8565b5b6020020180518091906111ad9061315f565b60ff1660ff16815250505b505080806111c590613188565b915050610f79565b505060006003600001805480602002602001604051908101604052809291908181526020016000905b828210156112b4578382906000526020600020016040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460ff1660ff1660ff1681526020016000820160159054906101000a900460ff1660ff1660ff1681525050815260200190600101906111f6565b50505050905060005b81518110156114075760008282815181106112db576112da6130a8565b5b6020026020010151600001519050600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549060ff02191690556000820160156101000a81549060ff02191690555050600360000180548061138f5761138e61381d565b5b60019003818190600052602060002001600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a81549060ff02191690556000820160156101000a81549060ff0219169055505090555080806113ff90613188565b9150506112bd565b506000600360000180549050146114215761142061384c565b5b83600360010190602061143592919061265f565b5082600360020190602061144a92919061265f565b506000805b898990508110156117565789898281811061146d5761146c6130a8565b5b90506020020160208101906114829190612fd8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16106114e6576040517f4a36ec0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060405180606001604052808c8c85818110611506576115056130a8565b5b905060200201602081019061151b9190612fd8565b73ffffffffffffffffffffffffffffffffffffffff1681526020018360ff1681526020018a8a85818110611552576115516130a8565b5b90506020020160208101906115679190613103565b60ff16815250905080600260008d8d86818110611587576115866130a8565b5b905060200201602081019061159c9190612fd8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548160ff021916908360ff16021790555060408201518160000160156101000a81548160ff021916908360ff1602179055509050506003600001819080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548160ff021916908360ff16021790555060408201518160000160156101000a81548160ff021916908360ff16021790555050508a8a8381811061172b5761172a6130a8565b5b90506020020160208101906117409190612fd8565b925050808061174e90613188565b91505061144f565b50821561191b576000600760010160049054906101000a900464ffffffffff16905060405180606001604052806000801b8152602001600063ffffffff1681526020018264ffffffffff1681525060076000820151816000015560208201518160010160006101000a81548163ffffffff021916908363ffffffff16021790555060408201518160010160046101000a81548164ffffffffff021916908364ffffffffff1602179055509050506040518060a001604052804681526020013073ffffffffffffffffffffffffffffffffffffffff1681526020018264ffffffffff1681526020018264ffffffffff1681526020016001151581525060096000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010160146101000a81548164ffffffffff021916908364ffffffffff16021790555060608201518160010160196101000a81548164ffffffffff021916908364ffffffffff160217905550608082015181600101601e6101000a81548160ff021916908315150217905550905050505b7f0a4974ad206b9c736f9ab2feac1c9b1d043fe4ef377c70ae45659f2ef089f03e60038460405161194d92919061472f565b60405180910390a1505050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60c881565b60006007604051806060016040529081600082015481526020016001820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016001820160049054906101000a900464ffffffffff1664ffffffffff1664ffffffffff16815250509050806040015164ffffffffff16600960010160199054906101000a900464ffffffffff1664ffffffffff1611611a59576040517fadb1331800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b46846000013514611a96576040517f5f87bc0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff16846020016020810190611ac09190612fd8565b73ffffffffffffffffffffffffffffffffffffffff1614611b0d576040517f9a84601500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806020015163ffffffff16421115611b51576040517f9ba6743000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806040015164ffffffffff16846040016020810190611b70919061336a565b64ffffffffff1614611bae576040517fd9c6386f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60007f08d275622006c4ca82d03f498e90163cafd53c663a48470c3b52ac8bfbd9f52c85604051602001611be39291906148ea565b604051602081830303815290604052805190602001209050611c4b848480806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050836000015183612133565b611c81576040517f2522a1c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018260400151611c92919061491a565b600760010160046101000a81548164ffffffffff021916908364ffffffffff160217905550611ce7856060016020810190611ccd9190612fd8565b8660800135878060a00190611ce29190614962565b61214a565b846040016020810190611cfa919061336a565b64ffffffffff167f87d58fdd48be753fb9ef4ec8a5895086c401506da8b4d752abc90602c3e62d1d866060016020810190611d359190612fd8565b878060a00190611d459190614962565b8960800135604051611d5a9493929190614a12565b60405180910390a25050505050565b611d716126fc565b600360405180606001604052908160008201805480602002602001604051908101604052809291908181526020016000905b82821015611e61578382906000526020600020016040518060600160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460ff1660ff1660ff1681526020016000820160159054906101000a900460ff1660ff1660ff168152505081526020019060010190611da3565b50505050815260200160018201602080602002604051908101604052809291908260208015611ecb576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411611e945790505b5050505050815260200160028201602080602002604051908101604052809291908260208015611f36576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411611eff5790505b505050505081525050905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611f7661201b565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16611fd6611960565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6120236120ca565b73ffffffffffffffffffffffffffffffffffffffff16612041611960565b73ffffffffffffffffffffffffffffffffffffffff1614612097576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208e90614a9e565b60405180910390fd5b565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556120c781612206565b50565b600033905090565b60007f19457468657265756d205369676e6564204d6573736167653a0a33320000000060005281601c52603c6000209050919050565b6000806000612119878787876122ca565b91509150612126816123ac565b8192505050949350505050565b6000826121408584612512565b1490509392505050565b6000808573ffffffffffffffffffffffffffffffffffffffff16858585604051612175929190614aee565b60006040518083038185875af1925050503d80600081146121b2576040519150601f19603f3d011682016040523d82523d6000602084013e6121b7565b606091505b5091509150816121fe57806040517f70de1b4b0000000000000000000000000000000000000000000000000000000081526004016121f59190614b75565b60405180910390fd5b505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c11156123055760006003915091506123a3565b60006001878787876040516000815260200160405260405161232a9493929190614b97565b6020604051602081039080840390855afa15801561234c573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361239a576000600192509250506123a3565b80600092509250505b94509492505050565b600060048111156123c0576123bf614bdc565b5b8160048111156123d3576123d2614bdc565b5b031561250f57600160048111156123ed576123ec614bdc565b5b816004811115612400576123ff614bdc565b5b03612440576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161243790614c57565b60405180910390fd5b6002600481111561245457612453614bdc565b5b81600481111561246757612466614bdc565b5b036124a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249e90614cc3565b60405180910390fd5b600360048111156124bb576124ba614bdc565b5b8160048111156124ce576124cd614bdc565b5b0361250e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250590614d55565b60405180910390fd5b5b50565b60008082905060005b845181101561255d576125488286838151811061253b5761253a6130a8565b5b6020026020010151612568565b9150808061255590613188565b91505061251b565b508091505092915050565b60008183106125805761257b8284612593565b61258b565b61258a8383612593565b5b905092915050565b600082600052816020526040600020905092915050565b6040518060a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600064ffffffffff168152602001600064ffffffffff1681526020016000151581525090565b6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600060ff168152602001600060ff1681525090565b604051806104000160405280602090602082028036833780820191505090505090565b826020601f016020900481019282156126eb5791602002820160005b838211156126bc57833560ff1683826101000a81548160ff021916908360ff160217905550926020019260010160208160000104928301926001030261267b565b80156126e95782816101000a81549060ff02191690556001016020816000010492830192600103026126bc565b505b5090506126f89190612729565b5090565b60405180606001604052806060815260200161271661263c565b815260200161272361263c565b81525090565b5b8082111561274257600081600090555060010161272a565b5090565b600060ff82169050919050565b61275c81612746565b82525050565b60006020820190506127776000830184612753565b92915050565b6000819050919050565b6127908161277d565b82525050565b600063ffffffff82169050919050565b6127af81612796565b82525050565b60006040820190506127ca6000830185612787565b6127d760208301846127a6565b9392505050565b600064ffffffffff82169050919050565b6127f8816127de565b82525050565b600060208201905061281360008301846127ef565b92915050565b6000819050919050565b61282c81612819565b82525050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061285d82612832565b9050919050565b61286d81612852565b82525050565b61287c816127de565b82525050565b60008115159050919050565b61289781612882565b82525050565b60a0820160008201516128b36000850182612823565b5060208201516128c66020850182612864565b5060408201516128d96040850182612873565b5060608201516128ec6060850182612873565b5060808201516128ff608085018261288e565b50505050565b600060a08201905061291a600083018461289d565b92915050565b600080fd5b600080fd5b6129338161277d565b811461293e57600080fd5b50565b6000813590506129508161292a565b92915050565b61295f81612796565b811461296a57600080fd5b50565b60008135905061297c81612956565b92915050565b600080fd5b600060a0828403121561299d5761299c612982565b5b81905092915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126129cb576129ca6129a6565b5b8235905067ffffffffffffffff8111156129e8576129e76129ab565b5b602083019150836020820283011115612a0457612a036129b0565b5b9250929050565b60008083601f840112612a2157612a206129a6565b5b8235905067ffffffffffffffff811115612a3e57612a3d6129ab565b5b602083019150836060820283011115612a5a57612a596129b0565b5b9250929050565b6000806000806000806000610120888a031215612a8157612a80612920565b5b6000612a8f8a828b01612941565b9750506020612aa08a828b0161296d565b9650506040612ab18a828b01612987565b95505060e088013567ffffffffffffffff811115612ad257612ad1612925565b5b612ade8a828b016129b5565b945094505061010088013567ffffffffffffffff811115612b0257612b01612925565b5b612b0e8a828b01612a0b565b925092505092959891949750929550565b60008083601f840112612b3557612b346129a6565b5b8235905067ffffffffffffffff811115612b5257612b516129ab565b5b602083019150836020820283011115612b6e57612b6d6129b0565b5b9250929050565b60008083601f840112612b8b57612b8a6129a6565b5b8235905067ffffffffffffffff811115612ba857612ba76129ab565b5b602083019150836020820283011115612bc457612bc36129b0565b5b9250929050565b6000819050826020800282011115612be657612be56129b0565b5b92915050565b612bf581612882565b8114612c0057600080fd5b50565b600081359050612c1281612bec565b92915050565b6000806000806000806000610860888a031215612c3857612c37612920565b5b600088013567ffffffffffffffff811115612c5657612c55612925565b5b612c628a828b01612b1f565b9750975050602088013567ffffffffffffffff811115612c8557612c84612925565b5b612c918a828b01612b75565b95509550506040612ca48a828b01612bcb565b935050610440612cb68a828b01612bcb565b925050610840612cc88a828b01612c03565b91505092959891949750929550565b612ce081612852565b82525050565b6000602082019050612cfb6000830184612cd7565b92915050565b600060c08284031215612d1757612d16612982565b5b81905092915050565b600080600060408486031215612d3957612d38612920565b5b600084013567ffffffffffffffff811115612d5757612d56612925565b5b612d6386828701612d01565b935050602084013567ffffffffffffffff811115612d8457612d83612925565b5b612d90868287016129b5565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612dd181612746565b82525050565b606082016000820151612ded6000850182612864565b506020820151612e006020850182612dc8565b506040820151612e136040850182612dc8565b50505050565b6000612e258383612dd7565b60608301905092915050565b6000602082019050919050565b6000612e4982612d9c565b612e538185612da7565b9350612e5e83612db8565b8060005b83811015612e8f578151612e768882612e19565b9750612e8183612e31565b925050600181019050612e62565b5085935050505092915050565b600060209050919050565b600081905092915050565b6000819050919050565b6000612ec88383612dc8565b60208301905092915050565b6000602082019050919050565b612eea81612e9c565b612ef48184612ea7565b9250612eff82612eb2565b8060005b83811015612f30578151612f178782612ebc565b9650612f2283612ed4565b925050600181019050612f03565b505050505050565b6000610820830160008301518482036000860152612f568282612e3e565b9150506020830151612f6b6020860182612ee1565b506040830151612f7f610420860182612ee1565b508091505092915050565b60006020820190508181036000830152612fa48184612f38565b905092915050565b612fb581612852565b8114612fc057600080fd5b50565b600081359050612fd281612fac565b92915050565b600060208284031215612fee57612fed612920565b5b6000612ffc84828501612fc3565b91505092915050565b600082825260208201905092915050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b6000613072602983613005565b915061307d82613016565b604082019050919050565b600060208201905081810360008301526130a181613065565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6130e081612746565b81146130eb57600080fd5b50565b6000813590506130fd816130d7565b92915050565b60006020828403121561311957613118612920565b5b6000613127848285016130ee565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061316a82612746565b915060ff820361317d5761317c613130565b5b600182019050919050565b600061319382612819565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036131c5576131c4613130565b5b600182019050919050565b6131d981612819565b81146131e457600080fd5b50565b6000813590506131f6816131d0565b92915050565b600061320b60208401846131e7565b905092915050565b60006132226020840184612fc3565b905092915050565b613233816127de565b811461323e57600080fd5b50565b6000813590506132508161322a565b92915050565b60006132656020840184613241565b905092915050565b600061327c6020840184612c03565b905092915050565b60a0820161329560008301836131fc565b6132a26000850182612823565b506132b06020830183613213565b6132bd6020850182612864565b506132cb6040830183613256565b6132d86040850182612873565b506132e66060830183613256565b6132f36060850182612873565b50613301608083018361326d565b61330e608085018261288e565b50505050565b600060c0820190506133296000830185612787565b6133366020830184613284565b9392505050565b60006020828403121561335357613352612920565b5b600061336184828501612c03565b91505092915050565b6000602082840312156133805761337f612920565b5b600061338e84828501613241565b91505092915050565b600081356133a4816131d0565b80915050919050565b60008160001b9050919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6133e6846133ad565b9350801983169250808416831791505092915050565b6000819050919050565b600061342161341c61341784612819565b6133fc565b612819565b9050919050565b6000819050919050565b61343b82613406565b61344e61344782613428565b83546133ba565b8255505050565b6000813561346281612fac565b80915050919050565b600073ffffffffffffffffffffffffffffffffffffffff61348b846133ad565b9350801983169250808416831791505092915050565b60006134bc6134b76134b284612832565b6133fc565b612832565b9050919050565b60006134ce826134a1565b9050919050565b60006134e0826134c3565b9050919050565b6000819050919050565b6134fa826134d5565b61350d613506826134e7565b835461346b565b8255505050565b600081356135218161322a565b80915050919050565b60008160a01b9050919050565b600078ffffffffff000000000000000000000000000000000000000061355c8461352a565b9350801983169250808416831791505092915050565b600061358d613588613583846127de565b6133fc565b6127de565b9050919050565b6000819050919050565b6135a782613572565b6135ba6135b382613594565b8354613537565b8255505050565b60008160c81b9050919050565b60007dffffffffff000000000000000000000000000000000000000000000000006135f8846135c1565b9350801983169250808416831791505092915050565b61361782613572565b61362a61362382613594565b83546135ce565b8255505050565b6000813561363e81612bec565b80915050919050565b60008160f01b9050919050565b60007eff00000000000000000000000000000000000000000000000000000000000061367f84613647565b9350801983169250808416831791505092915050565b60006136a082612882565b9050919050565b6000819050919050565b6136ba82613695565b6136cd6136c6826136a7565b8354613654565b8255505050565b6000810160008301806136e681613397565b90506136f28184613432565b50505060018101602083018061370781613455565b905061371381846134f1565b50505060018101604083018061372881613514565b9050613734818461359e565b50505060018101606083018061374981613514565b9050613755818461360e565b50505060018101608083018061376a81613631565b905061377681846136b1565b5050505050565b61378782826136d4565b5050565b600060c0820190506137a060008301856127a6565b6137ad6020830184613284565b9392505050565b60006137bf82612746565b91506137ca83612746565b9250828203905060ff8111156137e3576137e2613130565b5b92915050565b60006137f482612819565b91506137ff83612819565b925082820390508181111561381757613816613130565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600081549050919050565b60008190508160005260206000209050919050565b60008160001c9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006138db6138d68361389b565b6138a8565b9050919050565b60008160a01c9050919050565b600060ff82169050919050565b600061390f61390a836138e2565b6138ef565b9050919050565b60008160a81c9050919050565b600061393661393183613916565b6138ef565b9050919050565b606082016000808301549050613952816138c8565b61395f6000860182612864565b50613969816138fc565b6139766020860182612dc8565b5061398081613923565b61398d6040860182612dc8565b5050505050565b60006139a0838361393d565b60608301905092915050565b6000600182019050919050565b60006139c48261387b565b6139ce8185612da7565b93506139d983613886565b8060005b83811015613a0957816139f08882613994565b97506139fb836139ac565b9250506001810190506139dd565b5085935050505092915050565b600060209050919050565b6000819050919050565b6000613a3e613a398361389b565b6138ef565b9050919050565b60008160081c9050919050565b6000613a65613a6083613a45565b6138ef565b9050919050565b60008160101c9050919050565b6000613a8c613a8783613a6c565b6138ef565b9050919050565b60008160181c9050919050565b6000613ab3613aae83613a93565b6138ef565b9050919050565b60008160201c9050919050565b6000613ada613ad583613aba565b6138ef565b9050919050565b60008160281c9050919050565b6000613b01613afc83613ae1565b6138ef565b9050919050565b60008160301c9050919050565b6000613b28613b2383613b08565b6138ef565b9050919050565b60008160381c9050919050565b6000613b4f613b4a83613b2f565b6138ef565b9050919050565b60008160401c9050919050565b6000613b76613b7183613b56565b6138ef565b9050919050565b60008160481c9050919050565b6000613b9d613b9883613b7d565b6138ef565b9050919050565b60008160501c9050919050565b6000613bc4613bbf83613ba4565b6138ef565b9050919050565b60008160581c9050919050565b6000613beb613be683613bcb565b6138ef565b9050919050565b60008160601c9050919050565b6000613c12613c0d83613bf2565b6138ef565b9050919050565b60008160681c9050919050565b6000613c39613c3483613c19565b6138ef565b9050919050565b60008160701c9050919050565b6000613c60613c5b83613c40565b6138ef565b9050919050565b60008160781c9050919050565b6000613c87613c8283613c67565b6138ef565b9050919050565b60008160801c9050919050565b6000613cae613ca983613c8e565b6138ef565b9050919050565b60008160881c9050919050565b6000613cd5613cd083613cb5565b6138ef565b9050919050565b60008160901c9050919050565b6000613cfc613cf783613cdc565b6138ef565b9050919050565b60008160981c9050919050565b6000613d23613d1e83613d03565b6138ef565b9050919050565b60008160b01c9050919050565b6000613d4a613d4583613d2a565b6138ef565b9050919050565b60008160b81c9050919050565b6000613d71613d6c83613d51565b6138ef565b9050919050565b60008160c01c9050919050565b6000613d98613d9383613d78565b6138ef565b9050919050565b60008160c81c9050919050565b6000613dbf613dba83613d9f565b6138ef565b9050919050565b60008160d01c9050919050565b6000613de6613de183613dc6565b6138ef565b9050919050565b60008160d81c9050919050565b6000613e0d613e0883613ded565b6138ef565b9050919050565b60008160e01c9050919050565b6000613e34613e2f83613e14565b6138ef565b9050919050565b60008160e81c9050919050565b6000613e5b613e5683613e3b565b6138ef565b9050919050565b60008160f01c9050919050565b6000613e82613e7d83613e62565b6138ef565b9050919050565b60008160f81c9050919050565b6000613ea9613ea483613e89565b6138ef565b9050919050565b613eb981613a16565b613ec38184612ea7565b925082613ecf83613a21565b60006001156141fc575b836001602003820110156141fb578154613efb87613ef683613a2b565b612dc8565b602087019650613f1387613f0e83613a52565b612dc8565b602087019650613f2b87613f2683613a79565b612dc8565b602087019650613f4387613f3e83613aa0565b612dc8565b602087019650613f5b87613f5683613ac7565b612dc8565b602087019650613f7387613f6e83613aee565b612dc8565b602087019650613f8b87613f8683613b15565b612dc8565b602087019650613fa387613f9e83613b3c565b612dc8565b602087019650613fbb87613fb683613b63565b612dc8565b602087019650613fd387613fce83613b8a565b612dc8565b602087019650613feb87613fe683613bb1565b612dc8565b60208701965061400387613ffe83613bd8565b612dc8565b60208701965061401b8761401683613bff565b612dc8565b6020870196506140338761402e83613c26565b612dc8565b60208701965061404b8761404683613c4d565b612dc8565b6020870196506140638761405e83613c74565b612dc8565b60208701965061407b8761407683613c9b565b612dc8565b6020870196506140938761408e83613cc2565b612dc8565b6020870196506140ab876140a683613ce9565b612dc8565b6020870196506140c3876140be83613d10565b612dc8565b6020870196506140db876140d6836138fc565b612dc8565b6020870196506140f3876140ee83613923565b612dc8565b60208701965061410b8761410683613d37565b612dc8565b6020870196506141238761411e83613d5e565b612dc8565b60208701965061413b8761413683613d85565b612dc8565b6020870196506141538761414e83613dac565b612dc8565b60208701965061416b8761416683613dd3565b612dc8565b6020870196506141838761417e83613dfa565b612dc8565b60208701965061419b8761419683613e21565b612dc8565b6020870196506141b3876141ae83613e48565b612dc8565b6020870196506141cb876141c683613e6f565b612dc8565b6020870196506141e3876141de83613e96565b612dc8565b60208701965060018301925050602081019050613ed9565b5b6000156146c757815460001561422b5761421e8761421983613a2b565b612dc8565b6020870196506001820191505b600015614251576142448761423f83613a52565b612dc8565b6020870196506001820191505b6000156142775761426a8761426583613a79565b612dc8565b6020870196506001820191505b60001561429d576142908761428b83613aa0565b612dc8565b6020870196506001820191505b6000156142c3576142b6876142b183613ac7565b612dc8565b6020870196506001820191505b6000156142e9576142dc876142d783613aee565b612dc8565b6020870196506001820191505b60001561430f57614302876142fd83613b15565b612dc8565b6020870196506001820191505b600015614335576143288761432383613b3c565b612dc8565b6020870196506001820191505b60001561435b5761434e8761434983613b63565b612dc8565b6020870196506001820191505b600015614381576143748761436f83613b8a565b612dc8565b6020870196506001820191505b6000156143a75761439a8761439583613bb1565b612dc8565b6020870196506001820191505b6000156143cd576143c0876143bb83613bd8565b612dc8565b6020870196506001820191505b6000156143f3576143e6876143e183613bff565b612dc8565b6020870196506001820191505b6000156144195761440c8761440783613c26565b612dc8565b6020870196506001820191505b60001561443f576144328761442d83613c4d565b612dc8565b6020870196506001820191505b600015614465576144588761445383613c74565b612dc8565b6020870196506001820191505b60001561448b5761447e8761447983613c9b565b612dc8565b6020870196506001820191505b6000156144b1576144a48761449f83613cc2565b612dc8565b6020870196506001820191505b6000156144d7576144ca876144c583613ce9565b612dc8565b6020870196506001820191505b6000156144fd576144f0876144eb83613d10565b612dc8565b6020870196506001820191505b6000156145235761451687614511836138fc565b612dc8565b6020870196506001820191505b6000156145495761453c8761453783613923565b612dc8565b6020870196506001820191505b60001561456f576145628761455d83613d37565b612dc8565b6020870196506001820191505b600015614595576145888761458383613d5e565b612dc8565b6020870196506001820191505b6000156145bb576145ae876145a983613d85565b612dc8565b6020870196506001820191505b6000156145e1576145d4876145cf83613dac565b612dc8565b6020870196506001820191505b600015614607576145fa876145f583613dd3565b612dc8565b6020870196506001820191505b60001561462d576146208761461b83613dfa565b612dc8565b6020870196506001820191505b600015614653576146468761464183613e21565b612dc8565b6020870196506001820191505b6000156146795761466c8761466783613e48565b612dc8565b6020870196506001820191505b60001561469f576146928761468d83613e6f565b612dc8565b6020870196506001820191505b6000156146c5576146b8876146b383613e96565b612dc8565b6020870196506001820191505b505b505050505050565b60006108208301600080840185830360008701526146ed83826139b9565b925050600184016147016020870182613eb0565b5060028401614714610420870182613eb0565b50819250505092915050565b61472981612882565b82525050565b6000604082019050818103600083015261474981856146cf565b90506147586020830184614720565b9392505050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261478b5761478a614769565b5b83810192508235915060208301925067ffffffffffffffff8211156147b3576147b261475f565b5b6001820236038313156147c9576147c8614764565b5b509250929050565b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b600061480e83856147d1565b935061481b8385846147e2565b614824836147f1565b840190509392505050565b600060c0830161484260008401846131fc565b61484f6000860182612823565b5061485d6020840184613213565b61486a6020860182612864565b506148786040840184613256565b6148856040860182612873565b506148936060840184613213565b6148a06060860182612864565b506148ae60808401846131fc565b6148bb6080860182612823565b506148c960a084018461476e565b85830360a08701526148dc838284614802565b925050508091505092915050565b60006040820190506148ff6000830185612787565b8181036020830152614911818461482f565b90509392505050565b6000614925826127de565b9150614930836127de565b9250828201905064ffffffffff81111561494d5761494c613130565b5b92915050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261497f5761497e614953565b5b80840192508235915067ffffffffffffffff8211156149a1576149a0614958565b5b6020830192506001820236038313156149bd576149bc61495d565b5b509250929050565b600082825260208201905092915050565b60006149e283856149c5565b93506149ef8385846147e2565b6149f8836147f1565b840190509392505050565b614a0c81612819565b82525050565b6000606082019050614a276000830187612cd7565b8181036020830152614a3a8185876149d6565b9050614a496040830184614a03565b95945050505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614a88602083613005565b9150614a9382614a52565b602082019050919050565b60006020820190508181036000830152614ab781614a7b565b9050919050565b600081905092915050565b6000614ad58385614abe565b9350614ae28385846147e2565b82840190509392505050565b6000614afb828486614ac9565b91508190509392505050565b600081519050919050565b60005b83811015614b30578082015181840152602081019050614b15565b60008484015250505050565b6000614b4782614b07565b614b5181856149c5565b9350614b61818560208601614b12565b614b6a816147f1565b840191505092915050565b60006020820190508181036000830152614b8f8184614b3c565b905092915050565b6000608082019050614bac6000830187612787565b614bb96020830186612753565b614bc66040830185612787565b614bd36060830184612787565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b6000614c41601883613005565b9150614c4c82614c0b565b602082019050919050565b60006020820190508181036000830152614c7081614c34565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b6000614cad601f83613005565b9150614cb882614c77565b602082019050919050565b60006020820190508181036000830152614cdc81614ca0565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b6000614d3f602283613005565b9150614d4a82614ce3565b604082019050919050565b60006020820190508181036000830152614d6e81614d32565b905091905056fea164736f6c6343000813000a
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.