ETH Price: $3,255.51 (+3.21%)
Gas: 4 Gwei

Contract

0xaA9bEbC5b7c2f725834dc617FF7b6751A5B1703e
 

Overview

ETH Balance

0.1000999999 ETH

Eth Value

$325.88 (@ $3,255.51/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buy Meth Bag195265802024-03-27 15:38:47121 days ago1711553927IN
0xaA9bEbC5...1A5B1703e
0.05 ETH0.0045362149.42482315
Buy Meth Bag195265592024-03-27 15:34:23121 days ago1711553663IN
0xaA9bEbC5...1A5B1703e
0.05 ETH0.0046523250.68993223
Withdraw ETH182505642023-09-30 19:19:47299 days ago1696101587IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0004898811.56387355
Buy Meth Bag178876582023-08-10 23:06:47350 days ago1691708807IN
0xaA9bEbC5...1A5B1703e
0.21 ETH0.0021624323.55357914
Buy Meth Bag178543982023-08-06 7:22:23355 days ago1691306543IN
0xaA9bEbC5...1A5B1703e
0.05 ETH0.0011481212.50958317
Buy Meth Bag178255662023-08-02 6:36:47359 days ago1690958207IN
0xaA9bEbC5...1A5B1703e
0.05 ETH0.0015354116.72620062
Withdraw ETH178128932023-07-31 12:08:47361 days ago1690805327IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0005960514.07424929
Buy Meth Bag177821492023-07-27 4:54:11365 days ago1690433651IN
0xaA9bEbC5...1A5B1703e
0.05 ETH0.0015546620.82432538
Buy Meth Bag177821392023-07-27 4:52:11365 days ago1690433531IN
0xaA9bEbC5...1A5B1703e
0.05 ETH0.0017897519.50044493
Buy Meth Bag177750742023-07-26 5:09:23366 days ago1690348163IN
0xaA9bEbC5...1A5B1703e
0.05 ETH0.0016347817.80869579
Buy Meth Bag177672232023-07-25 2:45:59367 days ago1690253159IN
0xaA9bEbC5...1A5B1703e
0.05 ETH0.0027447129.90539068
Buy Meth Bag176617422023-07-10 7:19:23382 days ago1688973563IN
0xaA9bEbC5...1A5B1703e
0.05 ETH0.0019883618.26401174
Withdraw ETH175921912023-06-30 12:48:35392 days ago1688129315IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0014815534.98284259
Buy Meth Bag175827892023-06-29 5:10:11393 days ago1688015411IN
0xaA9bEbC5...1A5B1703e
0.06 ETH0.002075219.05953783
Buy Meth Bag175370832023-06-22 18:57:35399 days ago1687460255IN
0xaA9bEbC5...1A5B1703e
0.06 ETH0.0012007816.07536147
Withdraw ETH175003812023-06-17 15:20:23405 days ago1687015223IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0007839218.50492595
Withdraw ETH175003732023-06-17 15:18:47405 days ago1687015127IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0006691715.80062103
Withdraw ETH175003632023-06-17 15:16:47405 days ago1687015007IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0006210114.66767612
Withdraw ETH175003492023-06-17 15:13:59405 days ago1687014839IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0006051914.30202237
Buy Meth Bag174874152023-06-15 19:40:59406 days ago1686858059IN
0xaA9bEbC5...1A5B1703e
0.06 ETH0.0014809919.82675074
Buy Meth Bag174812302023-06-14 22:45:47407 days ago1686782747IN
0xaA9bEbC5...1A5B1703e
0.06 ETH0.0021029122.90829861
Open Common Box174595752023-06-11 21:37:11410 days ago1686519431IN
0xaA9bEbC5...1A5B1703e
0 ETH0.002401414
Open Common Box174520782023-06-10 20:16:23411 days ago1686428183IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0004555915.03812221
Open Common Box174520782023-06-10 20:16:23411 days ago1686428183IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0004551115.0221971
Open Common Box174516662023-06-10 18:52:23411 days ago1686423143IN
0xaA9bEbC5...1A5B1703e
0 ETH0.0028968815.36384816
View all transactions

Latest 7 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
182505642023-09-30 19:19:47299 days ago1696101587
0xaA9bEbC5...1A5B1703e
0.3798 ETH
178128932023-07-31 12:08:47361 days ago1690805327
0xaA9bEbC5...1A5B1703e
0.2 ETH
175921912023-06-30 12:48:35392 days ago1688129315
0xaA9bEbC5...1A5B1703e
0.4 ETH
175003812023-06-17 15:20:23405 days ago1687015223
0xaA9bEbC5...1A5B1703e
190 ETH
175003732023-06-17 15:18:47405 days ago1687015127
0xaA9bEbC5...1A5B1703e
0.1 ETH
175003632023-06-17 15:16:47405 days ago1687015007
0xaA9bEbC5...1A5B1703e
0.0001 ETH
175003492023-06-17 15:13:59405 days ago1687014839
0xaA9bEbC5...1A5B1703e
0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LootBoxes

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : LootBoxes.sol
// SPDX-License-Identifier: GPL-3.0
// solhint-disable-next-line
pragma solidity 0.8.12;

import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interface/IApes.sol";
import "./interface/ITraits.sol";
import "./interface/IRandomizer.sol";
import "./interface/IMasterContract.sol";

/// @title Bulls and Apes Project - Loot Box
/// @author BAP Dev Team
/// @notice Loot Boxes to get ERC1155 Traits for Apes
contract LootBoxes is ERC1155Holder, Ownable, ReentrancyGuard {
    /// @notice Cooldown period for power replenishment
    uint256 public constant POWER_COOLDOWN = 12 hours;
    /// @notice Cooldown period free spins opening
    uint256 public freeSpinsCooldown = 10 minutes;

    /// @notice BAP Apes contract
    IApes public apesContract;
    /// @notice BAP Traits contract
    ITraits public traitsContract;
    /// @notice BAP Randomizer contract
    /// @dev Used to pick random winners on box opening
    IRandomizer public randomizerContract;
    /// @notice BAP Master contract
    /// @dev Used for functions that require METH or Utilities contract interaction
    IMasterContract public masterContract;
    address public secret;

    /// @notice Last timestamp Ape opened a common box
    mapping(uint256 => uint256) public apeLastBox;
    /// @notice Last timestamp Ape used a free spin
    mapping(uint256 => uint256) public apeLastFreeSpin;
    /// @notice Count for Ape common box re-opening
    mapping(uint256 => uint256) public apeOpenCount;
    /// @notice Prices for METH bags
    mapping(uint256 => uint256) public bagPrice;

    mapping(bytes => bool) private isSignatureUsed;

    event BoxOpened(
        uint256 boxType,
        uint256 apeId,
        uint256 amount,
        uint256 price,
        uint256[] prizes
    );

    event SpecialBoxOpened(
        uint256 boxType,
        uint256 amount,
        uint256 price,
        uint256[] prizes,
        address operator
    );

    event MethBagBought(uint256 amount, uint256 price, address to);
    event MethBagCreated(uint256 amount, uint256 price, address operator);

    /// @notice Deploys the contract
    /// @param apesAddress Address of Apes contract
    /// @param traitsAddress Address of Traits contract
    /// @param randomizerAddress Address of Randomizer contract
    /// @param masterContractAddress Address of Master contract
    /// @param signer Address used to provide signatures
    /// @dev Used for functions that require METH or Utilities contract interaction
    constructor(
        address apesAddress,
        address traitsAddress,
        address randomizerAddress,
        address masterContractAddress,
        address signer
    ) {
        apesContract = IApes(apesAddress);
        traitsContract = ITraits(traitsAddress);
        randomizerContract = IRandomizer(randomizerAddress);
        masterContract = IMasterContract(masterContractAddress);
        secret = signer;
    }

    /// @notice Open a Common box using an specific Ape
    /// @param apeId ID of the Ape used to open the box
    /// @param amount Amount of boxes to be opened
    /// @param price Price to be paid for open the boxes (in METH)
    /// @param boxType Box type code: 0 - common, 1 - epic, 2 - legendary
    /// @param timeOut Timestamp for signature expiration
    /// @param hasPower Ape power flag
    /// @param randomSeed Bytes seed to generate the random winner
    /// @param signature Signature to verify above parameters
    /// @dev Mints amount ERC1155 Traits to the sender
    function openCommonBox(
        uint256 apeId,
        uint256 amount,
        uint256 price,
        uint256 boxType,
        uint256 timeOut,
        bool hasPower,
        bytes calldata randomSeed,
        bytes calldata signature
    ) external {
        require(!isSignatureUsed[signature], "OpenBox: Signature already used");
        require(timeOut > block.timestamp, "OpenBox: Seed is no longer valid");
        require(boxType == 0, "OpenBox: BoxType not valid");

        address tokenOwner = apesContract.ownerOf(apeId);

        require(
            _verifyHashSignature(
                keccak256(
                    abi.encode(
                        msg.sender,
                        tokenOwner,
                        apeId,
                        amount,
                        price,
                        boxType,
                        timeOut,
                        hasPower,
                        randomSeed
                    )
                ),
                signature
            ),
            "OpenBox: Signature is invalid"
        );

        isSignatureUsed[signature] = true;

        if (price > 0) {
            if (
                !hasPower ||
                apeLastBox[apeId] + POWER_COOLDOWN > block.timestamp
            ) {
                require(
                    apeLastBox[apeId] + 5 minutes > block.timestamp,
                    "OpenBox: Re open time elapsed"
                );

                if (apeOpenCount[apeId] > 0) {
                    price = price * 2;
                } else {
                    price = (price * 3000) / 2000;
                    apeOpenCount[apeId]++;
                }
            } else {
                apeOpenCount[apeId] = 0;
            }

            apeLastBox[apeId] = block.timestamp;

            masterContract.pay(price, price);
        } else {
            require(
                apeLastFreeSpin[apeId] + freeSpinsCooldown > block.timestamp,
                "OpenBox: Free spins cooldown"
            );
            apeLastFreeSpin[apeId] = block.timestamp;
        }

        (uint256[] memory prizes, bool hasExtra) = randomizerContract.getRandom(
            randomSeed,
            amount,
            timeOut
        );

        uint256[] memory prizesAmounts = new uint256[](amount);

        for (uint256 i = 0; i < amount; i++) {
            prizesAmounts[i] = 1;
        }

        traitsContract.mintBatch(msg.sender, prizes, prizesAmounts);

        emit BoxOpened(boxType, apeId, amount, price, prizes);
    }

    /// @notice Open a Epic or Legendary box
    /// @param amount Amount of boxes to be opened
    /// @param price Price to be paid for open the boxes (in ETH)
    /// @param boxType Box type code: 0 - common, 1 - epic, 2 - legendary
    /// @param timeOut Timestamp for signature expiration
    /// @param randomSeed Bytes seed to generate the random winner
    /// @param signature Signature to verify above parameters
    /// @dev Mints amount ERC1155 Traits to the sender
    function openSpecialBox(
        uint256 amount,
        uint256 price,
        uint256 boxType,
        uint256 timeOut,
        bytes calldata randomSeed,
        bytes calldata signature
    ) external payable {
        require(!isSignatureUsed[signature], "OpenBox: Signature already used");
        require(timeOut > block.timestamp, "OpenBox: Seed is no longer valid");
        require(boxType > 0, "OpenBox: BoxType not valid");
        require(msg.value == price, "OpenBox: Wrong ETH value");

        require(
            _verifyHashSignature(
                keccak256(
                    abi.encode(
                        msg.sender,
                        amount,
                        price,
                        boxType,
                        timeOut,
                        randomSeed
                    )
                ),
                signature
            ),
            "OpenBox: Signature is invalid"
        );

        isSignatureUsed[signature] = true;

        (uint256[] memory prizes, bool hasExtra) = randomizerContract.getRandom(
            randomSeed,
            amount,
            timeOut
        );

        uint256 quantiteToMint = amount;

        if (hasExtra) {
            for (uint256 i = 0; i < prizes.length; i++) {
                uint256 currentPrize = prizes[i];

                if (currentPrize > 39 && currentPrize < 44) {
                    masterContract.airdrop(msg.sender, 1, currentPrize);
                    quantiteToMint--;
                }
            }

            if (quantiteToMint > 0) {
                uint256[] memory prizesToMint = new uint256[](quantiteToMint);
                uint256[] memory prizesAmounts = new uint256[](quantiteToMint);
                uint256 addedCount;

                for (uint256 i = 0; i < prizes.length; i++) {
                    uint256 currentPrize = prizes[i];
                    if (currentPrize > 39 && currentPrize < 44) {
                        continue;
                    }

                    prizesAmounts[addedCount] = 1;
                    prizesToMint[addedCount] = currentPrize;
                    addedCount++;
                }

                traitsContract.mintBatch(
                    msg.sender,
                    prizesToMint,
                    prizesAmounts
                );
            }
        } else {
            uint256[] memory prizesAmounts = new uint256[](quantiteToMint);

            for (uint256 i = 0; i < quantiteToMint; i++) {
                prizesAmounts[i] = 1;
            }

            traitsContract.mintBatch(msg.sender, prizes, prizesAmounts);
        }

        emit SpecialBoxOpened(boxType, amount, price, prizes, msg.sender);
    }

    /// @notice Buy METH bags
    /// @param amount Amount of METH to buy
    /// @param to Address to send the METH
    /// @param price Price to be paid for the METH (in ETH)
    /// @param timeOut Timestamp for signature expiration
    /// @param signature Signature to verify above parameters
    /// @dev Mints amount METH to selected address
    function buyMethBag(
        uint256 amount,
        address to,
        uint256 price,
        uint256 timeOut,
        bytes calldata signature
    ) external payable {
        require(timeOut > block.timestamp, "buyMethBag: Seed is no longer valid");
        require(
            _verifyHashSignature(
                keccak256(abi.encode(amount, to, price, timeOut)),
                signature
            ),
            "buyMethBag: Signature is invalid"
        );
        require(price > 0, "Buy METH bag: amount is not valid");
        require(msg.value == price, "Buy METH bag: not enough ETH to buy");

        masterContract.claim(to, amount);

        emit MethBagBought(amount, price, to);
    }

    /// @notice Set the price for a METH bag
    /// @param amount Amount of METH for the bag
    /// @param price Price in WEI to be paid for the bag
    /// @dev METH bags can only be created by the owner
    function setMethBagPrice(uint256 amount, uint256 price) external onlyOwner {
        require(amount > 0, "METH amount: can't be 0");

        bagPrice[amount] = price;

        emit MethBagCreated(amount, price, msg.sender);
    }

    /// @notice Change the signer address
    /// @param signer Address used to provide signatures
    /// @dev Signer address can only be set by the owner
    function setSecret(address signer) external onlyOwner {
        secret = signer;
    }

    /// @notice Change the cooldown perion on free spins
    /// @param newCooldown New cooldown set on seconds
    /// @dev newCooldown can only be set by the owner
    function setFreeSpinCooldown(uint256 newCooldown) external onlyOwner {
        freeSpinsCooldown = newCooldown;
    }

    /// @notice Change contract Addresses
    /// @param apesAddress Address of Apes contract
    /// @param traitsAddress Address of Traits contract
    /// @param randomizerAddress Address of Randomizer contract
    /// @param masterContractAddress Address of Master contract
    /// @dev Can only be set by the owner
    function setContractAddresses(
        address apesAddress,
        address traitsAddress,
        address randomizerAddress,
        address masterContractAddress
    ) external onlyOwner {
        apesContract = IApes(apesAddress);
        traitsContract = ITraits(traitsAddress);
        randomizerContract = IRandomizer(randomizerAddress);
        masterContract = IMasterContract(masterContractAddress);
    }

    function withdrawETH(address _address, uint256 amount)
        public
        nonReentrant
        onlyOwner
    {
        require(amount <= address(this).balance, "Insufficient funds");
        (bool success, ) = _address.call{value: amount}("");
        require(success, "Unable to send eth");
    }

    function _verifyHashSignature(bytes32 freshHash, bytes memory signature)
        internal
        view
        returns (bool)
    {
        bytes32 hash = keccak256(
            abi.encodePacked("\x19Ethereum Signed Message:\n32", freshHash)
        );
        bytes32 r;
        bytes32 s;
        uint8 v;
        if (signature.length != 65) {
            return false;
        }
        assembly {
            r := mload(add(signature, 32))
            s := mload(add(signature, 64))
            v := byte(0, mload(add(signature, 96)))
        }
        if (v < 27) {
            v += 27;
        }
        address signer = address(0);
        if (v == 27 || v == 28) {
            // solium-disable-next-line arg-overflow
            signer = ecrecover(hash, v, r, s);
        }
        return secret == signer;
    }
}

File 2 of 13 : ITraits.sol
// SPDX-License-Identifier: GPL-3.0
// solhint-disable-next-line
pragma solidity 0.8.12;

interface ITraits {
    function mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts
    ) external;

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 3 of 13 : IRandomizer.sol
// SPDX-License-Identifier: GPL-3.0
// solhint-disable-next-line
pragma solidity 0.8.12;

interface IRandomizer {
    function getRandom(
        bytes memory data,
        uint256 amount,
        uint256 timeOut
    ) external view returns (uint256[] memory, bool);
}

File 4 of 13 : IMasterContract.sol
// SPDX-License-Identifier: GPL-3.0
// solhint-disable-next-line
pragma solidity 0.8.12;

interface IMasterContract {
    // METH functions

    function claim(address to, uint256 amount) external;

    function pay(uint256 payment, uint256 fee) external;

    // Teens functions

    function airdrop(address to, uint256 amount) external;

    function burnTeenBull(uint256 tokenId) external;

    // Utilities functions

    function burn(uint256 id, uint256 amount) external;

    function airdrop(
        address to,
        uint256 amount,
        uint256 id
    ) external;
}

File 5 of 13 : IApes.sol
// SPDX-License-Identifier: GPL-3.0
// solhint-disable-next-line
pragma solidity 0.8.12;

interface IApes {
    function confirmChange(uint256 tokenId) external;

    function ownerOf(uint256 tokenId) external view returns (address owner);
}

File 6 of 13 : 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 7 of 13 : 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 8 of 13 : 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 13 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

File 10 of 13 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

File 11 of 13 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"apesAddress","type":"address"},{"internalType":"address","name":"traitsAddress","type":"address"},{"internalType":"address","name":"randomizerAddress","type":"address"},{"internalType":"address","name":"masterContractAddress","type":"address"},{"internalType":"address","name":"signer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"boxType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"apeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"prizes","type":"uint256[]"}],"name":"BoxOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"MethBagBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"MethBagCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"boxType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"prizes","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"operator","type":"address"}],"name":"SpecialBoxOpened","type":"event"},{"inputs":[],"name":"POWER_COOLDOWN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"apeLastBox","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"apeLastFreeSpin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"apeOpenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"apesContract","outputs":[{"internalType":"contract IApes","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bagPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"timeOut","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"buyMethBag","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"freeSpinsCooldown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterContract","outputs":[{"internalType":"contract IMasterContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"apeId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"boxType","type":"uint256"},{"internalType":"uint256","name":"timeOut","type":"uint256"},{"internalType":"bool","name":"hasPower","type":"bool"},{"internalType":"bytes","name":"randomSeed","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"openCommonBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"boxType","type":"uint256"},{"internalType":"uint256","name":"timeOut","type":"uint256"},{"internalType":"bytes","name":"randomSeed","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"openSpecialBox","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomizerContract","outputs":[{"internalType":"contract IRandomizer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"secret","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"apesAddress","type":"address"},{"internalType":"address","name":"traitsAddress","type":"address"},{"internalType":"address","name":"randomizerAddress","type":"address"},{"internalType":"address","name":"masterContractAddress","type":"address"}],"name":"setContractAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newCooldown","type":"uint256"}],"name":"setFreeSpinCooldown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setMethBagPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"setSecret","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":[],"name":"traitsContract","outputs":[{"internalType":"contract ITraits","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526102586002553480156200001757600080fd5b5060405162002443380380620024438339810160408190526200003a9162000119565b6200004533620000ac565b60018055600380546001600160a01b03199081166001600160a01b0397881617909155600480548216958716959095179094556005805485169386169390931790925560068054841691851691909117905560078054909216921691909117905562000189565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200011457600080fd5b919050565b600080600080600060a086880312156200013257600080fd5b6200013d86620000fc565b94506200014d60208701620000fc565b93506200015d60408701620000fc565b92506200016d60608701620000fc565b91506200017d60808701620000fc565b90509295509295909350565b6122aa80620001996000396000f3fe6080604052600436106101665760003560e01c8063715018a6116100d1578063cacd1a4f1161008a578063d1efd30d11610064578063d1efd30d14610466578063e9a7484c14610486578063f23a6e61146104a6578063f2fde38b146104d257600080fd5b8063cacd1a4f146103ec578063cd2217c414610419578063cd446e221461044657600080fd5b8063715018a6146103145780637ce80b85146103295780638da5cb5b14610349578063aaa6877714610367578063bc197c8114610387578063c093afdb146103cc57600080fd5b806336c7c12c1161012357806336c7c12c1461024757806343102d89146102675780634782f779146102945780635c3b911d146102b45780636eb8ceab146102e157806370dd3c851461030157600080fd5b806301ffc9a71461016b5780630b5a5d62146101a057806310e825b1146101c45780632265c670146101da578063279a20bc146101fc578063333333e014610234575b600080fd5b34801561017757600080fd5b5061018b61018636600461193d565b6104f2565b60405190151581526020015b60405180910390f35b3480156101ac57600080fd5b506101b660025481565b604051908152602001610197565b3480156101d057600080fd5b506101b661a8c081565b3480156101e657600080fd5b506101fa6101f53660046119c4565b610529565b005b34801561020857600080fd5b5060035461021c906001600160a01b031681565b6040516001600160a01b039091168152602001610197565b6101fa610242366004611a79565b610b7a565b34801561025357600080fd5b5060055461021c906001600160a01b031681565b34801561027357600080fd5b506101b6610282366004611b0e565b60086020526000908152604090205481565b3480156102a057600080fd5b506101fa6102af366004611b3c565b6111fd565b3480156102c057600080fd5b506101b66102cf366004611b0e565b600a6020526000908152604090205481565b3480156102ed57600080fd5b506101fa6102fc366004611b68565b6112f8565b6101fa61030f366004611b8a565b6113a5565b34801561032057600080fd5b506101fa6115ee565b34801561033557600080fd5b506101fa610344366004611b0e565b611602565b34801561035557600080fd5b506000546001600160a01b031661021c565b34801561037357600080fd5b506101fa610382366004611bfc565b61160f565b34801561039357600080fd5b506103b36103a2366004611d9b565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610197565b3480156103d857600080fd5b5060045461021c906001600160a01b031681565b3480156103f857600080fd5b506101b6610407366004611b0e565b600b6020526000908152604090205481565b34801561042557600080fd5b506101b6610434366004611b0e565b60096020526000908152604090205481565b34801561045257600080fd5b5060065461021c906001600160a01b031681565b34801561047257600080fd5b5060075461021c906001600160a01b031681565b34801561049257600080fd5b506101fa6104a1366004611e48565b611667565b3480156104b257600080fd5b506103b36104c1366004611e65565b63f23a6e6160e01b95945050505050565b3480156104de57600080fd5b506101fa6104ed366004611e48565b611691565b60006001600160e01b03198216630271189760e51b148061052357506301ffc9a760e01b6001600160e01b03198316145b92915050565b600c828260405161053b929190611ecd565b9081526040519081900360200190205460ff16156105a05760405162461bcd60e51b815260206004820152601f60248201527f4f70656e426f783a205369676e617475726520616c726561647920757365640060448201526064015b60405180910390fd5b4286116105ef5760405162461bcd60e51b815260206004820181905260248201527f4f70656e426f783a2053656564206973206e6f206c6f6e6765722076616c69646044820152606401610597565b861561063d5760405162461bcd60e51b815260206004820152601a60248201527f4f70656e426f783a20426f7854797065206e6f742076616c69640000000000006044820152606401610597565b6003546040516331a9108f60e11b8152600481018c90526000916001600160a01b031690636352211e90602401602060405180830381865afa158015610687573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ab9190611edd565b905061072533828d8d8d8d8d8d8d8d6040516020016106d39a99989796959493929190611f23565b6040516020818303038152906040528051906020012084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061170a92505050565b6107715760405162461bcd60e51b815260206004820152601d60248201527f4f70656e426f783a205369676e617475726520697320696e76616c69640000006044820152606401610597565b6001600c8484604051610785929190611ecd565b908152604051908190036020019020805491151560ff199092169190911790558815610934578515806107d3575060008b81526008602052604090205442906107d19061a8c090611f9e565b115b156108a85760008b81526008602052604090205442906107f59061012c611f9e565b116108425760405162461bcd60e51b815260206004820152601d60248201527f4f70656e426f783a205265206f70656e2074696d6520656c61707365640000006044820152606401610597565b60008b8152600a60205260409020541561086857610861896002611fb6565b98506108b8565b6107d06108778a610bb8611fb6565b6108819190611fd5565b60008c8152600a602052604081208054929b509061089e83611ff7565b91905055506108b8565b60008b8152600a60205260408120555b60008b8152600860205260409081902042905560065490516377a4777360e11b8152600481018b9052602481018b90526001600160a01b039091169063ef48eee690604401600060405180830381600087803b15801561091757600080fd5b505af115801561092b573d6000803e3d6000fd5b505050506109b0565b60025460008c815260096020526040902054429161095191611f9e565b1161099e5760405162461bcd60e51b815260206004820152601c60248201527f4f70656e426f783a2046726565207370696e7320636f6f6c646f776e000000006044820152606401610597565b60008b81526009602052604090204290555b600080600560009054906101000a90046001600160a01b03166001600160a01b03166308082b9788888f8d6040518563ffffffff1660e01b81526004016109fa9493929190612012565b600060405180830381865afa158015610a17573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a3f9190810190612049565b9150915060008c6001600160401b03811115610a5d57610a5d611c58565b604051908082528060200260200182016040528015610a86578160200160208202803683370190505b50905060005b8d811015610ac5576001828281518110610aa857610aa86120eb565b602090810291909101015280610abd81611ff7565b915050610a8c565b506004805460405163d81d0a1560e01b81526001600160a01b039091169163d81d0a1591610af9913391889187910161213c565b600060405180830381600087803b158015610b1357600080fd5b505af1158015610b27573d6000803e3d6000fd5b505050507ff41ba0ea15c56d66ab089b32385bd1e172a677f4ad77e102e89b08a6e7c1108a8b8f8f8f87604051610b6295949392919061217c565b60405180910390a15050505050505050505050505050565b600c8282604051610b8c929190611ecd565b9081526040519081900360200190205460ff1615610bec5760405162461bcd60e51b815260206004820152601f60248201527f4f70656e426f783a205369676e617475726520616c72656164792075736564006044820152606401610597565b428511610c3b5760405162461bcd60e51b815260206004820181905260248201527f4f70656e426f783a2053656564206973206e6f206c6f6e6765722076616c69646044820152606401610597565b60008611610c8b5760405162461bcd60e51b815260206004820152601a60248201527f4f70656e426f783a20426f7854797065206e6f742076616c69640000000000006044820152606401610597565b863414610cda5760405162461bcd60e51b815260206004820152601860248201527f4f70656e426f783a2057726f6e67204554482076616c756500000000000000006044820152606401610597565b610d4c33898989898989604051602001610cfa97969594939291906121b2565b6040516020818303038152906040528051906020012083838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061170a92505050565b610d985760405162461bcd60e51b815260206004820152601d60248201527f4f70656e426f783a205369676e617475726520697320696e76616c69640000006044820152606401610597565b6001600c8383604051610dac929190611ecd565b908152604051908190036020018120805492151560ff19909316929092179091556005546308082b9760e01b825260009182916001600160a01b0316906308082b9790610e0390899089908f908d90600401612012565b600060405180830381865afa158015610e20573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e489190810190612049565b90925090508981156110c75760005b8351811015610f20576000848281518110610e7457610e746120eb565b60200260200101519050602781118015610e8e5750602c81105b15610f0d5760065460405163e1bc296760e01b815233600482015260016024820152604481018390526001600160a01b039091169063e1bc296790606401600060405180830381600087803b158015610ee657600080fd5b505af1158015610efa573d6000803e3d6000fd5b505050508280610f09906121f9565b9350505b5080610f1881611ff7565b915050610e57565b5080156110c2576000816001600160401b03811115610f4157610f41611c58565b604051908082528060200260200182016040528015610f6a578160200160208202803683370190505b5090506000826001600160401b03811115610f8757610f87611c58565b604051908082528060200260200182016040528015610fb0578160200160208202803683370190505b5090506000805b8651811015611058576000878281518110610fd457610fd46120eb565b60200260200101519050602781118015610fee5750602c81105b15610ff95750611046565b600184848151811061100d5761100d6120eb565b6020026020010181815250508085848151811061102c5761102c6120eb565b60209081029190910101528261104181611ff7565b935050505b8061105081611ff7565b915050610fb7565b506004805460405163d81d0a1560e01b81526001600160a01b039091169163d81d0a159161108c913391889188910161213c565b600060405180830381600087803b1580156110a657600080fd5b505af11580156110ba573d6000803e3d6000fd5b505050505050505b6111b1565b6000816001600160401b038111156110e1576110e1611c58565b60405190808252806020026020018201604052801561110a578160200160208202803683370190505b50905060005b8281101561114957600182828151811061112c5761112c6120eb565b60209081029190910101528061114181611ff7565b915050611110565b506004805460405163d81d0a1560e01b81526001600160a01b039091169163d81d0a159161117d913391899187910161213c565b600060405180830381600087803b15801561119757600080fd5b505af11580156111ab573d6000803e3d6000fd5b50505050505b7f9778d38af7b4d45a9237824b30c0f591fdb218899c3985b71456f68366ebeec4898c8c86336040516111e8959493929190612210565b60405180910390a15050505050505050505050565b611205611839565b61120d611893565b478111156112525760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610597565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461129f576040519150601f19603f3d011682016040523d82523d6000602084013e6112a4565b606091505b50509050806112ea5760405162461bcd60e51b81526020600482015260126024820152710aadcc2c4d8ca40e8de40e6cadcc840cae8d60731b6044820152606401610597565b506112f460018055565b5050565b611300611893565b600082116113505760405162461bcd60e51b815260206004820152601760248201527f4d45544820616d6f756e743a2063616e277420626520300000000000000000006044820152606401610597565b6000828152600b60209081526040918290208390558151848152908101839052338183015290517f0a5caa766007079f2b66c5b6da7f21833dd554af2ea032bce543c3f9d97f0a509181900360600190a15050565b4283116114005760405162461bcd60e51b815260206004820152602360248201527f6275794d6574684261673a2053656564206973206e6f206c6f6e6765722076616044820152621b1a5960ea1b6064820152608401610597565b60408051602081018890526001600160a01b0387169181019190915260608101859052608081018490526114369060a001610cfa565b6114825760405162461bcd60e51b815260206004820181905260248201527f6275794d6574684261673a205369676e617475726520697320696e76616c69646044820152606401610597565b600084116114dc5760405162461bcd60e51b815260206004820152602160248201527f427579204d455448206261673a20616d6f756e74206973206e6f742076616c696044820152601960fa1b6064820152608401610597565b8334146115375760405162461bcd60e51b815260206004820152602360248201527f427579204d455448206261673a206e6f7420656e6f7567682045544820746f2060448201526262757960e81b6064820152608401610597565b600654604051635569f64b60e11b81526001600160a01b038781166004830152602482018990529091169063aad3ec9690604401600060405180830381600087803b15801561158557600080fd5b505af1158015611599573d6000803e3d6000fd5b505060408051898152602081018890526001600160a01b0389168183015290517fad00b221dee527e143291df34fe057685d977c8db3da9cf71acf16ec48d15c8b9350908190036060019150a1505050505050565b6115f6611893565b61160060006118ed565b565b61160a611893565b600255565b611617611893565b600380546001600160a01b039586166001600160a01b0319918216179091556004805494861694821694909417909355600580549285169284169290921790915560068054919093169116179055565b61166f611893565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b611699611893565b6001600160a01b0381166116fe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610597565b611707816118ed565b50565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018390526000908190605c0160405160208183030381529060405280519060200120905060008060008551604114611775576000945050505050610523565b50505060208301516040840151606085015160001a601b8110156117a15761179e601b8261224f565b90505b60008160ff16601b14806117b857508160ff16601c145b1561181d5760408051600081526020810180835287905260ff841691810191909152606081018590526080810184905260019060a0016020604051602081039080840390855afa158015611810573d6000803e3d6000fd5b5050506020604051035190505b6007546001600160a01b03918216911614979650505050505050565b6002600154141561188c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610597565b6002600155565b6000546001600160a01b031633146116005760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610597565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561194f57600080fd5b81356001600160e01b03198116811461196757600080fd5b9392505050565b801515811461170757600080fd5b60008083601f84011261198e57600080fd5b5081356001600160401b038111156119a557600080fd5b6020830191508360208285010111156119bd57600080fd5b9250929050565b6000806000806000806000806000806101008b8d0312156119e457600080fd5b8a35995060208b0135985060408b0135975060608b0135965060808b0135955060a08b0135611a128161196e565b945060c08b01356001600160401b0380821115611a2e57600080fd5b611a3a8e838f0161197c565b909650945060e08d0135915080821115611a5357600080fd5b50611a608d828e0161197c565b915080935050809150509295989b9194979a5092959850565b60008060008060008060008060c0898b031215611a9557600080fd5b8835975060208901359650604089013595506060890135945060808901356001600160401b0380821115611ac857600080fd5b611ad48c838d0161197c565b909650945060a08b0135915080821115611aed57600080fd5b50611afa8b828c0161197c565b999c989b5096995094979396929594505050565b600060208284031215611b2057600080fd5b5035919050565b6001600160a01b038116811461170757600080fd5b60008060408385031215611b4f57600080fd5b8235611b5a81611b27565b946020939093013593505050565b60008060408385031215611b7b57600080fd5b50508035926020909101359150565b60008060008060008060a08789031215611ba357600080fd5b863595506020870135611bb581611b27565b9450604087013593506060870135925060808701356001600160401b03811115611bde57600080fd5b611bea89828a0161197c565b979a9699509497509295939492505050565b60008060008060808587031215611c1257600080fd5b8435611c1d81611b27565b93506020850135611c2d81611b27565b92506040850135611c3d81611b27565b91506060850135611c4d81611b27565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611c9657611c96611c58565b604052919050565b60006001600160401b03821115611cb757611cb7611c58565b5060051b60200190565b600082601f830112611cd257600080fd5b81356020611ce7611ce283611c9e565b611c6e565b82815260059290921b84018101918181019086841115611d0657600080fd5b8286015b84811015611d215780358352918301918301611d0a565b509695505050505050565b600082601f830112611d3d57600080fd5b81356001600160401b03811115611d5657611d56611c58565b611d69601f8201601f1916602001611c6e565b818152846020838601011115611d7e57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215611db357600080fd5b8535611dbe81611b27565b94506020860135611dce81611b27565b935060408601356001600160401b0380821115611dea57600080fd5b611df689838a01611cc1565b94506060880135915080821115611e0c57600080fd5b611e1889838a01611cc1565b93506080880135915080821115611e2e57600080fd5b50611e3b88828901611d2c565b9150509295509295909350565b600060208284031215611e5a57600080fd5b813561196781611b27565b600080600080600060a08688031215611e7d57600080fd5b8535611e8881611b27565b94506020860135611e9881611b27565b9350604086013592506060860135915060808601356001600160401b03811115611ec157600080fd5b611e3b88828901611d2c565b8183823760009101908152919050565b600060208284031215611eef57600080fd5b815161196781611b27565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600061012060018060a01b03808e168452808d166020850152508a60408401528960608401528860808401528760a08401528660c084015285151560e084015280610100840152611f778184018587611efa565b9d9c50505050505050505050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611fb157611fb1611f88565b500190565b6000816000190483118215151615611fd057611fd0611f88565b500290565b600082611ff257634e487b7160e01b600052601260045260246000fd5b500490565b600060001982141561200b5761200b611f88565b5060010190565b606081526000612026606083018688611efa565b6020830194909452506040015292915050565b80516120448161196e565b919050565b6000806040838503121561205c57600080fd5b82516001600160401b0381111561207257600080fd5b8301601f8101851361208357600080fd5b80516020612093611ce283611c9e565b82815260059290921b830181019181810190888411156120b257600080fd5b938201935b838510156120d0578451825293820193908201906120b7565b95506120df9050868201612039565b93505050509250929050565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b8381101561213157815187529582019590820190600101612115565b509495945050505050565b6001600160a01b038416815260606020820181905260009061216090830185612101565b82810360408401526121728185612101565b9695505050505050565b85815284602082015283604082015282606082015260a0608082015260006121a760a0830184612101565b979650505050505050565b60018060a01b038816815286602082015285604082015284606082015283608082015260c060a082015260006121ec60c083018486611efa565b9998505050505050505050565b60008161220857612208611f88565b506000190190565b85815284602082015283604082015260a06060820152600061223560a0830185612101565b905060018060a01b03831660808301529695505050505050565b600060ff821660ff84168060ff0382111561226c5761226c611f88565b01939250505056fea2646970667358221220a41476d10dcc86feef71bfc484d2bc7593771595adfcf0de3caf20b6eac7fbb264736f6c634300080c00330000000000000000000000007f29b85834d6a2ba4bb1c64325686c6057b1b3c5000000000000000000000000ee9e6146e635e5da5c3885b2a641321c5a50da7e000000000000000000000000a98fae83014ef594bf0fc730cb17d0abb058207f000000000000000000000000d8162d9703d1c13476fee3f20adf2c6468683f0e000000000000000000000000c8033181079b4a920cf5a3fd1a9f15fccc8c610f

Deployed Bytecode

0x6080604052600436106101665760003560e01c8063715018a6116100d1578063cacd1a4f1161008a578063d1efd30d11610064578063d1efd30d14610466578063e9a7484c14610486578063f23a6e61146104a6578063f2fde38b146104d257600080fd5b8063cacd1a4f146103ec578063cd2217c414610419578063cd446e221461044657600080fd5b8063715018a6146103145780637ce80b85146103295780638da5cb5b14610349578063aaa6877714610367578063bc197c8114610387578063c093afdb146103cc57600080fd5b806336c7c12c1161012357806336c7c12c1461024757806343102d89146102675780634782f779146102945780635c3b911d146102b45780636eb8ceab146102e157806370dd3c851461030157600080fd5b806301ffc9a71461016b5780630b5a5d62146101a057806310e825b1146101c45780632265c670146101da578063279a20bc146101fc578063333333e014610234575b600080fd5b34801561017757600080fd5b5061018b61018636600461193d565b6104f2565b60405190151581526020015b60405180910390f35b3480156101ac57600080fd5b506101b660025481565b604051908152602001610197565b3480156101d057600080fd5b506101b661a8c081565b3480156101e657600080fd5b506101fa6101f53660046119c4565b610529565b005b34801561020857600080fd5b5060035461021c906001600160a01b031681565b6040516001600160a01b039091168152602001610197565b6101fa610242366004611a79565b610b7a565b34801561025357600080fd5b5060055461021c906001600160a01b031681565b34801561027357600080fd5b506101b6610282366004611b0e565b60086020526000908152604090205481565b3480156102a057600080fd5b506101fa6102af366004611b3c565b6111fd565b3480156102c057600080fd5b506101b66102cf366004611b0e565b600a6020526000908152604090205481565b3480156102ed57600080fd5b506101fa6102fc366004611b68565b6112f8565b6101fa61030f366004611b8a565b6113a5565b34801561032057600080fd5b506101fa6115ee565b34801561033557600080fd5b506101fa610344366004611b0e565b611602565b34801561035557600080fd5b506000546001600160a01b031661021c565b34801561037357600080fd5b506101fa610382366004611bfc565b61160f565b34801561039357600080fd5b506103b36103a2366004611d9b565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610197565b3480156103d857600080fd5b5060045461021c906001600160a01b031681565b3480156103f857600080fd5b506101b6610407366004611b0e565b600b6020526000908152604090205481565b34801561042557600080fd5b506101b6610434366004611b0e565b60096020526000908152604090205481565b34801561045257600080fd5b5060065461021c906001600160a01b031681565b34801561047257600080fd5b5060075461021c906001600160a01b031681565b34801561049257600080fd5b506101fa6104a1366004611e48565b611667565b3480156104b257600080fd5b506103b36104c1366004611e65565b63f23a6e6160e01b95945050505050565b3480156104de57600080fd5b506101fa6104ed366004611e48565b611691565b60006001600160e01b03198216630271189760e51b148061052357506301ffc9a760e01b6001600160e01b03198316145b92915050565b600c828260405161053b929190611ecd565b9081526040519081900360200190205460ff16156105a05760405162461bcd60e51b815260206004820152601f60248201527f4f70656e426f783a205369676e617475726520616c726561647920757365640060448201526064015b60405180910390fd5b4286116105ef5760405162461bcd60e51b815260206004820181905260248201527f4f70656e426f783a2053656564206973206e6f206c6f6e6765722076616c69646044820152606401610597565b861561063d5760405162461bcd60e51b815260206004820152601a60248201527f4f70656e426f783a20426f7854797065206e6f742076616c69640000000000006044820152606401610597565b6003546040516331a9108f60e11b8152600481018c90526000916001600160a01b031690636352211e90602401602060405180830381865afa158015610687573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ab9190611edd565b905061072533828d8d8d8d8d8d8d8d6040516020016106d39a99989796959493929190611f23565b6040516020818303038152906040528051906020012084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061170a92505050565b6107715760405162461bcd60e51b815260206004820152601d60248201527f4f70656e426f783a205369676e617475726520697320696e76616c69640000006044820152606401610597565b6001600c8484604051610785929190611ecd565b908152604051908190036020019020805491151560ff199092169190911790558815610934578515806107d3575060008b81526008602052604090205442906107d19061a8c090611f9e565b115b156108a85760008b81526008602052604090205442906107f59061012c611f9e565b116108425760405162461bcd60e51b815260206004820152601d60248201527f4f70656e426f783a205265206f70656e2074696d6520656c61707365640000006044820152606401610597565b60008b8152600a60205260409020541561086857610861896002611fb6565b98506108b8565b6107d06108778a610bb8611fb6565b6108819190611fd5565b60008c8152600a602052604081208054929b509061089e83611ff7565b91905055506108b8565b60008b8152600a60205260408120555b60008b8152600860205260409081902042905560065490516377a4777360e11b8152600481018b9052602481018b90526001600160a01b039091169063ef48eee690604401600060405180830381600087803b15801561091757600080fd5b505af115801561092b573d6000803e3d6000fd5b505050506109b0565b60025460008c815260096020526040902054429161095191611f9e565b1161099e5760405162461bcd60e51b815260206004820152601c60248201527f4f70656e426f783a2046726565207370696e7320636f6f6c646f776e000000006044820152606401610597565b60008b81526009602052604090204290555b600080600560009054906101000a90046001600160a01b03166001600160a01b03166308082b9788888f8d6040518563ffffffff1660e01b81526004016109fa9493929190612012565b600060405180830381865afa158015610a17573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a3f9190810190612049565b9150915060008c6001600160401b03811115610a5d57610a5d611c58565b604051908082528060200260200182016040528015610a86578160200160208202803683370190505b50905060005b8d811015610ac5576001828281518110610aa857610aa86120eb565b602090810291909101015280610abd81611ff7565b915050610a8c565b506004805460405163d81d0a1560e01b81526001600160a01b039091169163d81d0a1591610af9913391889187910161213c565b600060405180830381600087803b158015610b1357600080fd5b505af1158015610b27573d6000803e3d6000fd5b505050507ff41ba0ea15c56d66ab089b32385bd1e172a677f4ad77e102e89b08a6e7c1108a8b8f8f8f87604051610b6295949392919061217c565b60405180910390a15050505050505050505050505050565b600c8282604051610b8c929190611ecd565b9081526040519081900360200190205460ff1615610bec5760405162461bcd60e51b815260206004820152601f60248201527f4f70656e426f783a205369676e617475726520616c72656164792075736564006044820152606401610597565b428511610c3b5760405162461bcd60e51b815260206004820181905260248201527f4f70656e426f783a2053656564206973206e6f206c6f6e6765722076616c69646044820152606401610597565b60008611610c8b5760405162461bcd60e51b815260206004820152601a60248201527f4f70656e426f783a20426f7854797065206e6f742076616c69640000000000006044820152606401610597565b863414610cda5760405162461bcd60e51b815260206004820152601860248201527f4f70656e426f783a2057726f6e67204554482076616c756500000000000000006044820152606401610597565b610d4c33898989898989604051602001610cfa97969594939291906121b2565b6040516020818303038152906040528051906020012083838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061170a92505050565b610d985760405162461bcd60e51b815260206004820152601d60248201527f4f70656e426f783a205369676e617475726520697320696e76616c69640000006044820152606401610597565b6001600c8383604051610dac929190611ecd565b908152604051908190036020018120805492151560ff19909316929092179091556005546308082b9760e01b825260009182916001600160a01b0316906308082b9790610e0390899089908f908d90600401612012565b600060405180830381865afa158015610e20573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e489190810190612049565b90925090508981156110c75760005b8351811015610f20576000848281518110610e7457610e746120eb565b60200260200101519050602781118015610e8e5750602c81105b15610f0d5760065460405163e1bc296760e01b815233600482015260016024820152604481018390526001600160a01b039091169063e1bc296790606401600060405180830381600087803b158015610ee657600080fd5b505af1158015610efa573d6000803e3d6000fd5b505050508280610f09906121f9565b9350505b5080610f1881611ff7565b915050610e57565b5080156110c2576000816001600160401b03811115610f4157610f41611c58565b604051908082528060200260200182016040528015610f6a578160200160208202803683370190505b5090506000826001600160401b03811115610f8757610f87611c58565b604051908082528060200260200182016040528015610fb0578160200160208202803683370190505b5090506000805b8651811015611058576000878281518110610fd457610fd46120eb565b60200260200101519050602781118015610fee5750602c81105b15610ff95750611046565b600184848151811061100d5761100d6120eb565b6020026020010181815250508085848151811061102c5761102c6120eb565b60209081029190910101528261104181611ff7565b935050505b8061105081611ff7565b915050610fb7565b506004805460405163d81d0a1560e01b81526001600160a01b039091169163d81d0a159161108c913391889188910161213c565b600060405180830381600087803b1580156110a657600080fd5b505af11580156110ba573d6000803e3d6000fd5b505050505050505b6111b1565b6000816001600160401b038111156110e1576110e1611c58565b60405190808252806020026020018201604052801561110a578160200160208202803683370190505b50905060005b8281101561114957600182828151811061112c5761112c6120eb565b60209081029190910101528061114181611ff7565b915050611110565b506004805460405163d81d0a1560e01b81526001600160a01b039091169163d81d0a159161117d913391899187910161213c565b600060405180830381600087803b15801561119757600080fd5b505af11580156111ab573d6000803e3d6000fd5b50505050505b7f9778d38af7b4d45a9237824b30c0f591fdb218899c3985b71456f68366ebeec4898c8c86336040516111e8959493929190612210565b60405180910390a15050505050505050505050565b611205611839565b61120d611893565b478111156112525760405162461bcd60e51b8152602060048201526012602482015271496e73756666696369656e742066756e647360701b6044820152606401610597565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461129f576040519150601f19603f3d011682016040523d82523d6000602084013e6112a4565b606091505b50509050806112ea5760405162461bcd60e51b81526020600482015260126024820152710aadcc2c4d8ca40e8de40e6cadcc840cae8d60731b6044820152606401610597565b506112f460018055565b5050565b611300611893565b600082116113505760405162461bcd60e51b815260206004820152601760248201527f4d45544820616d6f756e743a2063616e277420626520300000000000000000006044820152606401610597565b6000828152600b60209081526040918290208390558151848152908101839052338183015290517f0a5caa766007079f2b66c5b6da7f21833dd554af2ea032bce543c3f9d97f0a509181900360600190a15050565b4283116114005760405162461bcd60e51b815260206004820152602360248201527f6275794d6574684261673a2053656564206973206e6f206c6f6e6765722076616044820152621b1a5960ea1b6064820152608401610597565b60408051602081018890526001600160a01b0387169181019190915260608101859052608081018490526114369060a001610cfa565b6114825760405162461bcd60e51b815260206004820181905260248201527f6275794d6574684261673a205369676e617475726520697320696e76616c69646044820152606401610597565b600084116114dc5760405162461bcd60e51b815260206004820152602160248201527f427579204d455448206261673a20616d6f756e74206973206e6f742076616c696044820152601960fa1b6064820152608401610597565b8334146115375760405162461bcd60e51b815260206004820152602360248201527f427579204d455448206261673a206e6f7420656e6f7567682045544820746f2060448201526262757960e81b6064820152608401610597565b600654604051635569f64b60e11b81526001600160a01b038781166004830152602482018990529091169063aad3ec9690604401600060405180830381600087803b15801561158557600080fd5b505af1158015611599573d6000803e3d6000fd5b505060408051898152602081018890526001600160a01b0389168183015290517fad00b221dee527e143291df34fe057685d977c8db3da9cf71acf16ec48d15c8b9350908190036060019150a1505050505050565b6115f6611893565b61160060006118ed565b565b61160a611893565b600255565b611617611893565b600380546001600160a01b039586166001600160a01b0319918216179091556004805494861694821694909417909355600580549285169284169290921790915560068054919093169116179055565b61166f611893565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b611699611893565b6001600160a01b0381166116fe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610597565b611707816118ed565b50565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018390526000908190605c0160405160208183030381529060405280519060200120905060008060008551604114611775576000945050505050610523565b50505060208301516040840151606085015160001a601b8110156117a15761179e601b8261224f565b90505b60008160ff16601b14806117b857508160ff16601c145b1561181d5760408051600081526020810180835287905260ff841691810191909152606081018590526080810184905260019060a0016020604051602081039080840390855afa158015611810573d6000803e3d6000fd5b5050506020604051035190505b6007546001600160a01b03918216911614979650505050505050565b6002600154141561188c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610597565b6002600155565b6000546001600160a01b031633146116005760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610597565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561194f57600080fd5b81356001600160e01b03198116811461196757600080fd5b9392505050565b801515811461170757600080fd5b60008083601f84011261198e57600080fd5b5081356001600160401b038111156119a557600080fd5b6020830191508360208285010111156119bd57600080fd5b9250929050565b6000806000806000806000806000806101008b8d0312156119e457600080fd5b8a35995060208b0135985060408b0135975060608b0135965060808b0135955060a08b0135611a128161196e565b945060c08b01356001600160401b0380821115611a2e57600080fd5b611a3a8e838f0161197c565b909650945060e08d0135915080821115611a5357600080fd5b50611a608d828e0161197c565b915080935050809150509295989b9194979a5092959850565b60008060008060008060008060c0898b031215611a9557600080fd5b8835975060208901359650604089013595506060890135945060808901356001600160401b0380821115611ac857600080fd5b611ad48c838d0161197c565b909650945060a08b0135915080821115611aed57600080fd5b50611afa8b828c0161197c565b999c989b5096995094979396929594505050565b600060208284031215611b2057600080fd5b5035919050565b6001600160a01b038116811461170757600080fd5b60008060408385031215611b4f57600080fd5b8235611b5a81611b27565b946020939093013593505050565b60008060408385031215611b7b57600080fd5b50508035926020909101359150565b60008060008060008060a08789031215611ba357600080fd5b863595506020870135611bb581611b27565b9450604087013593506060870135925060808701356001600160401b03811115611bde57600080fd5b611bea89828a0161197c565b979a9699509497509295939492505050565b60008060008060808587031215611c1257600080fd5b8435611c1d81611b27565b93506020850135611c2d81611b27565b92506040850135611c3d81611b27565b91506060850135611c4d81611b27565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715611c9657611c96611c58565b604052919050565b60006001600160401b03821115611cb757611cb7611c58565b5060051b60200190565b600082601f830112611cd257600080fd5b81356020611ce7611ce283611c9e565b611c6e565b82815260059290921b84018101918181019086841115611d0657600080fd5b8286015b84811015611d215780358352918301918301611d0a565b509695505050505050565b600082601f830112611d3d57600080fd5b81356001600160401b03811115611d5657611d56611c58565b611d69601f8201601f1916602001611c6e565b818152846020838601011115611d7e57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215611db357600080fd5b8535611dbe81611b27565b94506020860135611dce81611b27565b935060408601356001600160401b0380821115611dea57600080fd5b611df689838a01611cc1565b94506060880135915080821115611e0c57600080fd5b611e1889838a01611cc1565b93506080880135915080821115611e2e57600080fd5b50611e3b88828901611d2c565b9150509295509295909350565b600060208284031215611e5a57600080fd5b813561196781611b27565b600080600080600060a08688031215611e7d57600080fd5b8535611e8881611b27565b94506020860135611e9881611b27565b9350604086013592506060860135915060808601356001600160401b03811115611ec157600080fd5b611e3b88828901611d2c565b8183823760009101908152919050565b600060208284031215611eef57600080fd5b815161196781611b27565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b600061012060018060a01b03808e168452808d166020850152508a60408401528960608401528860808401528760a08401528660c084015285151560e084015280610100840152611f778184018587611efa565b9d9c50505050505050505050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611fb157611fb1611f88565b500190565b6000816000190483118215151615611fd057611fd0611f88565b500290565b600082611ff257634e487b7160e01b600052601260045260246000fd5b500490565b600060001982141561200b5761200b611f88565b5060010190565b606081526000612026606083018688611efa565b6020830194909452506040015292915050565b80516120448161196e565b919050565b6000806040838503121561205c57600080fd5b82516001600160401b0381111561207257600080fd5b8301601f8101851361208357600080fd5b80516020612093611ce283611c9e565b82815260059290921b830181019181810190888411156120b257600080fd5b938201935b838510156120d0578451825293820193908201906120b7565b95506120df9050868201612039565b93505050509250929050565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b8381101561213157815187529582019590820190600101612115565b509495945050505050565b6001600160a01b038416815260606020820181905260009061216090830185612101565b82810360408401526121728185612101565b9695505050505050565b85815284602082015283604082015282606082015260a0608082015260006121a760a0830184612101565b979650505050505050565b60018060a01b038816815286602082015285604082015284606082015283608082015260c060a082015260006121ec60c083018486611efa565b9998505050505050505050565b60008161220857612208611f88565b506000190190565b85815284602082015283604082015260a06060820152600061223560a0830185612101565b905060018060a01b03831660808301529695505050505050565b600060ff821660ff84168060ff0382111561226c5761226c611f88565b01939250505056fea2646970667358221220a41476d10dcc86feef71bfc484d2bc7593771595adfcf0de3caf20b6eac7fbb264736f6c634300080c0033

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

0000000000000000000000007f29b85834d6a2ba4bb1c64325686c6057b1b3c5000000000000000000000000ee9e6146e635e5da5c3885b2a641321c5a50da7e000000000000000000000000a98fae83014ef594bf0fc730cb17d0abb058207f000000000000000000000000d8162d9703d1c13476fee3f20adf2c6468683f0e000000000000000000000000c8033181079b4a920cf5a3fd1a9f15fccc8c610f

-----Decoded View---------------
Arg [0] : apesAddress (address): 0x7f29b85834d6A2ba4BB1c64325686C6057B1B3C5
Arg [1] : traitsAddress (address): 0xee9e6146E635E5DA5C3885b2A641321C5A50Da7e
Arg [2] : randomizerAddress (address): 0xA98FAe83014EF594bF0fC730cb17d0Abb058207F
Arg [3] : masterContractAddress (address): 0xD8162D9703d1c13476FEE3f20ADF2c6468683F0e
Arg [4] : signer (address): 0xc8033181079b4a920cf5A3Fd1A9f15fCCC8C610F

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000007f29b85834d6a2ba4bb1c64325686c6057b1b3c5
Arg [1] : 000000000000000000000000ee9e6146e635e5da5c3885b2a641321c5a50da7e
Arg [2] : 000000000000000000000000a98fae83014ef594bf0fc730cb17d0abb058207f
Arg [3] : 000000000000000000000000d8162d9703d1c13476fee3f20adf2c6468683f0e
Arg [4] : 000000000000000000000000c8033181079b4a920cf5a3fd1a9f15fccc8c610f


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.