ETH Price: $2,524.32 (+0.22%)

Contract

0xc7F38C08E1F0b929a2b6af28A567aed839fDc3A5
 
Transaction Hash
Method
Block
From
To
Claim188413972023-12-22 12:30:47252 days ago1703248247IN
0xc7F38C08...839fDc3A5
0 ETH0.003189931.13650929
Claim186177302023-11-21 4:21:59283 days ago1700540519IN
0xc7F38C08...839fDc3A5
0 ETH0.0031029730.29570946
Claim185849032023-11-16 13:59:59288 days ago1700143199IN
0xc7F38C08...839fDc3A5
0 ETH0.0029135128.86129086
Claim185759052023-11-15 7:48:11289 days ago1700034491IN
0xc7F38C08...839fDc3A5
0 ETH0.0026621427
Claim185645432023-11-13 17:42:47291 days ago1699897367IN
0xc7F38C08...839fDc3A5
0 ETH0.0093784963.86274001
Claim185415692023-11-10 12:33:11294 days ago1699619591IN
0xc7F38C08...839fDc3A5
0 ETH0.0033122133.09992608
Claim185384522023-11-10 2:05:59295 days ago1699581959IN
0xc7F38C08...839fDc3A5
0 ETH0.0046426945.32684709
Claim185186862023-11-07 7:48:35297 days ago1699343315IN
0xc7F38C08...839fDc3A5
0 ETH0.0022032821.5078866
Claim185174402023-11-07 3:36:35298 days ago1699328195IN
0xc7F38C08...839fDc3A5
0 ETH0.0022059221.52987426
Claim185125582023-11-06 11:11:11298 days ago1699269071IN
0xc7F38C08...839fDc3A5
0 ETH0.0025937326
Claim185105552023-11-06 4:26:35298 days ago1699244795IN
0xc7F38C08...839fDc3A5
0 ETH0.0040780527.48592169
Claim185087942023-11-05 22:32:23299 days ago1699223543IN
0xc7F38C08...839fDc3A5
0 ETH0.0017395516.98703307
Claim184587212023-10-29 22:09:35306 days ago1698617375IN
0xc7F38C08...839fDc3A5
0 ETH0.0014292414.15670627
Claim184526492023-10-29 1:45:11307 days ago1698543911IN
0xc7F38C08...839fDc3A5
0 ETH0.000918328.96739669
Claim184121382023-10-23 9:40:59312 days ago1698054059IN
0xc7F38C08...839fDc3A5
0 ETH0.0010973811.12965038
Claim183414502023-10-13 12:23:35322 days ago1697199815IN
0xc7F38C08...839fDc3A5
0 ETH0.001021989.97985522
Claim183362902023-10-12 19:02:11323 days ago1697137331IN
0xc7F38C08...839fDc3A5
0 ETH0.0012180811.89389785
Claim183357342023-10-12 17:10:23323 days ago1697130623IN
0xc7F38C08...839fDc3A5
0 ETH0.002812928.1040294
Claim183044552023-10-08 8:04:23327 days ago1696752263IN
0xc7F38C08...839fDc3A5
0 ETH0.00063566.2049953
Claim182794042023-10-04 20:00:47331 days ago1696449647IN
0xc7F38C08...839fDc3A5
0 ETH0.0013490813.1698776
Claim182674862023-10-03 4:00:11333 days ago1696305611IN
0xc7F38C08...839fDc3A5
0 ETH0.000659736.43898959
Claim182542172023-10-01 7:32:11334 days ago1696145531IN
0xc7F38C08...839fDc3A5
0 ETH0.000670766.70235512
Claim182536632023-10-01 5:40:59334 days ago1696138859IN
0xc7F38C08...839fDc3A5
0 ETH0.000673246.57486125
Claim182385222023-09-29 2:52:59337 days ago1695955979IN
0xc7F38C08...839fDc3A5
0 ETH0.000631186.30711289
Claim182257972023-09-27 8:05:47338 days ago1695801947IN
0xc7F38C08...839fDc3A5
0 ETH0.000964249.91296309
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
181649852023-09-18 19:44:47347 days ago1695066287
0xc7F38C08...839fDc3A5
8.39652345 ETH
180816292023-09-07 2:40:11359 days ago1694054411
0xc7F38C08...839fDc3A5
21.83096098 ETH
180815902023-09-07 2:32:23359 days ago1694053943
0xc7F38C08...839fDc3A5
12.25892424 ETH
180380882023-09-01 0:20:23365 days ago1693527623
0xc7F38C08...839fDc3A5
0.41982617 ETH
180032392023-08-27 3:12:23370 days ago1693105943
0xc7F38C08...839fDc3A5
1.00758281 ETH
179858022023-08-24 16:38:23372 days ago1692895103
0xc7F38C08...839fDc3A5
8.39652345 ETH
179853912023-08-24 15:15:23372 days ago1692890123
0xc7F38C08...839fDc3A5
0.87323843 ETH
179779612023-08-23 14:19:35373 days ago1692800375
0xc7F38C08...839fDc3A5
2.21668219 ETH
179742882023-08-23 2:00:23374 days ago1692756023
0xc7F38C08...839fDc3A5
0.04752432 ETH
179724082023-08-22 19:41:59374 days ago1692733319
0xc7F38C08...839fDc3A5
15.11374222 ETH
179705562023-08-22 13:29:11374 days ago1692710951
0xc7F38C08...839fDc3A5
2.9387832 ETH
179705362023-08-22 13:25:11374 days ago1692710711
0xc7F38C08...839fDc3A5
45.34122666 ETH
179705052023-08-22 13:18:59374 days ago1692710339
0xc7F38C08...839fDc3A5
22.33475239 ETH
179704502023-08-22 13:07:59374 days ago1692709679
0xc7F38C08...839fDc3A5
0.5037914 ETH
179699402023-08-22 11:25:11374 days ago1692703511
0xc7F38C08...839fDc3A5
8.56445392 ETH
179691912023-08-22 8:54:23374 days ago1692694463
0xc7F38C08...839fDc3A5
0.04198261 ETH
179689092023-08-22 7:57:47374 days ago1692691067
0xc7F38C08...839fDc3A5
0.41982617 ETH
179676422023-08-22 3:42:59375 days ago1692675779
0xc7F38C08...839fDc3A5
0.27960423 ETH
179670502023-08-22 1:43:23375 days ago1692668603
0xc7F38C08...839fDc3A5
0.17716664 ETH
179663332023-08-21 23:18:35375 days ago1692659915
0xc7F38C08...839fDc3A5
0.5037914 ETH
179662692023-08-21 23:05:47375 days ago1692659147
0xc7F38C08...839fDc3A5
450.2215877 ETH
179659242023-08-21 21:56:23375 days ago1692654983
0xc7F38C08...839fDc3A5
1.93120039 ETH
179658622023-08-21 21:43:59375 days ago1692654239
0xc7F38C08...839fDc3A5
4.19826172 ETH
179658322023-08-21 21:37:59375 days ago1692653879
0xc7F38C08...839fDc3A5
2.96397278 ETH
179657982023-08-21 21:31:11375 days ago1692653471
0xc7F38C08...839fDc3A5
0.41982617 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenClaim

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 12 : TokenClaim.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract TokenClaim is AccessControl, ReentrancyGuard {
    error InvalidMerkleRoot();
    error ZeroAddress();
    error InvalidAmount();
    error InvalidProof();
    error AlreadyClaimed();
    error ClaimDisabled();

    enum ClaimAsset {
        ETH,
        PETH,
        JPEG,
        PETH_ETH,
        JPEG_PETH
    }

    struct ClaimData {
        bool ethClaimed;
        bool pethClaimed;
        bool jpegClaimed;
        bool pethEthClaimed;
        bool jpegPethClaimed;
    }

    struct ClaimArguments {
        ClaimAsset asset;
        bytes32[] proof;
        uint256 amount;
    }

    bytes32 public constant DEPLOYER_ROLE = keccak256("DEPLOYER_ROLE");

    bytes32 public immutable ETH_ROOT;
    bytes32 public immutable PETH_ROOT;
    bytes32 public immutable JPEG_ROOT;
    bytes32 public immutable PETH_ETH_ROOT;
    bytes32 public immutable JPEG_PETH_ROOT;

    IERC20 public immutable PETH;
    IERC20 public immutable JPEG;

    uint256 public immutable EXPECTED_PETH_ETH_AMOUNT;
    uint256 public immutable EXPECTED_JPEG_PETH_AMOUNT;

    IERC20 public pethEthLpToken;
    IERC20 public jpegPethLpToken;

    uint256 public receivedPethEthAmount;
    uint256 public receivedJpegPethAmount;

    mapping(address => ClaimData) public claimData;

    constructor(
        bytes32 _ethRoot, 
        bytes32 _pethRoot, 
        bytes32 _jpegRoot, 
        bytes32 _pethEthRoot, 
        bytes32 _jpegPethRoot, 
        address _peth,
        address _jpeg,
        uint256 _expectedPethEthAmount, 
        uint256 _expectedJpegPethAmount
    ) {
        if (
            _ethRoot == bytes32(0) || 
            _pethRoot == bytes32(0) || 
            _jpegRoot == bytes32(0) || 
            _pethEthRoot == bytes32(0) || 
            _jpegPethRoot == bytes32(0)
        )
        if (_peth == address(0) || _jpeg == address(0))
            revert ZeroAddress();

        if (_expectedPethEthAmount == 0 || _expectedJpegPethAmount == 0)
            revert InvalidAmount();

        ETH_ROOT = _ethRoot;
        PETH_ROOT = _pethRoot;
        JPEG_ROOT = _jpegRoot;
        PETH_ETH_ROOT = _pethEthRoot;
        JPEG_PETH_ROOT = _jpegPethRoot;

        PETH = IERC20(_peth);
        JPEG = IERC20(_jpeg);
        EXPECTED_PETH_ETH_AMOUNT = _expectedPethEthAmount;
        EXPECTED_JPEG_PETH_AMOUNT = _expectedJpegPethAmount;

        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    receive() external payable {}

    function claim(ClaimArguments[] calldata _args) external nonReentrant {
        uint256 _length = _args.length;
        if (_length == 0)
            revert();

        uint256 _receivedPethEthAmount = receivedPethEthAmount;
        if (_receivedPethEthAmount == 0)
            revert ClaimDisabled();

        ClaimData memory _data = claimData[msg.sender];
        for (uint256 i; i < _length; ++i) {
            ClaimArguments memory _curr = _args[i];
            
            if (_curr.asset == ClaimAsset.ETH) {
                if (_data.ethClaimed)
                    revert AlreadyClaimed();
                
                _verifyProof(ETH_ROOT, _curr.proof, msg.sender, _curr.amount);
                _data.ethClaimed = true;
                (bool _sent,) = msg.sender.call{value: _curr.amount}("");
                if (!_sent)
                    revert();
            } else if (_curr.asset == ClaimAsset.PETH) {
                if (_data.pethClaimed)
                    revert AlreadyClaimed();

                _verifyProof(PETH_ROOT, _curr.proof, msg.sender, _curr.amount);
                _data.pethClaimed = true;
                PETH.transfer(msg.sender, _curr.amount);
            } else if (_curr.asset == ClaimAsset.JPEG) {
                if (_data.jpegClaimed)
                    revert AlreadyClaimed();

                _verifyProof(JPEG_ROOT, _curr.proof, msg.sender, _curr.amount);
                _data.jpegClaimed = true;
                JPEG.transfer(msg.sender, _curr.amount);
            } else if (_curr.asset == ClaimAsset.PETH_ETH) {
                if (_data.pethEthClaimed)
                    revert AlreadyClaimed();

                _verifyProof(PETH_ETH_ROOT, _curr.proof, msg.sender, _curr.amount);
                _data.pethEthClaimed = true;
                pethEthLpToken.transfer(msg.sender, _normalizeClaimAmount(EXPECTED_PETH_ETH_AMOUNT, receivedPethEthAmount, _curr.amount));
            } else if (_curr.asset == ClaimAsset.JPEG_PETH) {
                if (_data.jpegPethClaimed)
                    revert AlreadyClaimed();

                _verifyProof(JPEG_PETH_ROOT, _curr.proof, msg.sender, _curr.amount);
                _data.jpegPethClaimed = true;
                jpegPethLpToken.transfer(msg.sender, _normalizeClaimAmount(EXPECTED_JPEG_PETH_AMOUNT, receivedJpegPethAmount, _curr.amount));
            } else
                revert();
        }

        claimData[msg.sender] = _data;
    }

    function enableClaim(IERC20 _pethEthLpToken, IERC20 _jpegPethLpToken) external onlyRole(DEPLOYER_ROLE) {
        if (address(pethEthLpToken) != address(0))
            revert();

        if (address(_pethEthLpToken) == address(0) || address(_jpegPethLpToken) == address(0))
            revert ZeroAddress();

        uint256 _pethEthAmount = _pethEthLpToken.balanceOf(address(this));
        uint256 _jpegPethAmount = _jpegPethLpToken.balanceOf(address(this));
        if (EXPECTED_PETH_ETH_AMOUNT > _pethEthAmount || EXPECTED_JPEG_PETH_AMOUNT > _jpegPethAmount)
            revert InvalidAmount();

        pethEthLpToken = _pethEthLpToken;
        jpegPethLpToken = _jpegPethLpToken;

        receivedPethEthAmount = _pethEthAmount;
        receivedJpegPethAmount = _jpegPethAmount;
    }

    function withdrawETH(address _recipient, uint256 _amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        (bool _sent,) = _recipient.call{value: _amount}("");
        if (!_sent)
            revert();
    }

    function withdrawToken(IERC20 _token, address _recipient, uint256 _amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _token.transfer(_recipient, _amount);
    }

    function _normalizeClaimAmount(uint256 _expectedSupply, uint256 _actualSupply, uint256 _claimAmount) internal pure returns (uint256) {
        return _claimAmount * _actualSupply / _expectedSupply;
    }
    
    function _verifyProof(bytes32 _root, bytes32[] memory _merkleProof, address _account, uint256 _amount) internal pure {
        bytes32 _leaf = keccak256(abi.encodePacked(_account, _amount));
        if (!MerkleProof.verify(_merkleProof, _root, _leaf))
            revert InvalidProof();
    }
}

File 2 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 3 of 12 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (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 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 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) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            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 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 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) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            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)
        }
    }
}

