ETH Price: $2,358.33 (+5.03%)

Contract

0xdA0DfC728112Ce625febFF9859C9f31E537de1fE
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Claim Enable...187289252023-12-06 18:00:23452 days ago1701885623IN
0xdA0DfC72...E537de1fE
0 ETH0.0021135373.6193868
Claim With Boxes187288062023-12-06 17:36:11452 days ago1701884171IN
0xdA0DfC72...E537de1fE
0 ETH0.0190414266.68098555
Claim With Boxes187286622023-12-06 17:07:11452 days ago1701882431IN
0xdA0DfC72...E537de1fE
0 ETH0.0178349466.7883089
Buy Earned Boxes187286512023-12-06 17:04:59452 days ago1701882299IN
0xdA0DfC72...E537de1fE
0 ETH0.0100709363.95297764
Buy Earned Boxes187285342023-12-06 16:41:35452 days ago1701880895IN
0xdA0DfC72...E537de1fE
0 ETH0.0081139764.33838031
Buy Earned Boxes187285242023-12-06 16:39:23452 days ago1701880763IN
0xdA0DfC72...E537de1fE
0 ETH0.0075268868.41810372
Claim With Boxes187285082023-12-06 16:36:11452 days ago1701880571IN
0xdA0DfC72...E537de1fE
0 ETH0.0171621870.74358966
Claim With Boxes187285002023-12-06 16:34:23452 days ago1701880463IN
0xdA0DfC72...E537de1fE
0 ETH0.0176144772.61515253
Claim With Boxes187284732023-12-06 16:28:59452 days ago1701880139IN
0xdA0DfC72...E537de1fE
0 ETH0.0150088361.86988843
Buy Earned Boxes187284732023-12-06 16:28:59452 days ago1701880139IN
0xdA0DfC72...E537de1fE
0 ETH0.0088045161.86988843
Buy Earned Boxes187284592023-12-06 16:26:11452 days ago1701879971IN
0xdA0DfC72...E537de1fE
0 ETH0.0077304462.87318731
Buy Earned Boxes187283842023-12-06 16:10:47452 days ago1701879047IN
0xdA0DfC72...E537de1fE
0.2212 ETH0.0086789673.73179048
Claim With Boxes187283272023-12-06 15:59:11452 days ago1701878351IN
0xdA0DfC72...E537de1fE
0 ETH0.0130867667.261672
Buy Earned Boxes187283252023-12-06 15:58:47452 days ago1701878327IN
0xdA0DfC72...E537de1fE
0 ETH0.0082664868.14123179
Claim With Boxes187281902023-12-06 15:31:35452 days ago1701876695IN
0xdA0DfC72...E537de1fE
0 ETH0.0197471266.09849127
Buy Earned Boxes187281622023-12-06 15:25:59452 days ago1701876359IN
0xdA0DfC72...E537de1fE
0.1106 ETH0.0072365162.50386681
Claim With Boxes187279332023-12-06 14:38:59452 days ago1701873539IN
0xdA0DfC72...E537de1fE
0 ETH0.0108210765.02581067
Claim With Boxes187279102023-12-06 14:33:59452 days ago1701873239IN
0xdA0DfC72...E537de1fE
0 ETH0.0130611366.5640865
Claim With Boxes187278862023-12-06 14:28:59452 days ago1701872939IN
0xdA0DfC72...E537de1fE
0.1106 ETH0.0133818257.62090876
Claim With Boxes187278332023-12-06 14:17:59452 days ago1701872279IN
0xdA0DfC72...E537de1fE
0 ETH0.0207153257.19448898
Buy Earned Boxes187277772023-12-06 14:06:47452 days ago1701871607IN
0xdA0DfC72...E537de1fE
0.4424 ETH0.0074920659.28392462
Claim With Boxes187274152023-12-06 12:53:47452 days ago1701867227IN
0xdA0DfC72...E537de1fE
0 ETH0.014019552.50103585
Buy Earned Boxes187274132023-12-06 12:53:23452 days ago1701867203IN
0xdA0DfC72...E537de1fE
0 ETH0.0088052452.41122993
Claim With Boxes187273642023-12-06 12:43:35452 days ago1701866615IN
0xdA0DfC72...E537de1fE
0 ETH0.008666952.08539055
Claim With Boxes187272692023-12-06 12:24:35452 days ago1701865475IN
0xdA0DfC72...E537de1fE
0 ETH0.008965353.07111223
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
187283842023-12-06 16:10:47452 days ago1701879047
0xdA0DfC72...E537de1fE
0.2212 ETH
187281622023-12-06 15:25:59452 days ago1701876359
0xdA0DfC72...E537de1fE
0.1106 ETH
187278862023-12-06 14:28:59452 days ago1701872939
0xdA0DfC72...E537de1fE
0.1106 ETH
187277772023-12-06 14:06:47452 days ago1701871607
0xdA0DfC72...E537de1fE
0.4424 ETH
187271542023-12-06 12:01:23452 days ago1701864083
0xdA0DfC72...E537de1fE
0.1106 ETH
187266502023-12-06 10:20:23453 days ago1701858023
0xdA0DfC72...E537de1fE
0.1106 ETH
187249572023-12-06 4:38:59453 days ago1701837539
0xdA0DfC72...E537de1fE
0.1106 ETH
187249192023-12-06 4:31:11453 days ago1701837071
0xdA0DfC72...E537de1fE
0.1106 ETH
187247172023-12-06 3:50:35453 days ago1701834635
0xdA0DfC72...E537de1fE
0.1106 ETH
187236792023-12-06 0:20:35453 days ago1701822035
0xdA0DfC72...E537de1fE
0.1106 ETH
187235592023-12-05 23:56:11453 days ago1701820571
0xdA0DfC72...E537de1fE
0.4424 ETH
187227542023-12-05 21:14:23453 days ago1701810863
0xdA0DfC72...E537de1fE
0.1106 ETH
187222982023-12-05 19:42:59453 days ago1701805379
0xdA0DfC72...E537de1fE
0.1106 ETH
187216322023-12-05 17:28:11453 days ago1701797291
0xdA0DfC72...E537de1fE
0.1106 ETH
187211182023-12-05 15:44:47453 days ago1701791087
0xdA0DfC72...E537de1fE
0.1106 ETH
187208402023-12-05 14:49:11453 days ago1701787751
0xdA0DfC72...E537de1fE
0.2212 ETH
187183092023-12-05 6:18:35454 days ago1701757115
0xdA0DfC72...E537de1fE
0.1106 ETH
187176722023-12-05 4:09:47454 days ago1701749387
0xdA0DfC72...E537de1fE
0.3318 ETH
187175472023-12-05 3:44:23454 days ago1701747863
0xdA0DfC72...E537de1fE
0.1106 ETH
187164542023-12-05 0:03:11454 days ago1701734591
0xdA0DfC72...E537de1fE
0.1106 ETH
187161232023-12-04 22:56:59454 days ago1701730619
0xdA0DfC72...E537de1fE
0.1106 ETH
187147372023-12-04 18:18:23454 days ago1701713903
0xdA0DfC72...E537de1fE
0.2212 ETH
187141012023-12-04 16:10:23454 days ago1701706223
0xdA0DfC72...E537de1fE
2.212 ETH
187104492023-12-04 3:53:59455 days ago1701662039
0xdA0DfC72...E537de1fE
0.553 ETH
187092772023-12-03 23:57:47455 days ago1701647867
0xdA0DfC72...E537de1fE
0.2212 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Claim

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion
File 1 of 5 : Claim.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;

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

// import "hardhat/console.sol";

interface IWondersToken {
    function isApprovedForAll(address owner, address operator) external;

    function safeTransferFrom(address from, address to, uint256 id) external;
}

interface IBox {
    function mint(address to, uint256 quantity) external;

    function totalMinted() external view returns (uint256);

    function maxSupply() external view returns (uint256);
}

interface IBPX {
    function balanceOf(address _owner) external view returns (uint256 balance);

    function allowance(
        address _owner,
        address _spender
    ) external view returns (uint256 remaining);

    function transferFrom(
        address _from,
        address _to,
        uint256 _value
    ) external returns (bool success);
}

struct Config {
    bool enabled;
    uint128 start;
    uint128 end;
    bytes32 merkleRoot;
    uint16 earnedPerWonder;
    //
    uint256 ethBoxPrice;
    uint256 bpxBoxPrice;
}

contract Claim is Ownable, ReentrancyGuard {
    address public wondersToken;
    address public boxesToken;
    address public bpxToken;
    address public banker;

    mapping(address => uint64) private _boxesEarned;
    mapping(address => uint64) private _allowlistBoxesMinted;
    mapping(address => uint64) private _wondersClaimed;

    uint256 private _nextWonderID = 0;
    uint256 private _maxWonderID = 5000;

    Config private _cfg;

    function setWondersTokenAddress(address addr) public onlyOwner {
        wondersToken = addr;
    }

    function setBoxesTokenAddress(address addr) public onlyOwner {
        boxesToken = addr;
    }

    function setBPXTokenAddress(address addr) public onlyOwner {
        bpxToken = addr;
    }

    function setBankerAddress(address addr) public onlyOwner {
        banker = addr;
    }

    function setClaimEnabled(bool v) public onlyOwner {
        _cfg.enabled = v;
    }

    function setClaimConfig(
        uint128 start,
        uint128 end,
        bytes32 root,
        uint16 earnedBoxesPerWonder
    ) public onlyOwner {
        _cfg.start = start;
        _cfg.end = end;
        _cfg.merkleRoot = root;
        _cfg.earnedPerWonder = earnedBoxesPerWonder;
    }

    function setBoxPrices(uint256 ethPrice, uint256 bpxPrice) public onlyOwner {
        _cfg.ethBoxPrice = ethPrice;
        _cfg.bpxBoxPrice = bpxPrice;
    }

    function setMaxTokenID(uint256 max) public onlyOwner {
        _maxWonderID = max;
    }

    function config() public view returns (Config memory) {
        return _cfg;
    }

    function wondersClaimed(address owner) public view returns (uint64) {
        return _wondersClaimed[owner];
    }

    function earnedBoxes(address dest) public view returns (uint64) {
        return _boxesEarned[dest];
    }

    function nextWonderID() public view returns (uint256) {
        return _nextWonderID;
    }

    function devclaim(address dest, uint256 wonders) public onlyOwner {
        require(
            _nextWonderID + wonders <= _maxWonderID,
            "Claim exceeds supply."
        );

        for (uint256 i = 0; i < wonders; i++) {
            IWondersToken(wondersToken).safeTransferFrom(
                wondersToken,
                dest,
                _nextWonderID + i
            );
        }

        _nextWonderID += wonders;
    }

    function claim(
        address dest,
        uint64 wonders,
        uint64 limit,
        bytes32[] calldata proof
    ) public {
        return claimWithBoxes(dest, wonders, 0, limit, proof);
    }

    function claimWithBoxes(
        address dest,
        uint64 wonders,
        uint64 boxes,
        uint64 limit,
        bytes32[] calldata proof
    ) public payable nonReentrant {
        require(_cfg.enabled, "Claim is not active.");
        require(
            block.timestamp >= _cfg.start && block.timestamp < _cfg.end,
            "Claim window is not open."
        );
        require(wonders <= 20, "Can only claim up to 20 at a time.");
        require(
            _nextWonderID + wonders <= _maxWonderID,
            "Claim exceeds supply."
        );

        bytes32 leaf = keccak256(abi.encodePacked(dest, limit));
        require(
            MerkleProof.verify(proof, _cfg.merkleRoot, leaf),
            "Address not on allowlist."
        );
        require(
            wonders + _wondersClaimed[dest] <= limit,
            "Claim exceeds limit."
        );

        uint64 boxesEarned = uint64(wonders) * _cfg.earnedPerWonder;
        if (boxes > 0) {
            IBox boxesContract = IBox(boxesToken);

            require(
                _boxesEarned[dest] + boxesEarned >= boxes,
                "Not enough boxes earned."
            );

            validateAndAcceptPayment(boxes);

            boxesContract.mint(dest, boxes);
        }

        if (boxesEarned != boxes) {
            _boxesEarned[dest] = uint64(
                int64(_boxesEarned[dest]) + int64(boxesEarned) - int64(boxes)
            );
        }

        _wondersClaimed[dest] += wonders;
        for (uint256 i = 0; i < wonders; i++) {
            IWondersToken(wondersToken).safeTransferFrom(
                wondersToken,
                dest,
                _nextWonderID + i
            );
        }

        _nextWonderID += wonders;
    }

    function buyEarnedBoxes(
        address dest,
        uint16 boxes
    ) public payable nonReentrant {
        IBox boxesContract = IBox(boxesToken);

        require(_cfg.enabled, "Claim is not active.");
        require(
            block.timestamp >= _cfg.start && block.timestamp < _cfg.end,
            "Claim window is not open."
        );

        require(boxes > 0, "Must buy at least one box.");

        require(_boxesEarned[dest] >= boxes, "Not enough boxes earned.");

        validateAndAcceptPayment(boxes);

        _boxesEarned[dest] -= boxes;

        boxesContract.mint(dest, boxes);
    }

    receive() external payable {}

    function validateAndAcceptPayment(uint64 boxes) internal {
        IBPX bpxContract = IBPX(bpxToken);

        if (msg.value > 0) {
            require(
                msg.value == boxes * _cfg.ethBoxPrice,
                "Invalid ETH amount sent."
            );
        } else {
            require(
                bpxContract.balanceOf(_msgSender()) >= boxes * _cfg.bpxBoxPrice,
                "Not enough BPX."
            );
            require(
                bpxContract.allowance(_msgSender(), address(this)) >=
                    boxes * _cfg.bpxBoxPrice,
                "Not enough BPX allowed."
            );
        }

        if (msg.value > 0) {
            (bool sent, ) = banker.call{value: msg.value}("");
            require(sent, "ETH not sent.");
        } else {
            bpxContract.transferFrom(
                _msgSender(),
                banker,
                boxes * _cfg.bpxBoxPrice
            );
        }
    }
}

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

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 5 : 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 4 of 5 : 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 5 of 5 : 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)
        }
    }
}

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

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"banker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"boxesToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bpxToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dest","type":"address"},{"internalType":"uint16","name":"boxes","type":"uint16"}],"name":"buyEarnedBoxes","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"dest","type":"address"},{"internalType":"uint64","name":"wonders","type":"uint64"},{"internalType":"uint64","name":"limit","type":"uint64"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dest","type":"address"},{"internalType":"uint64","name":"wonders","type":"uint64"},{"internalType":"uint64","name":"boxes","type":"uint64"},{"internalType":"uint64","name":"limit","type":"uint64"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"claimWithBoxes","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"config","outputs":[{"components":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"uint128","name":"start","type":"uint128"},{"internalType":"uint128","name":"end","type":"uint128"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint16","name":"earnedPerWonder","type":"uint16"},{"internalType":"uint256","name":"ethBoxPrice","type":"uint256"},{"internalType":"uint256","name":"bpxBoxPrice","type":"uint256"}],"internalType":"struct Config","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dest","type":"address"},{"internalType":"uint256","name":"wonders","type":"uint256"}],"name":"devclaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dest","type":"address"}],"name":"earnedBoxes","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextWonderID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setBPXTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setBankerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ethPrice","type":"uint256"},{"internalType":"uint256","name":"bpxPrice","type":"uint256"}],"name":"setBoxPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setBoxesTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"start","type":"uint128"},{"internalType":"uint128","name":"end","type":"uint128"},{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"uint16","name":"earnedBoxesPerWonder","type":"uint16"}],"name":"setClaimConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"v","type":"bool"}],"name":"setClaimEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"max","type":"uint256"}],"name":"setMaxTokenID","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setWondersTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"wondersClaimed","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wondersToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526000600955611388600a5534801561001b57600080fd5b506100253361002e565b6001805561007e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6121b08061008d6000396000f3fe6080604052600436106101845760003560e01c80638bb0978b116100d6578063aec0e46d1161007f578063ca6c157b11610059578063ca6c157b146105ca578063f2fde38b146105ea578063f688e0261461060a57600080fd5b8063aec0e46d1461054c578063af3fa4251461056a578063c44f6a82146105b757600080fd5b806392929a09116100b057806392929a09146104ec5780639d0b1a4c1461050c578063ae7faa6c1461052c57600080fd5b80638bb0978b1461043b5780638da5cb5b146104a157806392847215146104cc57600080fd5b80631431128611610138578063715018a611610112578063715018a6146102d657806379502c55146102eb578063810d58361461040e57600080fd5b8063143112861461025c57806324e944ea14610289578063586a18cb146102a957600080fd5b80630a6d08c4116101695780630a6d08c4146101c55780630ab9db5b146101e55780630e19a55e1461023c57600080fd5b806301d027c6146101905780630808244c146101b257600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b506101b06101ab366004611c9d565b61062a565b005b6101b06101c0366004611d4c565b61063d565b3480156101d157600080fd5b506101b06101e0366004611dd2565b610e02565b3480156101f157600080fd5b506005546102129073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561024857600080fd5b506101b0610257366004611ded565b610e51565b34801561026857600080fd5b506004546102129073ffffffffffffffffffffffffffffffffffffffff1681565b34801561029557600080fd5b506101b06102a4366004611dd2565b610fcc565b3480156102b557600080fd5b506002546102129073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102e257600080fd5b506101b061101b565b3480156102f757600080fd5b5061039a6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506040805160e081018252600b5460ff8116151582526fffffffffffffffffffffffffffffffff61010090910481166020830152600c541691810191909152600d546060820152600e5461ffff166080820152600f5460a082015260105460c082015290565b6040516102339190600060e08201905082511515825260208301516fffffffffffffffffffffffffffffffff808216602085015280604086015116604085015250506060830151606083015261ffff608084015116608083015260a083015160a083015260c083015160c083015292915050565b34801561041a57600080fd5b506003546102129073ffffffffffffffffffffffffffffffffffffffff1681565b34801561044757600080fd5b50610488610456366004611dd2565b73ffffffffffffffffffffffffffffffffffffffff1660009081526008602052604090205467ffffffffffffffff1690565b60405167ffffffffffffffff9091168152602001610233565b3480156104ad57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610212565b3480156104d857600080fd5b506101b06104e7366004611dd2565b61102f565b3480156104f857600080fd5b506101b0610507366004611e25565b61107e565b34801561051857600080fd5b506101b0610527366004611e42565b6110b7565b34801561053857600080fd5b506101b0610547366004611dd2565b6110c4565b34801561055857600080fd5b50600954604051908152602001610233565b34801561057657600080fd5b50610488610585366004611dd2565b73ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205467ffffffffffffffff1690565b6101b06105c5366004611e6d565b611113565b3480156105d657600080fd5b506101b06105e5366004611ea0565b61145f565b3480156105f657600080fd5b506101b0610605366004611dd2565b611475565b34801561061657600080fd5b506101b0610625366004611f36565b61152c565b6106326115e0565b600f91909155601055565b610645611661565b600b5460ff166106b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436c61696d206973206e6f74206163746976652e00000000000000000000000060448201526064015b60405180910390fd5b600b5461010090046fffffffffffffffffffffffffffffffff1642108015906106f25750600c546fffffffffffffffffffffffffffffffff1642105b610758576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f436c61696d2077696e646f77206973206e6f74206f70656e2e0000000000000060448201526064016106ad565b60148567ffffffffffffffff1611156107f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f43616e206f6e6c7920636c61696d20757020746f20323020617420612074696d60448201527f652e00000000000000000000000000000000000000000000000000000000000060648201526084016106ad565b600a548567ffffffffffffffff1660095461080e9190611fb2565b1115610876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f436c61696d206578636565647320737570706c792e000000000000000000000060448201526064016106ad565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088901b1660208201527fffffffffffffffff00000000000000000000000000000000000000000000000060c085901b166034820152600090603c0160405160208183030381529060405280519060200120905061093083838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600d5491508490506116d4565b610996576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f41646472657373206e6f74206f6e20616c6c6f776c6973742e0000000000000060448201526064016106ad565b73ffffffffffffffffffffffffffffffffffffffff871660009081526008602052604090205467ffffffffffffffff808616916109d4911688611fc5565b67ffffffffffffffff161115610a46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436c61696d2065786365656473206c696d69742e00000000000000000000000060448201526064016106ad565b600e54600090610a5a9061ffff1688611fed565b905067ffffffffffffffff861615610bc05760035473ffffffffffffffffffffffffffffffffffffffff89811660009081526006602052604090205491169067ffffffffffffffff80891691610ab291859116611fc5565b67ffffffffffffffff161015610b24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f7420656e6f75676820626f786573206561726e65642e000000000000000060448201526064016106ad565b610b2d876116ea565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015267ffffffffffffffff891660248301528216906340c10f1990604401600060405180830381600087803b158015610ba657600080fd5b505af1158015610bba573d6000803e3d6000fd5b50505050505b8567ffffffffffffffff168167ffffffffffffffff1614610c7f5773ffffffffffffffffffffffffffffffffffffffff88166000908152600660205260409020548690610c1890839067ffffffffffffffff16612019565b610c22919061205f565b73ffffffffffffffffffffffffffffffffffffffff8916600090815260066020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790555b73ffffffffffffffffffffffffffffffffffffffff881660009081526008602052604081208054899290610cbe90849067ffffffffffffffff16611fc5565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060005b8767ffffffffffffffff16811015610dcc5760025460095473ffffffffffffffffffffffffffffffffffffffff909116906342842e0e9082908c90610d2d908690611fb2565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b158015610da157600080fd5b505af1158015610db5573d6000803e3d6000fd5b505050508080610dc4906120a5565b915050610ce7565b508667ffffffffffffffff1660096000828254610de99190611fb2565b90915550506001805550610dfa9050565b505050505050565b610e0a6115e0565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610e596115e0565b600a5481600954610e6a9190611fb2565b1115610ed2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f436c61696d206578636565647320737570706c792e000000000000000000000060448201526064016106ad565b60005b81811015610fb05760025460095473ffffffffffffffffffffffffffffffffffffffff909116906342842e0e9082908690610f11908690611fb2565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b158015610f8557600080fd5b505af1158015610f99573d6000803e3d6000fd5b505050508080610fa8906120a5565b915050610ed5565b508060096000828254610fc39190611fb2565b90915550505050565b610fd46115e0565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6110236115e0565b61102d6000611ba7565b565b6110376115e0565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6110866115e0565b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b6110bf6115e0565b600a55565b6110cc6115e0565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61111b611661565b600354600b5473ffffffffffffffffffffffffffffffffffffffff9091169060ff166111a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436c61696d206973206e6f74206163746976652e00000000000000000000000060448201526064016106ad565b600b5461010090046fffffffffffffffffffffffffffffffff1642108015906111df5750600c546fffffffffffffffffffffffffffffffff1642105b611245576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f436c61696d2077696e646f77206973206e6f74206f70656e2e0000000000000060448201526064016106ad565b60008261ffff16116112b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d75737420627579206174206c65617374206f6e6520626f782e00000000000060448201526064016106ad565b73ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604090205461ffff831667ffffffffffffffff9091161015611352576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f7420656e6f75676820626f786573206561726e65642e000000000000000060448201526064016106ad565b61135f8261ffff166116ea565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600660205260408120805461ffff851692906113a290849067ffffffffffffffff166120dd565b825467ffffffffffffffff9182166101009390930a9283029190920219909116179055506040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015261ffff841660248301528216906340c10f1990604401600060405180830381600087803b15801561143957600080fd5b505af115801561144d573d6000803e3d6000fd5b505050505061145b60018055565b5050565b61146e8585600086868661063d565b5050505050565b61147d6115e0565b73ffffffffffffffffffffffffffffffffffffffff8116611520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016106ad565b61152981611ba7565b50565b6115346115e0565b600b80547fffffffffffffffffffffffffffffff00000000000000000000000000000000ff166101006fffffffffffffffffffffffffffffffff96871602179055600c80547fffffffffffffffffffffffffffffffff00000000000000000000000000000000169390941692909217909255600d91909155600e80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461102d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106ad565b6002600154036116cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106ad565b6002600155565b6000826116e18584611c1c565b14949350505050565b60045473ffffffffffffffffffffffffffffffffffffffff16341561178d57600f546117209067ffffffffffffffff84166120fe565b3414611788576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c69642045544820616d6f756e742073656e742e000000000000000060448201526064016106ad565b6119e5565b6010546117a49067ffffffffffffffff84166120fe565b73ffffffffffffffffffffffffffffffffffffffff82166370a08231336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa15801561182a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184e9190612115565b10156118b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4e6f7420656e6f756768204250582e000000000000000000000000000000000060448201526064016106ad565b6010546118cd9067ffffffffffffffff84166120fe565b73ffffffffffffffffffffffffffffffffffffffff821663dd62ed3e336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152306024820152604401602060405180830381865afa158015611959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197d9190612115565b10156119e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420656e6f7567682042505820616c6c6f7765642e00000000000000000060448201526064016106ad565b3415611aba5760055460405160009173ffffffffffffffffffffffffffffffffffffffff169034908381818185875af1925050503d8060008114611a45576040519150601f19603f3d011682016040523d82523d6000602084013e611a4a565b606091505b5050905080611ab5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f455448206e6f742073656e742e0000000000000000000000000000000000000060448201526064016106ad565b505050565b73ffffffffffffffffffffffffffffffffffffffff81166323b872dd3360055460105473ffffffffffffffffffffffffffffffffffffffff90911690611b0a9067ffffffffffffffff88166120fe565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff938416600482015292909116602483015260448201526064016020604051808303816000875af1158015611b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab5919061212e565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b8451811015611c6157611c4d82868381518110611c4057611c4061214b565b6020026020010151611c6b565b915080611c59816120a5565b915050611c21565b5090505b92915050565b6000818310611c87576000828152602084905260409020611c96565b60008381526020839052604090205b9392505050565b60008060408385031215611cb057600080fd5b50508035926020909101359150565b803573ffffffffffffffffffffffffffffffffffffffff81168114611ce357600080fd5b919050565b803567ffffffffffffffff81168114611ce357600080fd5b60008083601f840112611d1257600080fd5b50813567ffffffffffffffff811115611d2a57600080fd5b6020830191508360208260051b8501011115611d4557600080fd5b9250929050565b60008060008060008060a08789031215611d6557600080fd5b611d6e87611cbf565b9550611d7c60208801611ce8565b9450611d8a60408801611ce8565b9350611d9860608801611ce8565b9250608087013567ffffffffffffffff811115611db457600080fd5b611dc089828a01611d00565b979a9699509497509295939492505050565b600060208284031215611de457600080fd5b611c9682611cbf565b60008060408385031215611e0057600080fd5b611e0983611cbf565b946020939093013593505050565b801515811461152957600080fd5b600060208284031215611e3757600080fd5b8135611c9681611e17565b600060208284031215611e5457600080fd5b5035919050565b803561ffff81168114611ce357600080fd5b60008060408385031215611e8057600080fd5b611e8983611cbf565b9150611e9760208401611e5b565b90509250929050565b600080600080600060808688031215611eb857600080fd5b611ec186611cbf565b9450611ecf60208701611ce8565b9350611edd60408701611ce8565b9250606086013567ffffffffffffffff811115611ef957600080fd5b611f0588828901611d00565b969995985093965092949392505050565b80356fffffffffffffffffffffffffffffffff81168114611ce357600080fd5b60008060008060808587031215611f4c57600080fd5b611f5585611f16565b9350611f6360208601611f16565b925060408501359150611f7860608601611e5b565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115611c6557611c65611f83565b67ffffffffffffffff818116838216019080821115611fe657611fe6611f83565b5092915050565b67ffffffffffffffff81811683821602808216919082811461201157612011611f83565b505092915050565b600781810b9083900b01677fffffffffffffff81137fffffffffffffffffffffffffffffffffffffffffffffffff800000000000000082121715611c6557611c65611f83565b600782810b9082900b037fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008112677fffffffffffffff82131715611c6557611c65611f83565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036120d6576120d6611f83565b5060010190565b67ffffffffffffffff828116828216039080821115611fe657611fe6611f83565b8082028115828204841417611c6557611c65611f83565b60006020828403121561212757600080fd5b5051919050565b60006020828403121561214057600080fd5b8151611c9681611e17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220fe956aa204de6ce47184d3a231157946a1f99638d84670c949e6f73b360ca9a164736f6c63430008110033