File 4 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 5 of 12 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 6 of 12 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 7 of 12 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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));
    }
}

File 8 of 12 : Context.sol
// 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;
    }
}

File 9 of 12 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 10 of 12 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 11 of 12 : SignedMath.sol
// 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);
        }
    }
}

File 12 of 12 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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);
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bytes32","name":"_ethRoot","type":"bytes32"},{"internalType":"bytes32","name":"_pethRoot","type":"bytes32"},{"internalType":"bytes32","name":"_jpegRoot","type":"bytes32"},{"internalType":"bytes32","name":"_pethEthRoot","type":"bytes32"},{"internalType":"bytes32","name":"_jpegPethRoot","type":"bytes32"},{"internalType":"address","name":"_peth","type":"address"},{"internalType":"address","name":"_jpeg","type":"address"},{"internalType":"uint256","name":"_expectedPethEthAmount","type":"uint256"},{"internalType":"uint256","name":"_expectedJpegPethAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"ClaimDisabled","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidMerkleRoot","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPLOYER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ETH_ROOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXPECTED_JPEG_PETH_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXPECTED_PETH_ETH_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"JPEG","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"JPEG_PETH_ROOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"JPEG_ROOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PETH","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PETH_ETH_ROOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PETH_ROOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"enum TokenClaim.ClaimAsset","name":"asset","type":"uint8"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenClaim.ClaimArguments[]","name":"_args","type":"tuple[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimData","outputs":[{"internalType":"bool","name":"ethClaimed","type":"bool"},{"internalType":"bool","name":"pethClaimed","type":"bool"},{"internalType":"bool","name":"jpegClaimed","type":"bool"},{"internalType":"bool","name":"pethEthClaimed","type":"bool"},{"internalType":"bool","name":"jpegPethClaimed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_pethEthLpToken","type":"address"},{"internalType":"contract IERC20","name":"_jpegPethLpToken","type":"address"}],"name":"enableClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"jpegPethLpToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pethEthLpToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"receivedJpegPethAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"receivedPethEthAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101a06040523480156200001257600080fd5b506040516200331f3803806200331f833981810160405281019062000038919062000478565b600180819055506000801b8914806200005357506000801b88145b806200006157506000801b87145b806200006f57506000801b86145b806200007d57506000801b85145b156200012457600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480620000eb5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b1562000123576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b6000821480620001345750600081145b156200016c576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b88608081815250508760a081815250508660c081815250508560e081815250508461010081815250508373ffffffffffffffffffffffffffffffffffffffff166101208173ffffffffffffffffffffffffffffffffffffffff16815250508273ffffffffffffffffffffffffffffffffffffffff166101408173ffffffffffffffffffffffffffffffffffffffff1681525050816101608181525050806101808181525050620002266000801b336200023560201b60201c565b50505050505050505062000557565b6200024782826200032660201b60201c565b6200032257600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550620002c76200039060201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600033905090565b600080fd5b6000819050919050565b620003b2816200039d565b8114620003be57600080fd5b50565b600081519050620003d281620003a7565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200040582620003d8565b9050919050565b6200041781620003f8565b81146200042357600080fd5b50565b60008151905062000437816200040c565b92915050565b6000819050919050565b62000452816200043d565b81146200045e57600080fd5b50565b600081519050620004728162000447565b92915050565b60008060008060008060008060006101208a8c0312156200049e576200049d62000398565b5b6000620004ae8c828d01620003c1565b9950506020620004c18c828d01620003c1565b9850506040620004d48c828d01620003c1565b9750506060620004e78c828d01620003c1565b9650506080620004fa8c828d01620003c1565b95505060a06200050d8c828d0162000426565b94505060c0620005208c828d0162000426565b93505060e0620005338c828d0162000461565b925050610100620005478c828d0162000461565b9150509295985092959850929598565b60805160a05160c05160e0516101005161012051610140516101605161018051612d0a620006156000396000818161073b015281816109e801526113b10152600081816109bf0152818161122b01526117660152600081816110900152611655015260008181610f3701526116f701526000818161132d015261171b0152600081816111a7015261157901526000818161104e015261159d015260008181610ef501526117ae015260008181610dc4015261162b0152612d0a6000f3fe6080604052600436106101855760003560e01c80639cf8cc7d116100d1578063b615a9591161008a578063e32616c811610064578063e32616c814610581578063ecd00261146105ac578063eebb96c8146105d7578063fa0692bb146106025761018c565b8063b615a95914610502578063bf269a2b1461052d578063d547741f146105585761018c565b80639cf8cc7d146103ea5780639ee6ac2714610415578063a0989a2914610440578063a217fddf1461046b578063a491da1b14610496578063ad23da89146104d75761018c565b806336568abe1161013e578063600a2e2511610118578063600a2e251461032c5780638c5916a4146103575780638ea560531461038257806391d14854146103ad5761018c565b806336568abe146102b15780634782f779146102da578063579a61b4146103035761018c565b806301e336671461019157806301ffc9a7146101ba5780631ed28fb2146101f7578063248a9ca3146102225780632f2ff15d1461025f57806334d86ac9146102885761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101b860048036038101906101b39190611faf565b61062d565b005b3480156101c657600080fd5b506101e160048036038101906101dc919061205a565b6106bf565b6040516101ee91906120a2565b60405180910390f35b34801561020357600080fd5b5061020c610739565b60405161021991906120cc565b60405180910390f35b34801561022e57600080fd5b506102496004803603810190610244919061211d565b61075d565b6040516102569190612159565b60405180910390f35b34801561026b57600080fd5b5061028660048036038101906102819190612174565b61077c565b005b34801561029457600080fd5b506102af60048036038101906102aa91906121b4565b61079d565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612174565b610ad7565b005b3480156102e657600080fd5b5061030160048036038101906102fc91906121f4565b610b5a565b005b34801561030f57600080fd5b5061032a60048036038101906103259190612299565b610be3565b005b34801561033857600080fd5b50610341611551565b60405161034e9190612345565b60405180910390f35b34801561036357600080fd5b5061036c611577565b6040516103799190612159565b60405180910390f35b34801561038e57600080fd5b5061039761159b565b6040516103a49190612159565b60405180910390f35b3480156103b957600080fd5b506103d460048036038101906103cf9190612174565b6115bf565b6040516103e191906120a2565b60405180910390f35b3480156103f657600080fd5b506103ff611629565b60405161040c9190612159565b60405180910390f35b34801561042157600080fd5b5061042a61164d565b60405161043791906120cc565b60405180910390f35b34801561044c57600080fd5b50610455611653565b6040516104629190612345565b60405180910390f35b34801561047757600080fd5b50610480611677565b60405161048d9190612159565b60405180910390f35b3480156104a257600080fd5b506104bd60048036038101906104b89190612360565b61167e565b6040516104ce95949392919061238d565b60405180910390f35b3480156104e357600080fd5b506104ec6116f5565b6040516104f99190612345565b60405180910390f35b34801561050e57600080fd5b50610517611719565b6040516105249190612159565b60405180910390f35b34801561053957600080fd5b5061054261173d565b60405161054f91906120cc565b60405180910390f35b34801561056457600080fd5b5061057f600480360381019061057a9190612174565b611743565b005b34801561058d57600080fd5b50610596611764565b6040516105a391906120cc565b60405180910390f35b3480156105b857600080fd5b506105c1611788565b6040516105ce9190612159565b60405180910390f35b3480156105e357600080fd5b506105ec6117ac565b6040516105f99190612159565b60405180910390f35b34801561060e57600080fd5b506106176117d0565b6040516106249190612345565b60405180910390f35b6000801b61063a816117f6565b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016106759291906123ef565b6020604051808303816000875af1158015610694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b89190612444565b5050505050565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061073257506107318261180a565b5b9050919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806000838152602001908152602001600020600101549050919050565b6107858261075d565b61078e816117f6565b6107988383611874565b505050565b7ffc425f2263d0df187444b70e47283d622c70181c5baebb1306a01edba1ce184c6107c7816117f6565b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806108895750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156108c0576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016108fb9190612471565b602060405180830381865afa158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c91906124a1565b905060008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109799190612471565b602060405180830381865afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba91906124a1565b9050817f00000000000000000000000000000000000000000000000000000000000000001180610a095750807f0000000000000000000000000000000000000000000000000000000000000000115b15610a40576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600481905550806005819055505050505050565b610adf611954565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4390612551565b60405180910390fd5b610b56828261195c565b5050565b6000801b610b67816117f6565b60008373ffffffffffffffffffffffffffffffffffffffff1683604051610b8d906125a2565b60006040518083038185875af1925050503d8060008114610bca576040519150601f19603f3d011682016040523d82523d6000602084013e610bcf565b606091505b5050905080610bdd57600080fd5b50505050565b610beb611a3d565b600082829050905060008103610c0057600080fd5b6000600454905060008103610c41576040517f8fab9a5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060a00160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a900460ff161515151581526020016000820160039054906101000a900460ff161515151581526020016000820160049054906101000a900460ff161515151581525050905060005b8381101561145e576000868683818110610d3657610d356125b7565b5b9050602002810190610d4891906125eb565b610d5190612811565b905060006004811115610d6757610d66612824565b5b81600001516004811115610d7e57610d7d612824565b5b03610e8457826000015115610dbf576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610df37f00000000000000000000000000000000000000000000000000000000000000008260200151338460400151611a8c565b600183600001901515908115158152505060003373ffffffffffffffffffffffffffffffffffffffff168260400151604051610e2e906125a2565b60006040518083038185875af1925050503d8060008114610e6b576040519150601f19603f3d011682016040523d82523d6000602084013e610e70565b606091505b5050905080610e7e57600080fd5b5061144c565b60016004811115610e9857610e97612824565b5b81600001516004811115610eaf57610eae612824565b5b03610fdd57826020015115610ef0576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f247f00000000000000000000000000000000000000000000000000000000000000008260200151338460400151611a8c565b60018360200190151590811515815250507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383604001516040518363ffffffff1660e01b8152600401610f949291906123ef565b6020604051808303816000875af1158015610fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd79190612444565b5061144b565b60026004811115610ff157610ff0612824565b5b8160000151600481111561100857611007612824565b5b0361113657826040015115611049576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61107d7f00000000000000000000000000000000000000000000000000000000000000008260200151338460400151611a8c565b60018360400190151590811515815250507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383604001516040518363ffffffff1660e01b81526004016110ed9291906123ef565b6020604051808303816000875af115801561110c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111309190612444565b5061144a565b6003600481111561114a57611149612824565b5b8160000151600481111561116157611160612824565b5b036112bd578260600151156111a2576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111d67f00000000000000000000000000000000000000000000000000000000000000008260200151338460400151611a8c565b6001836060019015159081151581525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336112577f00000000000000000000000000000000000000000000000000000000000000006004548660400151611b01565b6040518363ffffffff1660e01b81526004016112749291906123ef565b6020604051808303816000875af1158015611293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b79190612444565b50611449565b6004808111156112d0576112cf612824565b5b816000015160048111156112e7576112e6612824565b5b0361144357826080015115611328576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61135c7f00000000000000000000000000000000000000000000000000000000000000008260200151338460400151611a8c565b6001836080019015159081151581525050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336113dd7f00000000000000000000000000000000000000000000000000000000000000006005548660400151611b01565b6040518363ffffffff1660e01b81526004016113fa9291906123ef565b6020604051808303816000875af1158015611419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143d9190612444565b50611448565b600080fd5b5b5b5b5b508061145790612882565b9050610d19565b5080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff02191690831515021790555060408201518160000160026101000a81548160ff02191690831515021790555060608201518160000160036101000a81548160ff02191690831515021790555060808201518160000160046101000a81548160ff02191690831515021790555090505050505061154d611b23565b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60045481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000801b81565b60066020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060000160039054906101000a900460ff16908060000160049054906101000a900460ff16905085565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60055481565b61174c8261075d565b611755816117f6565b61175f838361195c565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7ffc425f2263d0df187444b70e47283d622c70181c5baebb1306a01edba1ce184c81565b7f000000000000000000000000000000000000000000000000000000000000000081565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61180781611802611954565b611b2c565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61187e82826115bf565b61195057600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118f5611954565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b61196682826115bf565b15611a3957600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119de611954565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b600260015403611a82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7990612916565b60405180910390fd5b6002600181905550565b60008282604051602001611aa192919061299f565b604051602081830303815290604052805190602001209050611ac4848683611bb1565b611afa576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b6000838383611b1091906129cb565b611b1a9190612a3c565b90509392505050565b60018081905550565b611b3682826115bf565b611bad57611b4381611bc8565b611b518360001c6020611bf5565b604051602001611b62929190612b76565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba49190612be9565b60405180910390fd5b5050565b600082611bbe8584611e31565b1490509392505050565b6060611bee8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611bf5565b9050919050565b606060006002836002611c0891906129cb565b611c129190612c0b565b67ffffffffffffffff811115611c2b57611c2a612629565b5b6040519080825280601f01601f191660200182016040528015611c5d5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c9557611c946125b7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cf957611cf86125b7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611d3991906129cb565b611d439190612c0b565b90505b6001811115611de3577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d8557611d846125b7565b5b1a60f81b828281518110611d9c57611d9b6125b7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611ddc90612c3f565b9050611d46565b5060008414611e27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1e90612cb4565b60405180910390fd5b8091505092915050565b60008082905060005b8451811015611e7c57611e6782868381518110611e5a57611e596125b7565b5b6020026020010151611e87565b91508080611e7490612882565b915050611e3a565b508091505092915050565b6000818310611e9f57611e9a8284611eb2565b611eaa565b611ea98383611eb2565b5b905092915050565b600082600052816020526040600020905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611f0882611edd565b9050919050565b6000611f1a82611efd565b9050919050565b611f2a81611f0f565b8114611f3557600080fd5b50565b600081359050611f4781611f21565b92915050565b611f5681611efd565b8114611f6157600080fd5b50565b600081359050611f7381611f4d565b92915050565b6000819050919050565b611f8c81611f79565b8114611f9757600080fd5b50565b600081359050611fa981611f83565b92915050565b600080600060608486031215611fc857611fc7611ed3565b5b6000611fd686828701611f38565b9350506020611fe786828701611f64565b9250506040611ff886828701611f9a565b9150509250925092565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61203781612002565b811461204257600080fd5b50565b6000813590506120548161202e565b92915050565b6000602082840312156120705761206f611ed3565b5b600061207e84828501612045565b91505092915050565b60008115159050919050565b61209c81612087565b82525050565b60006020820190506120b76000830184612093565b92915050565b6120c681611f79565b82525050565b60006020820190506120e160008301846120bd565b92915050565b6000819050919050565b6120fa816120e7565b811461210557600080fd5b50565b600081359050612117816120f1565b92915050565b60006020828403121561213357612132611ed3565b5b600061214184828501612108565b91505092915050565b612153816120e7565b82525050565b600060208201905061216e600083018461214a565b92915050565b6000806040838503121561218b5761218a611ed3565b5b600061219985828601612108565b92505060206121aa85828601611f64565b9150509250929050565b600080604083850312156121cb576121ca611ed3565b5b60006121d985828601611f38565b92505060206121ea85828601611f38565b9150509250929050565b6000806040838503121561220b5761220a611ed3565b5b600061221985828601611f64565b925050602061222a85828601611f9a565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f84011261225957612258612234565b5b8235905067ffffffffffffffff81111561227657612275612239565b5b6020830191508360208202830111156122925761229161223e565b5b9250929050565b600080602083850312156122b0576122af611ed3565b5b600083013567ffffffffffffffff8111156122ce576122cd611ed8565b5b6122da85828601612243565b92509250509250929050565b6000819050919050565b600061230b61230661230184611edd565b6122e6565b611edd565b9050919050565b600061231d826122f0565b9050919050565b600061232f82612312565b9050919050565b61233f81612324565b82525050565b600060208201905061235a6000830184612336565b92915050565b60006020828403121561237657612375611ed3565b5b600061238484828501611f64565b91505092915050565b600060a0820190506123a26000830188612093565b6123af6020830187612093565b6123bc6040830186612093565b6123c96060830185612093565b6123d66080830184612093565b9695505050505050565b6123e981611efd565b82525050565b600060408201905061240460008301856123e0565b61241160208301846120bd565b9392505050565b61242181612087565b811461242c57600080fd5b50565b60008151905061243e81612418565b92915050565b60006020828403121561245a57612459611ed3565b5b60006124688482850161242f565b91505092915050565b600060208201905061248660008301846123e0565b92915050565b60008151905061249b81611f83565b92915050565b6000602082840312156124b7576124b6611ed3565b5b60006124c58482850161248c565b91505092915050565b600082825260208201905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b600061253b602f836124ce565b9150612546826124df565b604082019050919050565b6000602082019050818103600083015261256a8161252e565b9050919050565b600081905092915050565b50565b600061258c600083612571565b91506125978261257c565b600082019050919050565b60006125ad8261257f565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600082356001606003833603038112612607576126066125e6565b5b80830191505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61266182612618565b810181811067ffffffffffffffff821117156126805761267f612629565b5b80604052505050565b6000612693611ec9565b905061269f8282612658565b919050565b600080fd5b600581106126b657600080fd5b50565b6000813590506126c8816126a9565b92915050565b600067ffffffffffffffff8211156126e9576126e8612629565b5b602082029050602081019050919050565b600061270d612708846126ce565b612689565b905080838252602082019050602084028301858111156127305761272f61223e565b5b835b8181101561275957806127458882612108565b845260208401935050602081019050612732565b5050509392505050565b600082601f83011261277857612777612234565b5b81356127888482602086016126fa565b91505092915050565b6000606082840312156127a7576127a6612613565b5b6127b16060612689565b905060006127c1848285016126b9565b600083015250602082013567ffffffffffffffff8111156127e5576127e46126a4565b5b6127f184828501612763565b602083015250604061280584828501611f9a565b60408301525092915050565b600061281d3683612791565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061288d82611f79565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036128bf576128be612853565b5b600182019050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000612900601f836124ce565b915061290b826128ca565b602082019050919050565b6000602082019050818103600083015261292f816128f3565b9050919050565b60008160601b9050919050565b600061294e82612936565b9050919050565b600061296082612943565b9050919050565b61297861297382611efd565b612955565b82525050565b6000819050919050565b61299961299482611f79565b61297e565b82525050565b60006129ab8285612967565b6014820191506129bb8284612988565b6020820191508190509392505050565b60006129d682611f79565b91506129e183611f79565b92508282026129ef81611f79565b91508282048414831517612a0657612a05612853565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612a4782611f79565b9150612a5283611f79565b925082612a6257612a61612a0d565b5b828204905092915050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612aae601783612a6d565b9150612ab982612a78565b601782019050919050565b600081519050919050565b60005b83811015612aed578082015181840152602081019050612ad2565b60008484015250505050565b6000612b0482612ac4565b612b0e8185612a6d565b9350612b1e818560208601612acf565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612b60601183612a6d565b9150612b6b82612b2a565b601182019050919050565b6000612b8182612aa1565b9150612b8d8285612af9565b9150612b9882612b53565b9150612ba48284612af9565b91508190509392505050565b6000612bbb82612ac4565b612bc581856124ce565b9350612bd5818560208601612acf565b612bde81612618565b840191505092915050565b60006020820190508181036000830152612c038184612bb0565b905092915050565b6000612c1682611f79565b9150612c2183611f79565b9250828201905080821115612c3957612c38612853565b5b92915050565b6000612c4a82611f79565b915060008203612c5d57612c5c612853565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000612c9e6020836124ce565b9150612ca982612c68565b602082019050919050565b60006020820190508181036000830152612ccd81612c91565b905091905056fea2646970667358221220d8b676cd40dbb6080cdc4f35dfee05bc62ca41907515826170da7966ea5b9b2a64736f6c63430008120033c1888530c3af9c908ef0491ad33310eba4271adddfe6cbd3d53ce9b0ac03eb2220bc0010e4c216b2972d139d1a00094dc55a09d9f3abdaae7daa766fb541b46190f6db8375db90e1c8b710d2fcfca5548e169e1522fda9553a71df9416a9eac4313db4031b22a9edfb95b0e7dc5001badf5de726b5adff657ba1b15b08297d99116df830c38f0f882291fae62aba70d29b5416e2e75396dbab8465c40b3be140000000000000000000000000821a278dfff762c76410264303f25bf42e195c0c000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a3000000000000000000000000000000000000000000000214748edb94a2623000000000000000000000000000000000000000000000012abf78b1e762db588000

Deployed Bytecode

0x6080604052600436106101855760003560e01c80639cf8cc7d116100d1578063b615a9591161008a578063e32616c811610064578063e32616c814610581578063ecd00261146105ac578063eebb96c8146105d7578063fa0692bb146106025761018c565b8063b615a95914610502578063bf269a2b1461052d578063d547741f146105585761018c565b80639cf8cc7d146103ea5780639ee6ac2714610415578063a0989a2914610440578063a217fddf1461046b578063a491da1b14610496578063ad23da89146104d75761018c565b806336568abe1161013e578063600a2e2511610118578063600a2e251461032c5780638c5916a4146103575780638ea560531461038257806391d14854146103ad5761018c565b806336568abe146102b15780634782f779146102da578063579a61b4146103035761018c565b806301e336671461019157806301ffc9a7146101ba5780631ed28fb2146101f7578063248a9ca3146102225780632f2ff15d1461025f57806334d86ac9146102885761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101b860048036038101906101b39190611faf565b61062d565b005b3480156101c657600080fd5b506101e160048036038101906101dc919061205a565b6106bf565b6040516101ee91906120a2565b60405180910390f35b34801561020357600080fd5b5061020c610739565b60405161021991906120cc565b60405180910390f35b34801561022e57600080fd5b506102496004803603810190610244919061211d565b61075d565b6040516102569190612159565b60405180910390f35b34801561026b57600080fd5b5061028660048036038101906102819190612174565b61077c565b005b34801561029457600080fd5b506102af60048036038101906102aa91906121b4565b61079d565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612174565b610ad7565b005b3480156102e657600080fd5b5061030160048036038101906102fc91906121f4565b610b5a565b005b34801561030f57600080fd5b5061032a60048036038101906103259190612299565b610be3565b005b34801561033857600080fd5b50610341611551565b60405161034e9190612345565b60405180910390f35b34801561036357600080fd5b5061036c611577565b6040516103799190612159565b60405180910390f35b34801561038e57600080fd5b5061039761159b565b6040516103a49190612159565b60405180910390f35b3480156103b957600080fd5b506103d460048036038101906103cf9190612174565b6115bf565b6040516103e191906120a2565b60405180910390f35b3480156103f657600080fd5b506103ff611629565b60405161040c9190612159565b60405180910390f35b34801561042157600080fd5b5061042a61164d565b60405161043791906120cc565b60405180910390f35b34801561044c57600080fd5b50610455611653565b6040516104629190612345565b60405180910390f35b34801561047757600080fd5b50610480611677565b60405161048d9190612159565b60405180910390f35b3480156104a257600080fd5b506104bd60048036038101906104b89190612360565b61167e565b6040516104ce95949392919061238d565b60405180910390f35b3480156104e357600080fd5b506104ec6116f5565b6040516104f99190612345565b60405180910390f35b34801561050e57600080fd5b50610517611719565b6040516105249190612159565b60405180910390f35b34801561053957600080fd5b5061054261173d565b60405161054f91906120cc565b60405180910390f35b34801561056457600080fd5b5061057f600480360381019061057a9190612174565b611743565b005b34801561058d57600080fd5b50610596611764565b6040516105a391906120cc565b60405180910390f35b3480156105b857600080fd5b506105c1611788565b6040516105ce9190612159565b60405180910390f35b3480156105e357600080fd5b506105ec6117ac565b6040516105f99190612159565b60405180910390f35b34801561060e57600080fd5b506106176117d0565b6040516106249190612345565b60405180910390f35b6000801b61063a816117f6565b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b81526004016106759291906123ef565b6020604051808303816000875af1158015610694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b89190612444565b5050505050565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061073257506107318261180a565b5b9050919050565b7f000000000000000000000000000000000000000000012abf78b1e762db58800081565b6000806000838152602001908152602001600020600101549050919050565b6107858261075d565b61078e816117f6565b6107988383611874565b505050565b7ffc425f2263d0df187444b70e47283d622c70181c5baebb1306a01edba1ce184c6107c7816117f6565b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806108895750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156108c0576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016108fb9190612471565b602060405180830381865afa158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c91906124a1565b905060008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109799190612471565b602060405180830381865afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba91906124a1565b9050817f000000000000000000000000000000000000000000000214748edb94a26230001180610a095750807f000000000000000000000000000000000000000000012abf78b1e762db588000115b15610a40576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600481905550806005819055505050505050565b610adf611954565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4390612551565b60405180910390fd5b610b56828261195c565b5050565b6000801b610b67816117f6565b60008373ffffffffffffffffffffffffffffffffffffffff1683604051610b8d906125a2565b60006040518083038185875af1925050503d8060008114610bca576040519150601f19603f3d011682016040523d82523d6000602084013e610bcf565b606091505b5050905080610bdd57600080fd5b50505050565b610beb611a3d565b600082829050905060008103610c0057600080fd5b6000600454905060008103610c41576040517f8fab9a5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060a00160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a900460ff161515151581526020016000820160039054906101000a900460ff161515151581526020016000820160049054906101000a900460ff161515151581525050905060005b8381101561145e576000868683818110610d3657610d356125b7565b5b9050602002810190610d4891906125eb565b610d5190612811565b905060006004811115610d6757610d66612824565b5b81600001516004811115610d7e57610d7d612824565b5b03610e8457826000015115610dbf576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610df37fc1888530c3af9c908ef0491ad33310eba4271adddfe6cbd3d53ce9b0ac03eb228260200151338460400151611a8c565b600183600001901515908115158152505060003373ffffffffffffffffffffffffffffffffffffffff168260400151604051610e2e906125a2565b60006040518083038185875af1925050503d8060008114610e6b576040519150601f19603f3d011682016040523d82523d6000602084013e610e70565b606091505b5050905080610e7e57600080fd5b5061144c565b60016004811115610e9857610e97612824565b5b81600001516004811115610eaf57610eae612824565b5b03610fdd57826020015115610ef0576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f247f20bc0010e4c216b2972d139d1a00094dc55a09d9f3abdaae7daa766fb541b4618260200151338460400151611a8c565b60018360200190151590811515815250507f000000000000000000000000821a278dfff762c76410264303f25bf42e195c0c73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383604001516040518363ffffffff1660e01b8152600401610f949291906123ef565b6020604051808303816000875af1158015610fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd79190612444565b5061144b565b60026004811115610ff157610ff0612824565b5b8160000151600481111561100857611007612824565b5b0361113657826040015115611049576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61107d7f90f6db8375db90e1c8b710d2fcfca5548e169e1522fda9553a71df9416a9eac48260200151338460400151611a8c565b60018360400190151590811515815250507f000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383604001516040518363ffffffff1660e01b81526004016110ed9291906123ef565b6020604051808303816000875af115801561110c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111309190612444565b5061144a565b6003600481111561114a57611149612824565b5b8160000151600481111561116157611160612824565b5b036112bd578260600151156111a2576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111d67f313db4031b22a9edfb95b0e7dc5001badf5de726b5adff657ba1b15b08297d998260200151338460400151611a8c565b6001836060019015159081151581525050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336112577f000000000000000000000000000000000000000000000214748edb94a26230006004548660400151611b01565b6040518363ffffffff1660e01b81526004016112749291906123ef565b6020604051808303816000875af1158015611293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b79190612444565b50611449565b6004808111156112d0576112cf612824565b5b816000015160048111156112e7576112e6612824565b5b0361144357826080015115611328576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61135c7f116df830c38f0f882291fae62aba70d29b5416e2e75396dbab8465c40b3be1408260200151338460400151611a8c565b6001836080019015159081151581525050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336113dd7f000000000000000000000000000000000000000000012abf78b1e762db5880006005548660400151611b01565b6040518363ffffffff1660e01b81526004016113fa9291906123ef565b6020604051808303816000875af1158015611419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143d9190612444565b50611448565b600080fd5b5b5b5b5b508061145790612882565b9050610d19565b5080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff02191690831515021790555060408201518160000160026101000a81548160ff02191690831515021790555060608201518160000160036101000a81548160ff02191690831515021790555060808201518160000160046101000a81548160ff02191690831515021790555090505050505061154d611b23565b5050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f313db4031b22a9edfb95b0e7dc5001badf5de726b5adff657ba1b15b08297d9981565b7f90f6db8375db90e1c8b710d2fcfca5548e169e1522fda9553a71df9416a9eac481565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b7fc1888530c3af9c908ef0491ad33310eba4271adddfe6cbd3d53ce9b0ac03eb2281565b60045481565b7f000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a381565b6000801b81565b60066020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900460ff16908060000160039054906101000a900460ff16908060000160049054906101000a900460ff16905085565b7f000000000000000000000000821a278dfff762c76410264303f25bf42e195c0c81565b7f116df830c38f0f882291fae62aba70d29b5416e2e75396dbab8465c40b3be14081565b60055481565b61174c8261075d565b611755816117f6565b61175f838361195c565b505050565b7f000000000000000000000000000000000000000000000214748edb94a262300081565b7ffc425f2263d0df187444b70e47283d622c70181c5baebb1306a01edba1ce184c81565b7f20bc0010e4c216b2972d139d1a00094dc55a09d9f3abdaae7daa766fb541b46181565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61180781611802611954565b611b2c565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61187e82826115bf565b61195057600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506118f5611954565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b61196682826115bf565b15611a3957600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119de611954565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b600260015403611a82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7990612916565b60405180910390fd5b6002600181905550565b60008282604051602001611aa192919061299f565b604051602081830303815290604052805190602001209050611ac4848683611bb1565b611afa576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b6000838383611b1091906129cb565b611b1a9190612a3c565b90509392505050565b60018081905550565b611b3682826115bf565b611bad57611b4381611bc8565b611b518360001c6020611bf5565b604051602001611b62929190612b76565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba49190612be9565b60405180910390fd5b5050565b600082611bbe8584611e31565b1490509392505050565b6060611bee8273ffffffffffffffffffffffffffffffffffffffff16601460ff16611bf5565b9050919050565b606060006002836002611c0891906129cb565b611c129190612c0b565b67ffffffffffffffff811115611c2b57611c2a612629565b5b6040519080825280601f01601f191660200182016040528015611c5d5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611c9557611c946125b7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611cf957611cf86125b7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002611d3991906129cb565b611d439190612c0b565b90505b6001811115611de3577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110611d8557611d846125b7565b5b1a60f81b828281518110611d9c57611d9b6125b7565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611ddc90612c3f565b9050611d46565b5060008414611e27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1e90612cb4565b60405180910390fd5b8091505092915050565b60008082905060005b8451811015611e7c57611e6782868381518110611e5a57611e596125b7565b5b6020026020010151611e87565b91508080611e7490612882565b915050611e3a565b508091505092915050565b6000818310611e9f57611e9a8284611eb2565b611eaa565b611ea98383611eb2565b5b905092915050565b600082600052816020526040600020905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611f0882611edd565b9050919050565b6000611f1a82611efd565b9050919050565b611f2a81611f0f565b8114611f3557600080fd5b50565b600081359050611f4781611f21565b92915050565b611f5681611efd565b8114611f6157600080fd5b50565b600081359050611f7381611f4d565b92915050565b6000819050919050565b611f8c81611f79565b8114611f9757600080fd5b50565b600081359050611fa981611f83565b92915050565b600080600060608486031215611fc857611fc7611ed3565b5b6000611fd686828701611f38565b9350506020611fe786828701611f64565b9250506040611ff886828701611f9a565b9150509250925092565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61203781612002565b811461204257600080fd5b50565b6000813590506120548161202e565b92915050565b6000602082840312156120705761206f611ed3565b5b600061207e84828501612045565b91505092915050565b60008115159050919050565b61209c81612087565b82525050565b60006020820190506120b76000830184612093565b92915050565b6120c681611f79565b82525050565b60006020820190506120e160008301846120bd565b92915050565b6000819050919050565b6120fa816120e7565b811461210557600080fd5b50565b600081359050612117816120f1565b92915050565b60006020828403121561213357612132611ed3565b5b600061214184828501612108565b91505092915050565b612153816120e7565b82525050565b600060208201905061216e600083018461214a565b92915050565b6000806040838503121561218b5761218a611ed3565b5b600061219985828601612108565b92505060206121aa85828601611f64565b9150509250929050565b600080604083850312156121cb576121ca611ed3565b5b60006121d985828601611f38565b92505060206121ea85828601611f38565b9150509250929050565b6000806040838503121561220b5761220a611ed3565b5b600061221985828601611f64565b925050602061222a85828601611f9a565b9150509250929050565b600080fd5b600080fd5b600080fd5b60008083601f84011261225957612258612234565b5b8235905067ffffffffffffffff81111561227657612275612239565b5b6020830191508360208202830111156122925761229161223e565b5b9250929050565b600080602083850312156122b0576122af611ed3565b5b600083013567ffffffffffffffff8111156122ce576122cd611ed8565b5b6122da85828601612243565b92509250509250929050565b6000819050919050565b600061230b61230661230184611edd565b6122e6565b611edd565b9050919050565b600061231d826122f0565b9050919050565b600061232f82612312565b9050919050565b61233f81612324565b82525050565b600060208201905061235a6000830184612336565b92915050565b60006020828403121561237657612375611ed3565b5b600061238484828501611f64565b91505092915050565b600060a0820190506123a26000830188612093565b6123af6020830187612093565b6123bc6040830186612093565b6123c96060830185612093565b6123d66080830184612093565b9695505050505050565b6123e981611efd565b82525050565b600060408201905061240460008301856123e0565b61241160208301846120bd565b9392505050565b61242181612087565b811461242c57600080fd5b50565b60008151905061243e81612418565b92915050565b60006020828403121561245a57612459611ed3565b5b60006124688482850161242f565b91505092915050565b600060208201905061248660008301846123e0565b92915050565b60008151905061249b81611f83565b92915050565b6000602082840312156124b7576124b6611ed3565b5b60006124c58482850161248c565b91505092915050565b600082825260208201905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b600061253b602f836124ce565b9150612546826124df565b604082019050919050565b6000602082019050818103600083015261256a8161252e565b9050919050565b600081905092915050565b50565b600061258c600083612571565b91506125978261257c565b600082019050919050565b60006125ad8261257f565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600082356001606003833603038112612607576126066125e6565b5b80830191505092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61266182612618565b810181811067ffffffffffffffff821117156126805761267f612629565b5b80604052505050565b6000612693611ec9565b905061269f8282612658565b919050565b600080fd5b600581106126b657600080fd5b50565b6000813590506126c8816126a9565b92915050565b600067ffffffffffffffff8211156126e9576126e8612629565b5b602082029050602081019050919050565b600061270d612708846126ce565b612689565b905080838252602082019050602084028301858111156127305761272f61223e565b5b835b8181101561275957806127458882612108565b845260208401935050602081019050612732565b5050509392505050565b600082601f83011261277857612777612234565b5b81356127888482602086016126fa565b91505092915050565b6000606082840312156127a7576127a6612613565b5b6127b16060612689565b905060006127c1848285016126b9565b600083015250602082013567ffffffffffffffff8111156127e5576127e46126a4565b5b6127f184828501612763565b602083015250604061280584828501611f9a565b60408301525092915050565b600061281d3683612791565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061288d82611f79565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036128bf576128be612853565b5b600182019050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000612900601f836124ce565b915061290b826128ca565b602082019050919050565b6000602082019050818103600083015261292f816128f3565b9050919050565b60008160601b9050919050565b600061294e82612936565b9050919050565b600061296082612943565b9050919050565b61297861297382611efd565b612955565b82525050565b6000819050919050565b61299961299482611f79565b61297e565b82525050565b60006129ab8285612967565b6014820191506129bb8284612988565b6020820191508190509392505050565b60006129d682611f79565b91506129e183611f79565b92508282026129ef81611f79565b91508282048414831517612a0657612a05612853565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612a4782611f79565b9150612a5283611f79565b925082612a6257612a61612a0d565b5b828204905092915050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000612aae601783612a6d565b9150612ab982612a78565b601782019050919050565b600081519050919050565b60005b83811015612aed578082015181840152602081019050612ad2565b60008484015250505050565b6000612b0482612ac4565b612b0e8185612a6d565b9350612b1e818560208601612acf565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000612b60601183612a6d565b9150612b6b82612b2a565b601182019050919050565b6000612b8182612aa1565b9150612b8d8285612af9565b9150612b9882612b53565b9150612ba48284612af9565b91508190509392505050565b6000612bbb82612ac4565b612bc581856124ce565b9350612bd5818560208601612acf565b612bde81612618565b840191505092915050565b60006020820190508181036000830152612c038184612bb0565b905092915050565b6000612c1682611f79565b9150612c2183611f79565b9250828201905080821115612c3957612c38612853565b5b92915050565b6000612c4a82611f79565b915060008203612c5d57612c5c612853565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000612c9e6020836124ce565b9150612ca982612c68565b602082019050919050565b60006020820190508181036000830152612ccd81612c91565b905091905056fea2646970667358221220d8b676cd40dbb6080cdc4f35dfee05bc62ca41907515826170da7966ea5b9b2a64736f6c63430008120033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

c1888530c3af9c908ef0491ad33310eba4271adddfe6cbd3d53ce9b0ac03eb2220bc0010e4c216b2972d139d1a00094dc55a09d9f3abdaae7daa766fb541b46190f6db8375db90e1c8b710d2fcfca5548e169e1522fda9553a71df9416a9eac4313db4031b22a9edfb95b0e7dc5001badf5de726b5adff657ba1b15b08297d99116df830c38f0f882291fae62aba70d29b5416e2e75396dbab8465c40b3be140000000000000000000000000821a278dfff762c76410264303f25bf42e195c0c000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a3000000000000000000000000000000000000000000000214748edb94a2623000000000000000000000000000000000000000000000012abf78b1e762db588000

-----Decoded View---------------
Arg [0] : _ethRoot (bytes32): 0xc1888530c3af9c908ef0491ad33310eba4271adddfe6cbd3d53ce9b0ac03eb22
Arg [1] : _pethRoot (bytes32): 0x20bc0010e4c216b2972d139d1a00094dc55a09d9f3abdaae7daa766fb541b461
Arg [2] : _jpegRoot (bytes32): 0x90f6db8375db90e1c8b710d2fcfca5548e169e1522fda9553a71df9416a9eac4
Arg [3] : _pethEthRoot (bytes32): 0x313db4031b22a9edfb95b0e7dc5001badf5de726b5adff657ba1b15b08297d99
Arg [4] : _jpegPethRoot (bytes32): 0x116df830c38f0f882291fae62aba70d29b5416e2e75396dbab8465c40b3be140
Arg [5] : _peth (address): 0x821A278dFff762c76410264303F25bF42e195C0C
Arg [6] : _jpeg (address): 0xE80C0cd204D654CEbe8dd64A4857cAb6Be8345a3
Arg [7] : _expectedPethEthAmount (uint256): 9822066739000000000000
Arg [8] : _expectedJpegPethAmount (uint256): 1410797237000000000000000

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : c1888530c3af9c908ef0491ad33310eba4271adddfe6cbd3d53ce9b0ac03eb22
Arg [1] : 20bc0010e4c216b2972d139d1a00094dc55a09d9f3abdaae7daa766fb541b461
Arg [2] : 90f6db8375db90e1c8b710d2fcfca5548e169e1522fda9553a71df9416a9eac4
Arg [3] : 313db4031b22a9edfb95b0e7dc5001badf5de726b5adff657ba1b15b08297d99
Arg [4] : 116df830c38f0f882291fae62aba70d29b5416e2e75396dbab8465c40b3be140
Arg [5] : 000000000000000000000000821a278dfff762c76410264303f25bf42e195c0c
Arg [6] : 000000000000000000000000e80c0cd204d654cebe8dd64a4857cab6be8345a3
Arg [7] : 000000000000000000000000000000000000000000000214748edb94a2623000
Arg [8] : 000000000000000000000000000000000000000000012abf78b1e762db588000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.