Deployed Bytecode

0x6080604052600436106101845760003560e01c80638bb0978b116100d6578063aec0e46d1161007f578063ca6c157b11610059578063ca6c157b146105ca578063f2fde38b146105ea578063f688e0261461060a57600080fd5b8063aec0e46d1461054c578063af3fa4251461056a578063c44f6a82146105b757600080fd5b806392929a09116100b057806392929a09146104ec5780639d0b1a4c1461050c578063ae7faa6c1461052c57600080fd5b80638bb0978b1461043b5780638da5cb5b146104a157806392847215146104cc57600080fd5b80631431128611610138578063715018a611610112578063715018a6146102d657806379502c55146102eb578063810d58361461040e57600080fd5b8063143112861461025c57806324e944ea14610289578063586a18cb146102a957600080fd5b80630a6d08c4116101695780630a6d08c4146101c55780630ab9db5b146101e55780630e19a55e1461023c57600080fd5b806301d027c6146101905780630808244c146101b257600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b506101b06101ab366004611c9d565b61062a565b005b6101b06101c0366004611d4c565b61063d565b3480156101d157600080fd5b506101b06101e0366004611dd2565b610e02565b3480156101f157600080fd5b506005546102129073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561024857600080fd5b506101b0610257366004611ded565b610e51565b34801561026857600080fd5b506004546102129073ffffffffffffffffffffffffffffffffffffffff1681565b34801561029557600080fd5b506101b06102a4366004611dd2565b610fcc565b3480156102b557600080fd5b506002546102129073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102e257600080fd5b506101b061101b565b3480156102f757600080fd5b5061039a6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506040805160e081018252600b5460ff8116151582526fffffffffffffffffffffffffffffffff61010090910481166020830152600c541691810191909152600d546060820152600e5461ffff166080820152600f5460a082015260105460c082015290565b6040516102339190600060e08201905082511515825260208301516fffffffffffffffffffffffffffffffff808216602085015280604086015116604085015250506060830151606083015261ffff608084015116608083015260a083015160a083015260c083015160c083015292915050565b34801561041a57600080fd5b506003546102129073ffffffffffffffffffffffffffffffffffffffff1681565b34801561044757600080fd5b50610488610456366004611dd2565b73ffffffffffffffffffffffffffffffffffffffff1660009081526008602052604090205467ffffffffffffffff1690565b60405167ffffffffffffffff9091168152602001610233565b3480156104ad57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff16610212565b3480156104d857600080fd5b506101b06104e7366004611dd2565b61102f565b3480156104f857600080fd5b506101b0610507366004611e25565b61107e565b34801561051857600080fd5b506101b0610527366004611e42565b6110b7565b34801561053857600080fd5b506101b0610547366004611dd2565b6110c4565b34801561055857600080fd5b50600954604051908152602001610233565b34801561057657600080fd5b50610488610585366004611dd2565b73ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205467ffffffffffffffff1690565b6101b06105c5366004611e6d565b611113565b3480156105d657600080fd5b506101b06105e5366004611ea0565b61145f565b3480156105f657600080fd5b506101b0610605366004611dd2565b611475565b34801561061657600080fd5b506101b0610625366004611f36565b61152c565b6106326115e0565b600f91909155601055565b610645611661565b600b5460ff166106b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436c61696d206973206e6f74206163746976652e00000000000000000000000060448201526064015b60405180910390fd5b600b5461010090046fffffffffffffffffffffffffffffffff1642108015906106f25750600c546fffffffffffffffffffffffffffffffff1642105b610758576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f436c61696d2077696e646f77206973206e6f74206f70656e2e0000000000000060448201526064016106ad565b60148567ffffffffffffffff1611156107f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f43616e206f6e6c7920636c61696d20757020746f20323020617420612074696d60448201527f652e00000000000000000000000000000000000000000000000000000000000060648201526084016106ad565b600a548567ffffffffffffffff1660095461080e9190611fb2565b1115610876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f436c61696d206578636565647320737570706c792e000000000000000000000060448201526064016106ad565b6040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088901b1660208201527fffffffffffffffff00000000000000000000000000000000000000000000000060c085901b166034820152600090603c0160405160208183030381529060405280519060200120905061093083838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600d5491508490506116d4565b610996576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f41646472657373206e6f74206f6e20616c6c6f776c6973742e0000000000000060448201526064016106ad565b73ffffffffffffffffffffffffffffffffffffffff871660009081526008602052604090205467ffffffffffffffff808616916109d4911688611fc5565b67ffffffffffffffff161115610a46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436c61696d2065786365656473206c696d69742e00000000000000000000000060448201526064016106ad565b600e54600090610a5a9061ffff1688611fed565b905067ffffffffffffffff861615610bc05760035473ffffffffffffffffffffffffffffffffffffffff89811660009081526006602052604090205491169067ffffffffffffffff80891691610ab291859116611fc5565b67ffffffffffffffff161015610b24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f7420656e6f75676820626f786573206561726e65642e000000000000000060448201526064016106ad565b610b2d876116ea565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015267ffffffffffffffff891660248301528216906340c10f1990604401600060405180830381600087803b158015610ba657600080fd5b505af1158015610bba573d6000803e3d6000fd5b50505050505b8567ffffffffffffffff168167ffffffffffffffff1614610c7f5773ffffffffffffffffffffffffffffffffffffffff88166000908152600660205260409020548690610c1890839067ffffffffffffffff16612019565b610c22919061205f565b73ffffffffffffffffffffffffffffffffffffffff8916600090815260066020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff929092169190911790555b73ffffffffffffffffffffffffffffffffffffffff881660009081526008602052604081208054899290610cbe90849067ffffffffffffffff16611fc5565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060005b8767ffffffffffffffff16811015610dcc5760025460095473ffffffffffffffffffffffffffffffffffffffff909116906342842e0e9082908c90610d2d908690611fb2565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b158015610da157600080fd5b505af1158015610db5573d6000803e3d6000fd5b505050508080610dc4906120a5565b915050610ce7565b508667ffffffffffffffff1660096000828254610de99190611fb2565b90915550506001805550610dfa9050565b505050505050565b610e0a6115e0565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610e596115e0565b600a5481600954610e6a9190611fb2565b1115610ed2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f436c61696d206578636565647320737570706c792e000000000000000000000060448201526064016106ad565b60005b81811015610fb05760025460095473ffffffffffffffffffffffffffffffffffffffff909116906342842e0e9082908690610f11908690611fb2565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b158015610f8557600080fd5b505af1158015610f99573d6000803e3d6000fd5b505050508080610fa8906120a5565b915050610ed5565b508060096000828254610fc39190611fb2565b90915550505050565b610fd46115e0565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6110236115e0565b61102d6000611ba7565b565b6110376115e0565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6110866115e0565b600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b6110bf6115e0565b600a55565b6110cc6115e0565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61111b611661565b600354600b5473ffffffffffffffffffffffffffffffffffffffff9091169060ff166111a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f436c61696d206973206e6f74206163746976652e00000000000000000000000060448201526064016106ad565b600b5461010090046fffffffffffffffffffffffffffffffff1642108015906111df5750600c546fffffffffffffffffffffffffffffffff1642105b611245576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f436c61696d2077696e646f77206973206e6f74206f70656e2e0000000000000060448201526064016106ad565b60008261ffff16116112b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d75737420627579206174206c65617374206f6e6520626f782e00000000000060448201526064016106ad565b73ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604090205461ffff831667ffffffffffffffff9091161015611352576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f4e6f7420656e6f75676820626f786573206561726e65642e000000000000000060448201526064016106ad565b61135f8261ffff166116ea565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600660205260408120805461ffff851692906113a290849067ffffffffffffffff166120dd565b825467ffffffffffffffff9182166101009390930a9283029190920219909116179055506040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015261ffff841660248301528216906340c10f1990604401600060405180830381600087803b15801561143957600080fd5b505af115801561144d573d6000803e3d6000fd5b505050505061145b60018055565b5050565b61146e8585600086868661063d565b5050505050565b61147d6115e0565b73ffffffffffffffffffffffffffffffffffffffff8116611520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016106ad565b61152981611ba7565b50565b6115346115e0565b600b80547fffffffffffffffffffffffffffffff00000000000000000000000000000000ff166101006fffffffffffffffffffffffffffffffff96871602179055600c80547fffffffffffffffffffffffffffffffff00000000000000000000000000000000169390941692909217909255600d91909155600e80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00001661ffff909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461102d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106ad565b6002600154036116cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106ad565b6002600155565b6000826116e18584611c1c565b14949350505050565b60045473ffffffffffffffffffffffffffffffffffffffff16341561178d57600f546117209067ffffffffffffffff84166120fe565b3414611788576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f496e76616c69642045544820616d6f756e742073656e742e000000000000000060448201526064016106ad565b6119e5565b6010546117a49067ffffffffffffffff84166120fe565b73ffffffffffffffffffffffffffffffffffffffff82166370a08231336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401602060405180830381865afa15801561182a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184e9190612115565b10156118b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f4e6f7420656e6f756768204250582e000000000000000000000000000000000060448201526064016106ad565b6010546118cd9067ffffffffffffffff84166120fe565b73ffffffffffffffffffffffffffffffffffffffff821663dd62ed3e336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152306024820152604401602060405180830381865afa158015611959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197d9190612115565b10156119e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420656e6f7567682042505820616c6c6f7765642e00000000000000000060448201526064016106ad565b3415611aba5760055460405160009173ffffffffffffffffffffffffffffffffffffffff169034908381818185875af1925050503d8060008114611a45576040519150601f19603f3d011682016040523d82523d6000602084013e611a4a565b606091505b5050905080611ab5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f455448206e6f742073656e742e0000000000000000000000000000000000000060448201526064016106ad565b505050565b73ffffffffffffffffffffffffffffffffffffffff81166323b872dd3360055460105473ffffffffffffffffffffffffffffffffffffffff90911690611b0a9067ffffffffffffffff88166120fe565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff938416600482015292909116602483015260448201526064016020604051808303816000875af1158015611b83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab5919061212e565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b8451811015611c6157611c4d82868381518110611c4057611c4061214b565b6020026020010151611c6b565b915080611c59816120a5565b915050611c21565b5090505b92915050565b6000818310611c87576000828152602084905260409020611c96565b60008381526020839052604090205b9392505050565b60008060408385031215611cb057600080fd5b50508035926020909101359150565b803573ffffffffffffffffffffffffffffffffffffffff81168114611ce357600080fd5b919050565b803567ffffffffffffffff81168114611ce357600080fd5b60008083601f840112611d1257600080fd5b50813567ffffffffffffffff811115611d2a57600080fd5b6020830191508360208260051b8501011115611d4557600080fd5b9250929050565b60008060008060008060a08789031215611d6557600080fd5b611d6e87611cbf565b9550611d7c60208801611ce8565b9450611d8a60408801611ce8565b9350611d9860608801611ce8565b9250608087013567ffffffffffffffff811115611db457600080fd5b611dc089828a01611d00565b979a9699509497509295939492505050565b600060208284031215611de457600080fd5b611c9682611cbf565b60008060408385031215611e0057600080fd5b611e0983611cbf565b946020939093013593505050565b801515811461152957600080fd5b600060208284031215611e3757600080fd5b8135611c9681611e17565b600060208284031215611e5457600080fd5b5035919050565b803561ffff81168114611ce357600080fd5b60008060408385031215611e8057600080fd5b611e8983611cbf565b9150611e9760208401611e5b565b90509250929050565b600080600080600060808688031215611eb857600080fd5b611ec186611cbf565b9450611ecf60208701611ce8565b9350611edd60408701611ce8565b9250606086013567ffffffffffffffff811115611ef957600080fd5b611f0588828901611d00565b969995985093965092949392505050565b80356fffffffffffffffffffffffffffffffff81168114611ce357600080fd5b60008060008060808587031215611f4c57600080fd5b611f5585611f16565b9350611f6360208601611f16565b925060408501359150611f7860608601611e5b565b905092959194509250565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115611c6557611c65611f83565b67ffffffffffffffff818116838216019080821115611fe657611fe6611f83565b5092915050565b67ffffffffffffffff81811683821602808216919082811461201157612011611f83565b505092915050565b600781810b9083900b01677fffffffffffffff81137fffffffffffffffffffffffffffffffffffffffffffffffff800000000000000082121715611c6557611c65611f83565b600782810b9082900b037fffffffffffffffffffffffffffffffffffffffffffffffff80000000000000008112677fffffffffffffff82131715611c6557611c65611f83565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036120d6576120d6611f83565b5060010190565b67ffffffffffffffff828116828216039080821115611fe657611fe6611f83565b8082028115828204841417611c6557611c65611f83565b60006020828403121561212757600080fd5b5051919050565b60006020828403121561214057600080fd5b8151611c9681611e17565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220fe956aa204de6ce47184d3a231157946a1f99638d84670c949e6f73b360ca9a164736f6c63430008110033

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.