MOVR Price: $6.19 (+6.47%)
Gas: 3.3 GWei

Contract

0x77DA4F1D66004BEbfDa4D5A42931388CecaF81c5

Overview

MOVR Balance

Moonriver Chain LogoMoonriver Chain LogoMoonriver Chain Logo0 MOVR

MOVR Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x53c6fa0660861822024-02-05 12:53:07443 days ago1707137587IN
0x77DA4F1D...CecaF81c5
0 MOVR0.004124813.2385
0x53c6fa0656411732023-11-30 5:34:00510 days ago1701322440IN
0x77DA4F1D...CecaF81c5
0 MOVR0.002918852.75
0x53c6fa0653619892023-10-20 14:53:12551 days ago1697813592IN
0x77DA4F1D...CecaF81c5
0 MOVR0.002936392.9475
Lock To Claim Re...53619522023-10-20 14:45:36551 days ago1697813136IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000491522.75
0x53c6fa0653619482023-10-20 14:44:48551 days ago1697813088IN
0x77DA4F1D...CecaF81c5
0 MOVR0.002137832.84565
Lock To Claim Re...53619352023-10-20 14:42:12551 days ago1697812932IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000526822.9475
Lock To Claim Re...45950002023-07-03 23:04:00659 days ago1688425440IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000114732.9475
Lock To Claim Re...45950002023-07-03 23:04:00659 days ago1688425440IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000114732.9475
Lock To Claim Re...45949992023-07-03 23:03:48659 days ago1688425428IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000499612.9475
0x53c6fa0641145032023-04-26 0:08:31728 days ago1682467711IN
0x77DA4F1D...CecaF81c5
0 MOVR0.005574072.75
Lock To Claim Re...37226622023-02-28 21:45:54784 days ago1677620754IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000385972.5
0x53c6fa0637157652023-02-27 22:02:24785 days ago1677535344IN
0x77DA4F1D...CecaF81c5
0 MOVR0.002197082.5
Lock To Claim Re...37157472023-02-27 21:58:48785 days ago1677535128IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000385972.5
0x53c6fa0636255842023-02-15 2:02:36798 days ago1676426556IN
0x77DA4F1D...CecaF81c5
0 MOVR0.001291171
Lock To Claim Re...36255702023-02-15 1:59:48798 days ago1676426388IN
0x77DA4F1D...CecaF81c5
0 MOVR0.00016951
0x53c6fa0636252262023-02-15 0:48:48798 days ago1676422128IN
0x77DA4F1D...CecaF81c5
0 MOVR0.001384532.5
Lock To Claim Lo...36171492023-02-13 21:24:24799 days ago1676323464IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000370772.5
0x53c6fa0636171452023-02-13 21:23:36799 days ago1676323416IN
0x77DA4F1D...CecaF81c5
0 MOVR0.002490582.5
0x53c6fa0636167742023-02-13 20:08:36799 days ago1676318916IN
0x77DA4F1D...CecaF81c5
0 MOVR0.002323441
Lock To Claim Re...36105972023-02-12 23:10:36800 days ago1676243436IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000423752.5
0x53c6fa0636030232023-02-11 21:27:30801 days ago1676150850IN
0x77DA4F1D...CecaF81c5
0 MOVR0.001006852.5
Lock To Claim Re...36029892023-02-11 21:20:30801 days ago1676150430IN
0x77DA4F1D...CecaF81c5
0 MOVR0.000373972.5
Lock To Claim Re...36027242023-02-11 20:26:24801 days ago1676147184IN
0x77DA4F1D...CecaF81c5
0 MOVR0.00017431
0x53c6fa0636027162023-02-11 20:24:42801 days ago1676147082IN
0x77DA4F1D...CecaF81c5
0 MOVR0.002323441
0x53c6fa0636009332023-02-11 14:18:00802 days ago1676125080IN
0x77DA4F1D...CecaF81c5
0 MOVR0.001240292.5
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DPSPlunderersGuild

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 20 : DPSPlunderersGuild.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "./../interfaces/IERC20MintableBurnable.sol";
import "./interfaces/DPSInterfaces.sol";
import "./interfaces/DPSStructs.sol";

contract DPSPlunderersGuild is ERC1155Holder, Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    DPSChestsI public chest;
    MintableBurnableIERC1155 public lockedBox;
    DPSGameSettingsI public gameSettings;
    DPSRandomI public causality;
    MintableBurnableIERC1155 public artifact;
    IERC20MintableBurnable public doubloons;

    address public treasury;

    mapping(address => LockedChest) private lockedChests;
    mapping(address => mapping(uint8 => LockedChest[])) public claimedChests;

    mapping(address => LockedLockBox) private lockedLockBoxes;
    mapping(address => LockedLockBox[]) public claimedLockBoxes;

    struct LockedChest {
        VOYAGE_TYPE chestType;
        uint256 lockedBlock;
        uint256 lockedTimestamp;
        uint256 claimedBlock;
        uint256 amount;
        address owner;
    }

    struct LockedLockBox {
        uint256 lockedBlock;
        uint256 lockedTimestamp;
        uint256 claimedBlock;
        uint256 amount;
        address owner;
    }

    event SetContract(uint8 indexed _target, address _contract);
    event LockingChest(address indexed _owner, uint256 _type, uint256 _amount);
    event LockingLockBox(address indexed _owner, uint256 _amount);
    event ClaimedChests(address indexed _owner, VOYAGE_TYPE _type, uint256 _amount);
    event OpenedLockBox(address indexed _owner, ARTIFACT_TYPE _type);
    event TokenRecovered(address indexed _token, address _destination, uint256 _amount);
    event WonLockBocks(address indexed _user, uint256 _amount);
    event ChangedTreasury(address _newTreasury);
    event TreasuryUpdate(uint256 _amount);

    constructor() {}

    /**
     *  @notice Lock chests to be opened, you can lock as many chests as you want but for 1 single type
     *  @param _chestsType the type of chests you want to lock
     *  @param _amount the amount of chests you want to open
     */
    function lockToClaimRewards(uint256 _chestsType, uint256 _amount) external nonReentrant {
        if (gameSettings.isPaused(6) == 1) revert Paused();

        if (lockedChests[msg.sender].amount > 0) revert WrongState(1);

        if (chest.balanceOf(msg.sender, _chestsType) < _amount) revert WrongParams(1);

        lockedChests[msg.sender] = LockedChest(
            VOYAGE_TYPE(_chestsType),
            block.number,
            block.timestamp,
            0,
            _amount,
            msg.sender
        );

        chest.safeTransferFrom(msg.sender, address(this), _chestsType, _amount, "");

        emit LockingChest(msg.sender, _chestsType, _amount);
    }

    /**
     * @notice locks locked box to be opened, the locked boxes are giving artifacts and are super rare
     * @param _amount how many you want to open at a time.
     */
    function lockToClaimLockBox(uint256 _amount) external nonReentrant {
        if (gameSettings.isPaused(7) == 1) revert Paused();

        if (lockedLockBoxes[msg.sender].amount > 0) revert WrongParams(1);

        if (_amount > gameSettings.maxOpenLockBoxes()) revert WrongParams(2);

        lockedLockBoxes[msg.sender] = LockedLockBox(block.number, block.timestamp, 0, _amount, msg.sender);

        lockedBox.safeTransferFrom(msg.sender, address(this), 0, _amount, "");

        emit LockingLockBox(msg.sender, _amount);
    }

    /**
     * @notice claim locked chests, needs causality params generated by the backend because this using randomness
     * @param _causalityParams causality params generated by the backend
     */
    function claimLockedRewards(CausalityParams calldata _causalityParams, uint256 _amount) external nonReentrant {
        if (gameSettings.isPaused(8) == 1) revert Paused();
        LockedChest memory userLockedChests = lockedChests[msg.sender];
        if (userLockedChests.amount == 0) revert WrongParams(1);
        VOYAGE_TYPE voyageType = userLockedChests.chestType;
        uint256 doubloonsRewards;

        uint256 maxRoll = gameSettings.getMaxRollPerChest(voyageType);

        uint256 rewardedLockBox = 0;

        if (_amount > userLockedChests.amount) _amount = userLockedChests.amount;

        // not the right blocks sent
        if (userLockedChests.lockedBlock + gameSettings.blockJumps() + 1 != _causalityParams.blockNumber[0])
            revert WrongState(2);

        // blocks not passed
        if (userLockedChests.lockedBlock + gameSettings.blockJumps() >= block.number) revert WrongState(3);

        for (uint256 i; i < _amount; i++) {
            uint256 result = causality.getRandom(
                msg.sender,
                _causalityParams.blockNumber[0],
                _causalityParams.hash1[0],
                _causalityParams.hash2[0],
                _causalityParams.timestamp[0],
                _causalityParams.signature[0],
                string(abi.encodePacked("REWARDS_TYPE_", i)),
                0,
                10000
            );

            if (result <= maxRoll) rewardedLockBox++;

            userLockedChests.claimedBlock = block.number;
            claimedChests[msg.sender][uint8(voyageType)].push(userLockedChests);
            chest.burn(address(this), userLockedChests.chestType, 1);
        }
        doubloonsRewards = gameSettings.getChestDoubloonRewards(voyageType) * userLockedChests.amount;

        if (doubloonsRewards > 0) {
            doubloons.mint(msg.sender, doubloonsRewards);

            uint256 doubloonsRewardForTreasury = (doubloonsRewards * 5) / 100;
            // 5% goes is minted to the treasury
            doubloons.mint(treasury, doubloonsRewardForTreasury);
            emit TreasuryUpdate(doubloonsRewardForTreasury);
        }

        if (_amount >= userLockedChests.amount) delete lockedChests[msg.sender];
        else lockedChests[msg.sender].amount = userLockedChests.amount - _amount;

        if (rewardedLockBox > 0) {
            // minting lock boxes
            lockedBox.mint(msg.sender, 0, rewardedLockBox);
        }

        emit ClaimedChests(msg.sender, userLockedChests.chestType, userLockedChests.amount);
        emit WonLockBocks(msg.sender, rewardedLockBox);
    }

    /**
     * @notice claiming locked lock boxes. using causality params generated by the backend because it's using randomness to give
               artifact rewards
     * @param _causalityParams causality params generated by the backend
     */
    function claimLockedBox(CausalityParams calldata _causalityParams) external nonReentrant {
        if (gameSettings.isPaused(9) == 1) revert Paused();
        LockedLockBox memory lockedLockBox = lockedLockBoxes[msg.sender];

        // incorrect blocks
        if ((lockedLockBox.lockedBlock + gameSettings.blockJumps()) + 1 != _causalityParams.blockNumber[0])
            revert WrongState(2);

        // blocks not passed yet
        if ((lockedLockBox.lockedBlock + gameSettings.blockJumps()) >= block.number) revert WrongState(3);

        ARTIFACT_TYPE[] memory artifacts = new ARTIFACT_TYPE[](lockedLockBox.amount);
        lockedLockBox.claimedBlock = block.number;
        claimedLockBoxes[msg.sender].push(lockedLockBox);

        for (uint i; i < lockedLockBox.amount; i++) {
            uint256 result = causality.getRandom(
                msg.sender,
                _causalityParams.blockNumber[0],
                _causalityParams.hash1[0],
                _causalityParams.hash2[0],
                _causalityParams.timestamp[0],
                _causalityParams.signature[0],
                string(abi.encodePacked("LOCK_BOX_", i)),
                0,
                gameSettings.maxRollCapLockBoxes()
            );
            artifacts[i] = interpretResult(result);

            // we burn the lock box
            lockedBox.burn(address(this), 0, 1);
        }

        delete lockedLockBoxes[msg.sender];

        for (uint i; i < lockedLockBox.amount; i++) {
            ARTIFACT_TYPE rewardType = artifacts[i];
            if (rewardType == ARTIFACT_TYPE.NONE) continue;
            artifact.mint(msg.sender, uint256(rewardType), 1);
            emit OpenedLockBox(msg.sender, rewardType);
        }
    }

    /**
     * @notice determines what type of artifact to give as reward
     * @param _result of randomness
     */
    function interpretResult(uint256 _result) internal view returns (ARTIFACT_TYPE) {
        unchecked {
            for (uint256 i = 1; i <= 12; i++) {
                uint16[2] memory limits = gameSettings.getLockBoxesDistribution(ARTIFACT_TYPE(i));
                if (_result >= limits[0] && _result <= limits[1]) return ARTIFACT_TYPE(i);
            }
            return ARTIFACT_TYPE.NONE;
        }
    }

    function getLockedRewards(address _owner) external view returns (LockedChest memory) {
        return lockedChests[_owner];
    }

    function getLockedLockBoxes(address _owner) external view returns (LockedLockBox memory) {
        return lockedLockBoxes[_owner];
    }

    function getClaimedChests(address _owner, uint8 _type) external view returns (LockedChest[] memory) {
        return claimedChests[_owner][_type];
    }

    function getClaimedLockBoxes(address _owner) external view returns (LockedLockBox[] memory) {
        return claimedLockBoxes[_owner];
    }

    /**
     * SETTERS & GETTERS
     */

    function setContract(address _contract, uint8 _target) external onlyOwner {
        if (_contract == address(0)) revert AddressZero();
        if (_target == 1) causality = DPSRandomI(_contract);
        else if (_target == 2) artifact = MintableBurnableIERC1155(_contract);
        else if (_target == 3) gameSettings = DPSGameSettingsI(_contract);
        else if (_target == 4) chest = DPSChestsI(_contract);
        else if (_target == 5) doubloons = IERC20MintableBurnable(_contract);
        else if (_target == 6) lockedBox = MintableBurnableIERC1155(_contract);
        emit SetContract(_target, _contract);
    }

    function setTreasury(address _treasury) external onlyOwner {
        if (_treasury == address(0)) revert AddressZero();
        treasury = _treasury;
        emit ChangedTreasury(_treasury);
    }

    function onERC1155Received(
        address _operator,
        address,
        uint256,
        uint256,
        bytes calldata
    ) public view override returns (bytes4) {
        if (_operator != address(this)) revert Unauthorized();
        return this.onERC1155Received.selector;
    }

    /**
     * @notice Recover NFT sent by mistake to the contract
     * @param _nft the NFT address
     * @param _destination where to send the NFT
     * @param _tokenId the token to want to recover
     */
    function recoverNFT(
        address _nft,
        address _destination,
        uint256 _tokenId
    ) external onlyOwner {
        if (_destination == address(0)) revert AddressZero();

        IERC721(_nft).safeTransferFrom(address(this), _destination, _tokenId);
        emit TokenRecovered(_nft, _destination, _tokenId);
    }

    /**
     * @notice Recover NFT sent by mistake to the contract
     * @param _nft the 1155 NFT address
     * @param _destination where to send the NFT
     * @param _tokenId the token to want to recover
     * @param _amount amount of this token to want to recover
     */
    function recover1155NFT(
        address _nft,
        address _destination,
        uint256 _tokenId,
        uint256 _amount
    ) external onlyOwner {
        if (_destination == address(0)) revert AddressZero();

        IERC1155(_nft).safeTransferFrom(address(this), _destination, _tokenId, _amount, "");
        emit TokenRecovered(_nft, _destination, _tokenId);
    }

    /**
     * @notice Recover TOKENS sent by mistake to the contract
     * @param _token the TOKEN address
     * @param _destination where to send the NFT
     */
    function recoverERC20(address _token, address _destination) external onlyOwner {
        if (_destination == address(0)) revert AddressZero();

        uint256 amount = IERC20(_token).balanceOf(address(this));
        IERC20(_token).safeTransfer(_destination, amount);
        emit TokenRecovered(_token, _destination, amount);
    }
}

File 2 of 20 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 3 of 20 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 4 of 20 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }
}

File 5 of 20 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 6 of 20 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * @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 7 of 20 : IERC20MintableBurnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

/**
 * @dev Interface of the ERC20 expanded to include mint and burn functionality
 * @dev
 */
interface IERC20MintableBurnable is IERC20Mintable, IERC20 {
    /**
     * @dev burns `amount` from `receiver`
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits an {BURN} event.
     */
    function burn(address _from, uint256 _amount) external;
}

File 8 of 20 : DPSInterfaces.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "./DPSStructs.sol";

interface DPSVoyageI is IERC721Enumerable {
    function mint(
        address _owner,
        uint256 _tokenId,
        VoyageConfig calldata config
    ) external;

    function burn(uint256 _tokenId) external;

    function getVoyageConfig(uint256 _voyageId) external view returns (VoyageConfig memory config);

    function tokensOfOwner(address _owner) external view returns (uint256[] memory);

    function exists(uint256 _tokenId) external view returns (bool);

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

interface DPSRandomI {
    function getRandomBatch(
        address _address,
        uint256[] memory _blockNumber,
        bytes32[] memory _hash1,
        bytes32[] memory _hash2,
        uint256[] memory _timestamp,
        bytes[] calldata _signature,
        string[] calldata _entropy,
        uint256 _min,
        uint256 _max
    ) external view returns (uint256[] memory randoms);

    function getRandomUnverifiedBatch(
        address _address,
        uint256[] memory _blockNumber,
        bytes32[] memory _hash1,
        bytes32[] memory _hash2,
        uint256[] memory _timestamp,
        string[] calldata _entropy,
        uint256 _min,
        uint256 _max
    ) external pure returns (uint256[] memory randoms);

    function getRandom(
        address _address,
        uint256 _blockNumber,
        bytes32 _hash1,
        bytes32 _hash2,
        uint256 _timestamp,
        bytes calldata _signature,
        string calldata _entropy,
        uint256 _min,
        uint256 _max
    ) external view returns (uint256 randoms);

    function getRandomUnverified(
        address _address,
        uint256 _blockNumber,
        bytes32 _hash1,
        bytes32 _hash2,
        uint256 _timestamp,
        string calldata _entropy,
        uint256 _min,
        uint256 _max
    ) external pure returns (uint256 randoms);

    function checkCausalityParams(
        CausalityParams calldata _causalityParams,
        VoyageConfig calldata _voyageConfig,
        LockedVoyage calldata _lockedVoyage
    ) external pure;
}

interface DPSGameSettingsI {
    function getVoyageConfig(VOYAGE_TYPE _type) external view returns (CartographerConfig memory);

    function maxSkillsCap() external view returns (uint16);

    function maxRollCap() external view returns (uint16);

    function flagshipBaseSkills() external view returns (uint16);

    function maxOpenLockBoxes() external view returns (uint256);

    function blockJumps() external view returns (uint16);

    function getSkillsPerFlagshipParts() external view returns (uint16[7] memory skills);

    function getSkillTypeOfEachFlagshipPart() external view returns (uint8[7] memory skillTypes);

    function getTMAPPerVoyageType(VOYAGE_TYPE _type) external view returns (uint256);

    function gapBetweenVoyagesCreation() external view returns (uint256);

    function isPaused(uint8 _component) external view returns (uint8);

    function tmapPerDoubloon() external view returns (uint256);

    function repairFlagshipCost() external view returns (uint256);

    function doubloonPerUpgradePart() external view returns (uint256);

    function getChestDoubloonRewards(VOYAGE_TYPE _type) external view returns (uint256);

    function computeFlagShipSkills(uint8[7] calldata levels, VoyageStatusCache memory _claimingRewardsCache)
        external
        view
        returns (VoyageStatusCache memory);

    function computeSupportSkills(
        uint8[9] calldata _supportShips,
        ARTIFACT_TYPE _type,
        VoyageStatusCache memory _claimingRewardsCache
    ) external view returns (VoyageStatusCache memory);

    function getDoubloonsPerSupportShipType(SUPPORT_SHIP_TYPE _type) external view returns (uint256);

    function getSupportShipsSkillBoosts(SUPPORT_SHIP_TYPE _type) external view returns (uint16);

    function getMaxSupportShipsPerVoyageType(VOYAGE_TYPE _type) external view returns (uint8);

    function getMaxRollPerChest(VOYAGE_TYPE _type) external view returns (uint256);

    function maxRollCapLockBoxes() external view returns (uint16);

    function getLockBoxesDistribution(ARTIFACT_TYPE _type) external view returns (uint16[2] memory);

    function getVoyageDebuffs(VOYAGE_TYPE _type) external view returns (uint16);

    function debuffVoyage(VOYAGE_TYPE _voyageType, VoyageStatusCache memory _claimingRewardsCache)
        external
        view
        returns (VoyageStatusCache memory);

    function interpretResults(
        uint256 _result,
        VoyageResult memory _voyageResult,
        LockedVoyage calldata _lockedVoyage,
        VoyageStatusCache memory _claimingRewardsCache,
        INTERACTION _interaction,
        CausalityParams calldata _causalityParams,
        uint256 _index
    ) external view returns (VoyageResult memory, VoyageStatusCache memory);

    function getArtifactSkillBoosts(ARTIFACT_TYPE _type) external view returns (uint16);
}

interface DPSPirateFeaturesI {
    function getTraitsAndSkills(uint16 _dpsId) external view returns (string[8] memory, uint16[3] memory);
}

interface DPSSupportShipI is IERC1155 {
    function burn(
        address _from,
        uint256 _type,
        uint256 _amount
    ) external;

    function mint(
        address _owner,
        uint256 _type,
        uint256 _amount
    ) external;
}

interface DPSFlagshipI is IERC721 {
    function mint(address _owner, uint256 _id) external;

    function burn(uint256 _id) external;

    function upgradePart(
        FLAGSHIP_PART _trait,
        uint256 _tokenId,
        uint8 _level
    ) external;

    function getPartsLevel(uint256 _flagshipId) external view returns (uint8[7] memory);

    function tokensOfOwner(address _owner) external view returns (uint256[] memory);

    function exists(uint256 _tokenId) external view returns (bool);
}

interface DPSCartographerI {
    function viewVoyageConfiguration(CausalityParams calldata causalityParams, uint256 _voyageId)
        external
        view
        returns (VoyageConfig memory voyageConfig);

    function buyers(uint256 _voyageId) external view returns (address);
}

interface DPSChestsI is IERC1155 {
    function mint(
        address _to,
        VOYAGE_TYPE _voyageType,
        uint256 _amount
    ) external;

    function burn(
        address _from,
        VOYAGE_TYPE _voyageType,
        uint256 _amount
    ) external;
}

interface MintableBurnableIERC1155 is IERC1155 {
    function mint(
        address _to,
        uint256 _type,
        uint256 _amount
    ) external;

    function burn(
        address _from,
        uint256 _type,
        uint256 _amount
    ) external;
}

File 9 of 20 : DPSStructs.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

enum VOYAGE_TYPE {
    EASY,
    MEDIUM,
    HARD,
    LEGENDARY
}

enum SUPPORT_SHIP_TYPE {
    SLOOP_STRENGTH,
    SLOOP_LUCK,
    SLOOP_NAVIGATION,
    CARAVEL_STRENGTH,
    CARAVEL_LUCK,
    CARAVEL_NAVIGATION,
    GALLEON_STRENGTH,
    GALLEON_LUCK,
    GALLEON_NAVIGATION
}

enum ARTIFACT_TYPE {
    NONE,
    COMMON_STRENGTH,
    COMMON_LUCK,
    COMMON_NAVIGATION,
    RARE_STRENGTH,
    RARE_LUCK,
    RARE_NAVIGATION,
    EPIC_STRENGTH,
    EPIC_LUCK,
    EPIC_NAVIGATION,
    LEGENDARY_STRENGTH,
    LEGENDARY_LUCK,
    LEGENDARY_NAVIGATION
}

enum INTERACTION {
    NONE,
    CHEST,
    STORM,
    ENEMY
}

enum FLAGSHIP_PART {
    HEALTH,
    CANNON,
    HULL,
    SAILS,
    HELM,
    FLAG,
    FIGUREHEAD
}

enum SKILL_TYPE {
    LUCK,
    STRENGTH,
    NAVIGATION
}

struct VoyageConfig {
    VOYAGE_TYPE typeOfVoyage;
    uint8 noOfInteractions;
    uint16 noOfBlockJumps;
    // 1 - Chest 2 - Storm 3 - Enemy
    uint8[] sequence;
    uint256 boughtAt;
    uint256 gapBetweenInteractions;
}

struct CartographerConfig {
    uint8 minNoOfChests;
    uint8 maxNoOfChests;
    uint8 minNoOfStorms;
    uint8 maxNoOfStorms;
    uint8 minNoOfEnemies;
    uint8 maxNoOfEnemies;
    uint8 totalInteractions;
    uint256 gapBetweenInteractions;
}

struct RandomInteractions {
    uint256 randomNoOfChests;
    uint256 randomNoOfStorms;
    uint256 randomNoOfEnemies;
    uint8 generatedChests;
    uint8 generatedStorms;
    uint8 generatedEnemies;
    uint256[] positionsForGeneratingInteractions;
}

struct CausalityParams {
    uint256[] blockNumber;
    bytes32[] hash1;
    bytes32[] hash2;
    uint256[] timestamp;
    bytes[] signature;
}

struct LockedVoyage {
    uint8 totalSupportShips;
    VOYAGE_TYPE voyageType;
    ARTIFACT_TYPE artifactId;
    uint8[9] supportShips; //this should be an array for each type, expressing the quantities he took on a trip
    uint8[] sequence;
    uint16 navigation;
    uint16 luck;
    uint16 strength;
    uint256 voyageId;
    uint256 dpsId;
    uint256 flagshipId;
    uint256 lockedBlock;
    uint256 lockedTimestamp;
    uint256 claimedTime;
}

struct VoyageResult {
    uint16 awardedChests;
    uint8[9] destroyedSupportShips;
    uint8 totalSupportShipsDestroyed;
    uint8 healthDamage;
    uint16 skippedInteractions;
    uint16[] interactionRNGs;
    uint8[] interactionResults;
}

struct VoyageStatusCache {
    uint256 strength;
    uint256 luck;
    uint256 navigation;
    string entropy;
}

error AddressZero();
error Paused();
error WrongParams(uint256 _location);
error WrongState(uint256 _state);
error Unauthorized();
error NotEnoughTokens();

File 10 of 20 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 11 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 12 of 20 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 13 of 20 : ERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 14 of 20 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.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.
        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. 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 15 of 20 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 16 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (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 17 of 20 : IERC20Mintable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 expanded to include mint functionality
 * @dev
 */
interface IERC20Mintable {
    /**
     * @dev mints `amount` to `receiver`
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits an {Minted} event.
     */
    function mint(address receiver, uint256 amount) external;
}

File 18 of 20 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 19 of 20 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 20 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AddressZero","type":"error"},{"inputs":[],"name":"Paused","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[{"internalType":"uint256","name":"_location","type":"uint256"}],"name":"WrongParams","type":"error"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"WrongState","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newTreasury","type":"address"}],"name":"ChangedTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"enum VOYAGE_TYPE","name":"_type","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ClaimedChests","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_type","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"LockingChest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"LockingLockBox","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"enum ARTIFACT_TYPE","name":"_type","type":"uint8"}],"name":"OpenedLockBox","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":true,"internalType":"uint8","name":"_target","type":"uint8"},{"indexed":false,"internalType":"address","name":"_contract","type":"address"}],"name":"SetContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"address","name":"_destination","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TokenRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TreasuryUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"WonLockBocks","type":"event"},{"inputs":[],"name":"artifact","outputs":[{"internalType":"contract MintableBurnableIERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"causality","outputs":[{"internalType":"contract DPSRandomI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chest","outputs":[{"internalType":"contract DPSChestsI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256[]","name":"blockNumber","type":"uint256[]"},{"internalType":"bytes32[]","name":"hash1","type":"bytes32[]"},{"internalType":"bytes32[]","name":"hash2","type":"bytes32[]"},{"internalType":"uint256[]","name":"timestamp","type":"uint256[]"},{"internalType":"bytes[]","name":"signature","type":"bytes[]"}],"internalType":"struct CausalityParams","name":"_causalityParams","type":"tuple"}],"name":"claimLockedBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256[]","name":"blockNumber","type":"uint256[]"},{"internalType":"bytes32[]","name":"hash1","type":"bytes32[]"},{"internalType":"bytes32[]","name":"hash2","type":"bytes32[]"},{"internalType":"uint256[]","name":"timestamp","type":"uint256[]"},{"internalType":"bytes[]","name":"signature","type":"bytes[]"}],"internalType":"struct CausalityParams","name":"_causalityParams","type":"tuple"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"claimLockedRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimedChests","outputs":[{"internalType":"enum VOYAGE_TYPE","name":"chestType","type":"uint8"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedBlock","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimedLockBoxes","outputs":[{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedBlock","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"doubloons","outputs":[{"internalType":"contract IERC20MintableBurnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameSettings","outputs":[{"internalType":"contract DPSGameSettingsI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint8","name":"_type","type":"uint8"}],"name":"getClaimedChests","outputs":[{"components":[{"internalType":"enum VOYAGE_TYPE","name":"chestType","type":"uint8"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedBlock","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"internalType":"struct DPSPlunderersGuild.LockedChest[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getClaimedLockBoxes","outputs":[{"components":[{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedBlock","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"internalType":"struct DPSPlunderersGuild.LockedLockBox[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getLockedLockBoxes","outputs":[{"components":[{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedBlock","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"internalType":"struct DPSPlunderersGuild.LockedLockBox","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getLockedRewards","outputs":[{"components":[{"internalType":"enum VOYAGE_TYPE","name":"chestType","type":"uint8"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedBlock","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"internalType":"struct DPSPlunderersGuild.LockedChest","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"lockToClaimLockBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chestsType","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"lockToClaimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockedBox","outputs":[{"internalType":"contract MintableBurnableIERC1155","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":"_operator","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":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recover1155NFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_destination","type":"address"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"recoverNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"uint8","name":"_target","type":"uint8"}],"name":"setContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506200001d3362000027565b6001805562000077565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61350180620000876000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c8063886f039a116100f9578063cb441dea11610097578063f23a6e6111610071578063f23a6e611461044f578063f2fde38b14610462578063f851553a14610475578063ffd7593c1461048857600080fd5b8063cb441dea14610409578063effe9cbe14610429578063f0f442601461043c57600080fd5b8063aacc4bbe116100d3578063aacc4bbe14610379578063b7297cf314610399578063bc197c81146103ac578063c6d11e8f146103e457600080fd5b8063886f039a146103425780638da5cb5b146103555780639f33d8811461036657600080fd5b8063618ad7971161016657806364026ac01161014057806364026ac0146103015780636f6b866d14610314578063715018a61461032757806385ddd2091461032f57600080fd5b8063618ad797146102bb57806361d027b3146102db57806362c2fd6b146102ee57600080fd5b80631464e0de116101a25780631464e0de14610231578063269ffd3a1461024457806353c6fa061461026457806353e2edea1461027757600080fd5b806301ffc9a7146101c9578063032c1cc4146101f15780630d7f50351461021c575b600080fd5b6101dc6101d736600461294c565b61049b565b60405190151581526020015b60405180910390f35b600354610204906001600160a01b031681565b6040516001600160a01b0390911681526020016101e8565b61022f61022a366004612992565b6104d2565b005b600754610204906001600160a01b031681565b6102576102523660046129ce565b6105e0565b6040516101e891906129e9565b61022f610272366004612a80565b61068a565b61028a610285366004612ac5565b610ffb565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a0016101e8565b6102ce6102c9366004612afe565b611052565b6040516101e89190612ba6565b600854610204906001600160a01b031681565b600654610204906001600160a01b031681565b600254610204906001600160a01b031681565b61022f610322366004612be8565b611140565b61022f611241565b61022f61033d366004612c2a565b611277565b61022f610350366004612c43565b6114fe565b6000546001600160a01b0316610204565b61022f610374366004612afe565b611613565b61038c6103873660046129ce565b6117a6565b6040516101e89190612c76565b600454610204906001600160a01b031681565b6103cb6103ba366004612d70565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016101e8565b6103f76103f2366004612e70565b61183e565b6040516101e896959493929190612eaf565b61041c6104173660046129ce565b6118ac565b6040516101e89190612eee565b61022f610437366004612efc565b611980565b61022f61044a3660046129ce565b611c7c565b6103cb61045d366004612f1e565b611d21565b61022f6104703660046129ce565b611d5e565b61022f610483366004612fc4565b611df9565b600554610204906001600160a01b031681565b60006001600160e01b03198216630271189760e51b14806104cc57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000546001600160a01b031633146105055760405162461bcd60e51b81526004016104fc90612ff9565b60405180910390fd5b6001600160a01b03821661052c57604051639fabe1c160e01b815260040160405180910390fd5b604051632142170760e11b81523060048201526001600160a01b038381166024830152604482018390528416906342842e0e90606401600060405180830381600087803b15801561057c57600080fd5b505af1158015610590573d6000803e3d6000fd5b5050604080516001600160a01b03868116825260208201869052871693507f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f90969250015b60405180910390a2505050565b6001600160a01b0381166000908152600c60209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561067f5760008481526020908190206040805160a08101825260058602909201805483526001808201548486015260028201549284019290925260038101546060840152600401546001600160a01b031660808301529083529092019101610618565b505050509050919050565b6002600154036106ac5760405162461bcd60e51b81526004016104fc9061302e565b60026001556004805460405163bc61e73360e01b81526008928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa1580156106fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071f9190613065565b60ff16600103610742576040516313d0ff5960e31b815260040160405180910390fd5b33600090815260096020526040808220815160c081019092528054829060ff16600381111561077357610773612b35565b600381111561078457610784612b35565b815260018201546020820152600282015460408201526003820154606082015260048201546080808301919091526005909201546001600160a01b031660a0909101528101519091506000036107f057604051632473a0d360e11b8152600160048201526024016104fc565b805160048054604051637a9749a360e01b815260009283926001600160a01b031691637a9749a39161082491879101613082565b602060405180830381865afa158015610841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108659190613090565b90506000846080015186111561087d57846080015195505b61088787806130a9565b6000818110610898576108986130fa565b90506020020135600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109169190613122565b61ffff1686602001516109299190613153565b610934906001613153565b14610955576040516328d7be8d60e11b8152600260048201526024016104fc565b43600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cd9190613122565b61ffff1686602001516109e09190613153565b10610a01576040516328d7be8d60e11b8152600360048201526024016104fc565b60005b86811015610ce3576005546000906001600160a01b0316636917123333610a2b8c806130a9565b6000818110610a3c57610a3c6130fa565b905060200201358c8060200190610a5391906130a9565b6000818110610a6457610a646130fa565b905060200201358d8060400190610a7b91906130a9565b6000818110610a8c57610a8c6130fa565b905060200201358e8060600190610aa391906130a9565b6000818110610ab457610ab46130fa565b905060200201358f8060800190610acb91906130a9565b6000818110610adc57610adc6130fa565b9050602002810190610aee919061316b565b6040516c524557415244535f545950455f60981b6020820152602d81018c9052604d0160405160208183030381529060405260006127106040518b63ffffffff1660e01b8152600401610b4a9a99989796959493929190613237565b602060405180830381865afa158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613090565b9050838111610ba25782610b9e816132a1565b9350505b436060880152336000908152600a6020526040812090876003811115610bca57610bca612b35565b60ff168152602080820192909252604001600090812080546001818101835591835292909120895160069093020180548a939192839160ff191690836003811115610c1757610c17612b35565b0217905550602082015160018281019190915560408084015160028085019190915560608501516003850155608085015160048086019190915560a090950151600590940180546001600160a01b0319166001600160a01b03958616179055548b51915163a29b3f5b60e01b815293169363a29b3f5b93610c9d933093929091016132ba565b600060405180830381600087803b158015610cb757600080fd5b505af1158015610ccb573d6000803e3d6000fd5b50505050508080610cdb906132a1565b915050610a04565b5060808501516004805460405163666fa66f60e11b81526001600160a01b039091169163ccdf4cde91610d1891899101613082565b602060405180830381865afa158015610d35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d599190613090565b610d6391906132e5565b92508215610e8f576007546040516340c10f1960e01b8152336004820152602481018590526001600160a01b03909116906340c10f1990604401600060405180830381600087803b158015610db757600080fd5b505af1158015610dcb573d6000803e3d6000fd5b5050505060006064846005610de091906132e5565b610dea9190613304565b6007546008546040516340c10f1960e01b81526001600160a01b0391821660048201526024810184905292935016906340c10f1990604401600060405180830381600087803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b505050507f715f224bde15d12b6a2a3fc1a65c87cae96f02f715a0d38cc3409776a462c54781604051610e8591815260200190565b60405180910390a1505b84608001518610610ee457336000908152600960205260408120805460ff19168155600181018290556002810182905560038101829055600481019190915560050180546001600160a01b0319169055610f08565b858560800151610ef49190613326565b336000908152600960205260409020600401555b8015610f7a57600354604051630ab714fb60e11b815233600482015260006024820152604481018390526001600160a01b039091169063156e29f690606401600060405180830381600087803b158015610f6157600080fd5b505af1158015610f75573d6000803e3d6000fd5b505050505b8451608086015160405133927fa8d0249bd1e379e1eecebbbd2758ce562c20d3014ae36b779bd9432362340de692610fb19261333d565b60405180910390a260405181815233907f1b2d624122656c0cbbf3659d7b3dcaf0baea306d057563681987029962c869e59060200160405180910390a25050600180555050505050565b600c602052816000526040600020818154811061101757600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492955090935091906001600160a01b031685565b6001600160a01b0382166000908152600a6020908152604080832060ff851684528252808320805482518185028101850190935280835260609492939192909184015b82821015611134576000848152602090206040805160c08101909152600684029091018054829060ff1660038111156110d0576110d0612b35565b60038111156110e1576110e1612b35565b81526001828101546020808401919091526002840154604084015260038401546060840152600484015460808401526005909301546001600160a01b031660a09092019190915291835292019101611095565b50505050905092915050565b6000546001600160a01b0316331461116a5760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b03831661119157604051639fabe1c160e01b815260040160405180910390fd5b604051637921219560e11b81526001600160a01b0385169063f242432a906111c3903090879087908790600401613358565b600060405180830381600087803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b5050604080516001600160a01b03878116825260208201879052881693507f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f909692500160405180910390a250505050565b6000546001600160a01b0316331461126b5760405162461bcd60e51b81526004016104fc90612ff9565b6112756000612579565b565b6002600154036112995760405162461bcd60e51b81526004016104fc9061302e565b60026001556004805460405163bc61e73360e01b81526007928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa1580156112e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130c9190613065565b60ff1660010361132f576040516313d0ff5960e31b815260040160405180910390fd5b336000908152600b60205260409020600301541561136357604051632473a0d360e11b8152600160048201526024016104fc565b60048054604080516349311dbf60e01b815290516001600160a01b03909216926349311dbf9282820192602092908290030181865afa1580156113aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ce9190613090565b8111156113f157604051632473a0d360e11b8152600260048201526024016104fc565b6040805160a0810182524381524260208083019182526000838501818152606085018781523360808701818152818552600b909552878420965187559451600187015590516002860155516003808601919091559151600494850180546001600160a01b0319166001600160a01b0392831617905591549451637921219560e11b8152949091169363f242432a93611490939230929091889101613358565b600060405180830381600087803b1580156114aa57600080fd5b505af11580156114be573d6000803e3d6000fd5b50506040518381523392507f706ce89f7788c1a9d6bba121b3b681d4702c20e9ff6de6b3ea7364a88e233317915060200160405180910390a25060018055565b6000546001600160a01b031633146115285760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b03811661154f57604051639fabe1c160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015611596573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ba9190613090565b90506115d06001600160a01b03841683836125c9565b604080516001600160a01b038481168252602082018490528516917f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f909691016105d3565b6000546001600160a01b0316331461163d5760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b03821661166457604051639fabe1c160e01b815260040160405180910390fd5b8060ff1660010361168f57600580546001600160a01b0319166001600160a01b038416179055611762565b8060ff166002036116ba57600680546001600160a01b0319166001600160a01b038416179055611762565b8060ff166003036116e557600480546001600160a01b0319166001600160a01b038416179055611762565b8060ff1660040361171057600280546001600160a01b0319166001600160a01b038416179055611762565b8060ff1660050361173b57600780546001600160a01b0319166001600160a01b038416179055611762565b8060ff1660060361176257600380546001600160a01b0319166001600160a01b0384161790555b6040516001600160a01b038316815260ff8216907e0961cd4320f350803f764de4992b70c8fc5c948b5881a151f883df0af333579060200160405180910390a25050565b6117e16040518060a001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b506001600160a01b039081166000908152600b6020908152604091829020825160a0810184528154815260018201549281019290925260028101549282019290925260038201546060820152600490910154909116608082015290565b600a602052826000526040600020602052816000526040600020818154811061186657600080fd5b600091825260209091206006909102018054600182015460028301546003840154600485015460059095015460ff9094169750919550935091906001600160a01b031686565b6118ef6040805160c0810190915280600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b6001600160a01b03821660009081526009602052604090819020815160c081019092528054829060ff16600381111561192a5761192a612b35565b600381111561193b5761193b612b35565b8152600182015460208201526002820154604082015260038201546060820152600482015460808201526005909101546001600160a01b031660a09091015292915050565b6002600154036119a25760405162461bcd60e51b81526004016104fc9061302e565b60026001556004805460405163bc61e73360e01b81526006928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa1580156119f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a159190613065565b60ff16600103611a38576040516313d0ff5960e31b815260040160405180910390fd5b3360009081526009602052604090206004015415611a6c576040516328d7be8d60e11b8152600160048201526024016104fc565b600254604051627eeac760e11b81523360048201526024810184905282916001600160a01b03169062fdd58e90604401602060405180830381865afa158015611ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611add9190613090565b1015611aff57604051632473a0d360e11b8152600160048201526024016104fc565b6040518060c00160405280836003811115611b1c57611b1c612b35565b6003811115611b2d57611b2d612b35565b81524360208083019190915242604080840191909152600060608401819052608084018690523360a09094018490529283526009909152902081518154829060ff19166001836003811115611b8457611b84612b35565b02179055506020820151600182015560408083015160028084019190915560608401516003840155608084015160048085019190915560a090940151600590930180546001600160a01b0319166001600160a01b03948516179055549051637921219560e11b815291169163f242432a91611c0791339130918891889101613358565b600060405180830381600087803b158015611c2157600080fd5b505af1158015611c35573d6000803e3d6000fd5b505060408051858152602081018590523393507f2d518bd3665f6fb933a8160586d0c68ec3488d7ca4f583809d07c977f97920e692500160405180910390a2505060018055565b6000546001600160a01b03163314611ca65760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b038116611ccd57604051639fabe1c160e01b815260040160405180910390fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f63cc689e9d3377465b51fb094ea4ca5e0a1436b21f1ad30d707c696111c665009060200160405180910390a150565b60006001600160a01b0387163014611d4b576040516282b42960e81b815260040160405180910390fd5b5063f23a6e6160e01b9695505050505050565b6000546001600160a01b03163314611d885760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b038116611ded5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fc565b611df681612579565b50565b600260015403611e1b5760405162461bcd60e51b81526004016104fc9061302e565b60026001556004805460405163bc61e73360e01b81526009928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa158015611e6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e8e9190613065565b60ff16600103611eb1576040516313d0ff5960e31b815260040160405180910390fd5b336000908152600b6020908152604091829020825160a08101845281548152600182015492810192909252600281015492820192909252600382015460608201526004909101546001600160a01b03166080820152611f1082806130a9565b6000818110611f2157611f216130fa565b90506020020135600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9f9190613122565b8251611faf9161ffff1690613153565b611fba906001613153565b14611fdb576040516328d7be8d60e11b8152600260048201526024016104fc565b43600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa15801561202f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120539190613122565b82516120639161ffff1690613153565b10612084576040516328d7be8d60e11b8152600360048201526024016104fc565b6000816060015167ffffffffffffffff8111156120a3576120a3612cb4565b6040519080825280602002602001820160405280156120cc578160200160208202803683370190505b50436040848101918252336000908152600c60209081529181208054600180820183559183528383208851600590920201908155928701519083015591516002820155606085015160038201556080850151600490910180546001600160a01b0319166001600160a01b039092169190911790559091505b82606001518110156123fd576005546000906001600160a01b031663691712333361216f88806130a9565b6000818110612180576121806130fa565b9050602002013588806020019061219791906130a9565b60008181106121a8576121a86130fa565b905060200201358980604001906121bf91906130a9565b60008181106121d0576121d06130fa565b905060200201358a80606001906121e791906130a9565b60008181106121f8576121f86130fa565b905060200201358b806080019061220f91906130a9565b6000818110612220576122206130fa565b9050602002810190612232919061316b565b604051684c4f434b5f424f585f60b81b6020820152602981018c905260490160408051601f19818403018152828252600480546309c9dcb160e01b8552925191936000936001600160a01b0316926309c9dcb1928083019260209291908290030181865afa1580156122a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122cc9190613122565b6040518b63ffffffff1660e01b81526004016122f19a99989796959493929190613390565b602060405180830381865afa15801561230e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123329190613090565b905061233d81612620565b83838151811061234f5761234f6130fa565b6020026020010190600c81111561236857612368612b35565b9081600c81111561237b5761237b612b35565b905250600354604051637a94c56560e11b815230600482015260006024820152600160448201526001600160a01b039091169063f5298aca90606401600060405180830381600087803b1580156123d157600080fd5b505af11580156123e5573d6000803e3d6000fd5b505050505080806123f5906132a1565b915050612144565b50336000908152600b6020526040812081815560018101829055600281018290556003810182905560040180546001600160a01b03191690555b826060015181101561256f576000828281518110612457576124576130fa565b602002602001015190506000600c81111561247457612474612b35565b81600c81111561248657612486612b35565b03612491575061255d565b6006546001600160a01b031663156e29f63383600c8111156124b5576124b5612b35565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b15801561250257600080fd5b505af1158015612516573d6000803e3d6000fd5b50505050336001600160a01b03167f363c1ce153bd4ee16fa06d5456b2b65bfbe89a83c25a18c0c8e435b403f4f4fe826040516125539190613402565b60405180910390a2505b80612567816132a1565b915050612437565b5050600180555050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261261b908490612700565b505050565b600060015b600c81116126f7576004546000906001600160a01b0316632e06b2c183600c81111561265357612653612b35565b6040518263ffffffff1660e01b815260040161266f9190613402565b6040805180830381865afa15801561268b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126af919061341c565b805190915061ffff1684108015906126cf5750602081015161ffff168411155b156126ee5781600c8111156126e6576126e6612b35565b949350505050565b50600101612625565b50600092915050565b6000612755826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127d29092919063ffffffff16565b80519091501561261b578080602001905181019061277391906134a3565b61261b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104fc565b60606127e184846000856127eb565b90505b9392505050565b60608247101561284c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104fc565b843b61289a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104fc565b600080866001600160a01b031685876040516128b691906134c5565b60006040518083038185875af1925050503d80600081146128f3576040519150601f19603f3d011682016040523d82523d6000602084013e6128f8565b606091505b5091509150612908828286612913565b979650505050505050565b606083156129225750816127e4565b8251156129325782518084602001fd5b8160405162461bcd60e51b81526004016104fc91906134e1565b60006020828403121561295e57600080fd5b81356001600160e01b0319811681146127e457600080fd5b80356001600160a01b038116811461298d57600080fd5b919050565b6000806000606084860312156129a757600080fd5b6129b084612976565b92506129be60208501612976565b9150604084013590509250925092565b6000602082840312156129e057600080fd5b6127e482612976565b6020808252825182820181905260009190848201906040850190845b81811015612a5c57612a49838551805182526020808201519083015260408082015190830152606080820151908301526080908101516001600160a01b0316910152565b9284019260a09290920191600101612a05565b50909695505050505050565b600060a08284031215612a7a57600080fd5b50919050565b60008060408385031215612a9357600080fd5b823567ffffffffffffffff811115612aaa57600080fd5b612ab685828601612a68565b95602094909401359450505050565b60008060408385031215612ad857600080fd5b612ae183612976565b946020939093013593505050565b60ff81168114611df657600080fd5b60008060408385031215612b1157600080fd5b612b1a83612976565b91506020830135612b2a81612aef565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b60048110612b5b57612b5b612b35565b9052565b612b6a828251612b4b565b6020818101519083015260408082015190830152606080820151908301526080808201519083015260a0908101516001600160a01b0316910152565b6020808252825182820181905260009190848201906040850190845b81811015612a5c57612bd5838551612b5f565b9284019260c09290920191600101612bc2565b60008060008060808587031215612bfe57600080fd5b612c0785612976565b9350612c1560208601612976565b93969395505050506040820135916060013590565b600060208284031215612c3c57600080fd5b5035919050565b60008060408385031215612c5657600080fd5b612c5f83612976565b9150612c6d60208401612976565b90509250929050565b815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a081016104cc565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612cf357612cf3612cb4565b604052919050565b600082601f830112612d0c57600080fd5b8135602067ffffffffffffffff821115612d2857612d28612cb4565b8160051b612d37828201612cca565b9283528481018201928281019087851115612d5157600080fd5b83870192505b8483101561290857823582529183019190830190612d57565b600080600080600060a08688031215612d8857600080fd5b612d9186612976565b94506020612da0818801612976565b9450604087013567ffffffffffffffff80821115612dbd57600080fd5b612dc98a838b01612cfb565b95506060890135915080821115612ddf57600080fd5b612deb8a838b01612cfb565b94506080890135915080821115612e0157600080fd5b818901915089601f830112612e1557600080fd5b813581811115612e2757612e27612cb4565b612e39601f8201601f19168501612cca565b91508082528a84828501011115612e4f57600080fd5b80848401858401376000848284010152508093505050509295509295909350565b600080600060608486031215612e8557600080fd5b612e8e84612976565b92506020840135612e9e81612aef565b929592945050506040919091013590565b60c08101612ebd8289612b4b565b60208201969096526040810194909452606084019290925260808301526001600160a01b031660a090910152919050565b60c081016104cc8284612b5f565b60008060408385031215612f0f57600080fd5b50508035926020909101359150565b60008060008060008060a08789031215612f3757600080fd5b612f4087612976565b9550612f4e60208801612976565b94506040870135935060608701359250608087013567ffffffffffffffff80821115612f7957600080fd5b818901915089601f830112612f8d57600080fd5b813581811115612f9c57600080fd5b8a6020828501011115612fae57600080fd5b6020830194508093505050509295509295509295565b600060208284031215612fd657600080fd5b813567ffffffffffffffff811115612fed57600080fd5b6126e684828501612a68565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006020828403121561307757600080fd5b81516127e481612aef565b602081016104cc8284612b4b565b6000602082840312156130a257600080fd5b5051919050565b6000808335601e198436030181126130c057600080fd5b83018035915067ffffffffffffffff8211156130db57600080fd5b6020019150600581901b36038213156130f357600080fd5b9250929050565b634e487b7160e01b600052603260045260246000fd5b805161ffff8116811461298d57600080fd5b60006020828403121561313457600080fd5b6127e482613110565b634e487b7160e01b600052601160045260246000fd5b600082198211156131665761316661313d565b500190565b6000808335601e1984360301811261318257600080fd5b83018035915067ffffffffffffffff82111561319d57600080fd5b6020019150368190038213156130f357600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60005b838110156131f65781810151838201526020016131de565b83811115613205576000848401525b50505050565b600081518084526132238160208601602086016131db565b601f01601f19169290920160200192915050565b600061012060018060a01b038d1683528b60208401528a60408401528960608401528860808401528060a0840152613272818401888a6131b2565b905082810360c0840152613286818761320b565b60e08401959095525050610100015298975050505050505050565b6000600182016132b3576132b361313d565b5060010190565b6001600160a01b0384168152606081016132d76020830185612b4b565b826040830152949350505050565b60008160001904831182151516156132ff576132ff61313d565b500290565b60008261332157634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156133385761333861313d565b500390565b6040810161334b8285612b4b565b8260208301529392505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b600061012060018060a01b038d1683528b60208401528a60408401528960608401528860808401528060a08401526133cb818401888a6131b2565b905082810360c08401526133df818761320b565b9150508360e083015261ffff83166101008301529b9a5050505050505050505050565b60208101600d831061341657613416612b35565b91905290565b60006040828403121561342e57600080fd5b82601f83011261343d57600080fd5b6040516040810181811067ffffffffffffffff8211171561346057613460612cb4565b806040525080604084018581111561347757600080fd5b845b818110156134985761348a81613110565b835260209283019201613479565b509195945050505050565b6000602082840312156134b557600080fd5b815180151581146127e457600080fd5b600082516134d78184602087016131db565b9190910192915050565b6020815260006127e4602083018461320b56fea164736f6c634300080d000a

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c45760003560e01c8063886f039a116100f9578063cb441dea11610097578063f23a6e6111610071578063f23a6e611461044f578063f2fde38b14610462578063f851553a14610475578063ffd7593c1461048857600080fd5b8063cb441dea14610409578063effe9cbe14610429578063f0f442601461043c57600080fd5b8063aacc4bbe116100d3578063aacc4bbe14610379578063b7297cf314610399578063bc197c81146103ac578063c6d11e8f146103e457600080fd5b8063886f039a146103425780638da5cb5b146103555780639f33d8811461036657600080fd5b8063618ad7971161016657806364026ac01161014057806364026ac0146103015780636f6b866d14610314578063715018a61461032757806385ddd2091461032f57600080fd5b8063618ad797146102bb57806361d027b3146102db57806362c2fd6b146102ee57600080fd5b80631464e0de116101a25780631464e0de14610231578063269ffd3a1461024457806353c6fa061461026457806353e2edea1461027757600080fd5b806301ffc9a7146101c9578063032c1cc4146101f15780630d7f50351461021c575b600080fd5b6101dc6101d736600461294c565b61049b565b60405190151581526020015b60405180910390f35b600354610204906001600160a01b031681565b6040516001600160a01b0390911681526020016101e8565b61022f61022a366004612992565b6104d2565b005b600754610204906001600160a01b031681565b6102576102523660046129ce565b6105e0565b6040516101e891906129e9565b61022f610272366004612a80565b61068a565b61028a610285366004612ac5565b610ffb565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a0016101e8565b6102ce6102c9366004612afe565b611052565b6040516101e89190612ba6565b600854610204906001600160a01b031681565b600654610204906001600160a01b031681565b600254610204906001600160a01b031681565b61022f610322366004612be8565b611140565b61022f611241565b61022f61033d366004612c2a565b611277565b61022f610350366004612c43565b6114fe565b6000546001600160a01b0316610204565b61022f610374366004612afe565b611613565b61038c6103873660046129ce565b6117a6565b6040516101e89190612c76565b600454610204906001600160a01b031681565b6103cb6103ba366004612d70565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016101e8565b6103f76103f2366004612e70565b61183e565b6040516101e896959493929190612eaf565b61041c6104173660046129ce565b6118ac565b6040516101e89190612eee565b61022f610437366004612efc565b611980565b61022f61044a3660046129ce565b611c7c565b6103cb61045d366004612f1e565b611d21565b61022f6104703660046129ce565b611d5e565b61022f610483366004612fc4565b611df9565b600554610204906001600160a01b031681565b60006001600160e01b03198216630271189760e51b14806104cc57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000546001600160a01b031633146105055760405162461bcd60e51b81526004016104fc90612ff9565b60405180910390fd5b6001600160a01b03821661052c57604051639fabe1c160e01b815260040160405180910390fd5b604051632142170760e11b81523060048201526001600160a01b038381166024830152604482018390528416906342842e0e90606401600060405180830381600087803b15801561057c57600080fd5b505af1158015610590573d6000803e3d6000fd5b5050604080516001600160a01b03868116825260208201869052871693507f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f90969250015b60405180910390a2505050565b6001600160a01b0381166000908152600c60209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561067f5760008481526020908190206040805160a08101825260058602909201805483526001808201548486015260028201549284019290925260038101546060840152600401546001600160a01b031660808301529083529092019101610618565b505050509050919050565b6002600154036106ac5760405162461bcd60e51b81526004016104fc9061302e565b60026001556004805460405163bc61e73360e01b81526008928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa1580156106fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071f9190613065565b60ff16600103610742576040516313d0ff5960e31b815260040160405180910390fd5b33600090815260096020526040808220815160c081019092528054829060ff16600381111561077357610773612b35565b600381111561078457610784612b35565b815260018201546020820152600282015460408201526003820154606082015260048201546080808301919091526005909201546001600160a01b031660a0909101528101519091506000036107f057604051632473a0d360e11b8152600160048201526024016104fc565b805160048054604051637a9749a360e01b815260009283926001600160a01b031691637a9749a39161082491879101613082565b602060405180830381865afa158015610841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108659190613090565b90506000846080015186111561087d57846080015195505b61088787806130a9565b6000818110610898576108986130fa565b90506020020135600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109169190613122565b61ffff1686602001516109299190613153565b610934906001613153565b14610955576040516328d7be8d60e11b8152600260048201526024016104fc565b43600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cd9190613122565b61ffff1686602001516109e09190613153565b10610a01576040516328d7be8d60e11b8152600360048201526024016104fc565b60005b86811015610ce3576005546000906001600160a01b0316636917123333610a2b8c806130a9565b6000818110610a3c57610a3c6130fa565b905060200201358c8060200190610a5391906130a9565b6000818110610a6457610a646130fa565b905060200201358d8060400190610a7b91906130a9565b6000818110610a8c57610a8c6130fa565b905060200201358e8060600190610aa391906130a9565b6000818110610ab457610ab46130fa565b905060200201358f8060800190610acb91906130a9565b6000818110610adc57610adc6130fa565b9050602002810190610aee919061316b565b6040516c524557415244535f545950455f60981b6020820152602d81018c9052604d0160405160208183030381529060405260006127106040518b63ffffffff1660e01b8152600401610b4a9a99989796959493929190613237565b602060405180830381865afa158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613090565b9050838111610ba25782610b9e816132a1565b9350505b436060880152336000908152600a6020526040812090876003811115610bca57610bca612b35565b60ff168152602080820192909252604001600090812080546001818101835591835292909120895160069093020180548a939192839160ff191690836003811115610c1757610c17612b35565b0217905550602082015160018281019190915560408084015160028085019190915560608501516003850155608085015160048086019190915560a090950151600590940180546001600160a01b0319166001600160a01b03958616179055548b51915163a29b3f5b60e01b815293169363a29b3f5b93610c9d933093929091016132ba565b600060405180830381600087803b158015610cb757600080fd5b505af1158015610ccb573d6000803e3d6000fd5b50505050508080610cdb906132a1565b915050610a04565b5060808501516004805460405163666fa66f60e11b81526001600160a01b039091169163ccdf4cde91610d1891899101613082565b602060405180830381865afa158015610d35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d599190613090565b610d6391906132e5565b92508215610e8f576007546040516340c10f1960e01b8152336004820152602481018590526001600160a01b03909116906340c10f1990604401600060405180830381600087803b158015610db757600080fd5b505af1158015610dcb573d6000803e3d6000fd5b5050505060006064846005610de091906132e5565b610dea9190613304565b6007546008546040516340c10f1960e01b81526001600160a01b0391821660048201526024810184905292935016906340c10f1990604401600060405180830381600087803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b505050507f715f224bde15d12b6a2a3fc1a65c87cae96f02f715a0d38cc3409776a462c54781604051610e8591815260200190565b60405180910390a1505b84608001518610610ee457336000908152600960205260408120805460ff19168155600181018290556002810182905560038101829055600481019190915560050180546001600160a01b0319169055610f08565b858560800151610ef49190613326565b336000908152600960205260409020600401555b8015610f7a57600354604051630ab714fb60e11b815233600482015260006024820152604481018390526001600160a01b039091169063156e29f690606401600060405180830381600087803b158015610f6157600080fd5b505af1158015610f75573d6000803e3d6000fd5b505050505b8451608086015160405133927fa8d0249bd1e379e1eecebbbd2758ce562c20d3014ae36b779bd9432362340de692610fb19261333d565b60405180910390a260405181815233907f1b2d624122656c0cbbf3659d7b3dcaf0baea306d057563681987029962c869e59060200160405180910390a25050600180555050505050565b600c602052816000526040600020818154811061101757600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492955090935091906001600160a01b031685565b6001600160a01b0382166000908152600a6020908152604080832060ff851684528252808320805482518185028101850190935280835260609492939192909184015b82821015611134576000848152602090206040805160c08101909152600684029091018054829060ff1660038111156110d0576110d0612b35565b60038111156110e1576110e1612b35565b81526001828101546020808401919091526002840154604084015260038401546060840152600484015460808401526005909301546001600160a01b031660a09092019190915291835292019101611095565b50505050905092915050565b6000546001600160a01b0316331461116a5760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b03831661119157604051639fabe1c160e01b815260040160405180910390fd5b604051637921219560e11b81526001600160a01b0385169063f242432a906111c3903090879087908790600401613358565b600060405180830381600087803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b5050604080516001600160a01b03878116825260208201879052881693507f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f909692500160405180910390a250505050565b6000546001600160a01b0316331461126b5760405162461bcd60e51b81526004016104fc90612ff9565b6112756000612579565b565b6002600154036112995760405162461bcd60e51b81526004016104fc9061302e565b60026001556004805460405163bc61e73360e01b81526007928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa1580156112e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130c9190613065565b60ff1660010361132f576040516313d0ff5960e31b815260040160405180910390fd5b336000908152600b60205260409020600301541561136357604051632473a0d360e11b8152600160048201526024016104fc565b60048054604080516349311dbf60e01b815290516001600160a01b03909216926349311dbf9282820192602092908290030181865afa1580156113aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ce9190613090565b8111156113f157604051632473a0d360e11b8152600260048201526024016104fc565b6040805160a0810182524381524260208083019182526000838501818152606085018781523360808701818152818552600b909552878420965187559451600187015590516002860155516003808601919091559151600494850180546001600160a01b0319166001600160a01b0392831617905591549451637921219560e11b8152949091169363f242432a93611490939230929091889101613358565b600060405180830381600087803b1580156114aa57600080fd5b505af11580156114be573d6000803e3d6000fd5b50506040518381523392507f706ce89f7788c1a9d6bba121b3b681d4702c20e9ff6de6b3ea7364a88e233317915060200160405180910390a25060018055565b6000546001600160a01b031633146115285760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b03811661154f57604051639fabe1c160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015611596573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ba9190613090565b90506115d06001600160a01b03841683836125c9565b604080516001600160a01b038481168252602082018490528516917f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f909691016105d3565b6000546001600160a01b0316331461163d5760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b03821661166457604051639fabe1c160e01b815260040160405180910390fd5b8060ff1660010361168f57600580546001600160a01b0319166001600160a01b038416179055611762565b8060ff166002036116ba57600680546001600160a01b0319166001600160a01b038416179055611762565b8060ff166003036116e557600480546001600160a01b0319166001600160a01b038416179055611762565b8060ff1660040361171057600280546001600160a01b0319166001600160a01b038416179055611762565b8060ff1660050361173b57600780546001600160a01b0319166001600160a01b038416179055611762565b8060ff1660060361176257600380546001600160a01b0319166001600160a01b0384161790555b6040516001600160a01b038316815260ff8216907e0961cd4320f350803f764de4992b70c8fc5c948b5881a151f883df0af333579060200160405180910390a25050565b6117e16040518060a001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b506001600160a01b039081166000908152600b6020908152604091829020825160a0810184528154815260018201549281019290925260028101549282019290925260038201546060820152600490910154909116608082015290565b600a602052826000526040600020602052816000526040600020818154811061186657600080fd5b600091825260209091206006909102018054600182015460028301546003840154600485015460059095015460ff9094169750919550935091906001600160a01b031686565b6118ef6040805160c0810190915280600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b6001600160a01b03821660009081526009602052604090819020815160c081019092528054829060ff16600381111561192a5761192a612b35565b600381111561193b5761193b612b35565b8152600182015460208201526002820154604082015260038201546060820152600482015460808201526005909101546001600160a01b031660a09091015292915050565b6002600154036119a25760405162461bcd60e51b81526004016104fc9061302e565b60026001556004805460405163bc61e73360e01b81526006928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa1580156119f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a159190613065565b60ff16600103611a38576040516313d0ff5960e31b815260040160405180910390fd5b3360009081526009602052604090206004015415611a6c576040516328d7be8d60e11b8152600160048201526024016104fc565b600254604051627eeac760e11b81523360048201526024810184905282916001600160a01b03169062fdd58e90604401602060405180830381865afa158015611ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611add9190613090565b1015611aff57604051632473a0d360e11b8152600160048201526024016104fc565b6040518060c00160405280836003811115611b1c57611b1c612b35565b6003811115611b2d57611b2d612b35565b81524360208083019190915242604080840191909152600060608401819052608084018690523360a09094018490529283526009909152902081518154829060ff19166001836003811115611b8457611b84612b35565b02179055506020820151600182015560408083015160028084019190915560608401516003840155608084015160048085019190915560a090940151600590930180546001600160a01b0319166001600160a01b03948516179055549051637921219560e11b815291169163f242432a91611c0791339130918891889101613358565b600060405180830381600087803b158015611c2157600080fd5b505af1158015611c35573d6000803e3d6000fd5b505060408051858152602081018590523393507f2d518bd3665f6fb933a8160586d0c68ec3488d7ca4f583809d07c977f97920e692500160405180910390a2505060018055565b6000546001600160a01b03163314611ca65760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b038116611ccd57604051639fabe1c160e01b815260040160405180910390fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f63cc689e9d3377465b51fb094ea4ca5e0a1436b21f1ad30d707c696111c665009060200160405180910390a150565b60006001600160a01b0387163014611d4b576040516282b42960e81b815260040160405180910390fd5b5063f23a6e6160e01b9695505050505050565b6000546001600160a01b03163314611d885760405162461bcd60e51b81526004016104fc90612ff9565b6001600160a01b038116611ded5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fc565b611df681612579565b50565b600260015403611e1b5760405162461bcd60e51b81526004016104fc9061302e565b60026001556004805460405163bc61e73360e01b81526009928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa158015611e6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e8e9190613065565b60ff16600103611eb1576040516313d0ff5960e31b815260040160405180910390fd5b336000908152600b6020908152604091829020825160a08101845281548152600182015492810192909252600281015492820192909252600382015460608201526004909101546001600160a01b03166080820152611f1082806130a9565b6000818110611f2157611f216130fa565b90506020020135600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9f9190613122565b8251611faf9161ffff1690613153565b611fba906001613153565b14611fdb576040516328d7be8d60e11b8152600260048201526024016104fc565b43600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa15801561202f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120539190613122565b82516120639161ffff1690613153565b10612084576040516328d7be8d60e11b8152600360048201526024016104fc565b6000816060015167ffffffffffffffff8111156120a3576120a3612cb4565b6040519080825280602002602001820160405280156120cc578160200160208202803683370190505b50436040848101918252336000908152600c60209081529181208054600180820183559183528383208851600590920201908155928701519083015591516002820155606085015160038201556080850151600490910180546001600160a01b0319166001600160a01b039092169190911790559091505b82606001518110156123fd576005546000906001600160a01b031663691712333361216f88806130a9565b6000818110612180576121806130fa565b9050602002013588806020019061219791906130a9565b60008181106121a8576121a86130fa565b905060200201358980604001906121bf91906130a9565b60008181106121d0576121d06130fa565b905060200201358a80606001906121e791906130a9565b60008181106121f8576121f86130fa565b905060200201358b806080019061220f91906130a9565b6000818110612220576122206130fa565b9050602002810190612232919061316b565b604051684c4f434b5f424f585f60b81b6020820152602981018c905260490160408051601f19818403018152828252600480546309c9dcb160e01b8552925191936000936001600160a01b0316926309c9dcb1928083019260209291908290030181865afa1580156122a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122cc9190613122565b6040518b63ffffffff1660e01b81526004016122f19a99989796959493929190613390565b602060405180830381865afa15801561230e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123329190613090565b905061233d81612620565b83838151811061234f5761234f6130fa565b6020026020010190600c81111561236857612368612b35565b9081600c81111561237b5761237b612b35565b905250600354604051637a94c56560e11b815230600482015260006024820152600160448201526001600160a01b039091169063f5298aca90606401600060405180830381600087803b1580156123d157600080fd5b505af11580156123e5573d6000803e3d6000fd5b505050505080806123f5906132a1565b915050612144565b50336000908152600b6020526040812081815560018101829055600281018290556003810182905560040180546001600160a01b03191690555b826060015181101561256f576000828281518110612457576124576130fa565b602002602001015190506000600c81111561247457612474612b35565b81600c81111561248657612486612b35565b03612491575061255d565b6006546001600160a01b031663156e29f63383600c8111156124b5576124b5612b35565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b15801561250257600080fd5b505af1158015612516573d6000803e3d6000fd5b50505050336001600160a01b03167f363c1ce153bd4ee16fa06d5456b2b65bfbe89a83c25a18c0c8e435b403f4f4fe826040516125539190613402565b60405180910390a2505b80612567816132a1565b915050612437565b5050600180555050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261261b908490612700565b505050565b600060015b600c81116126f7576004546000906001600160a01b0316632e06b2c183600c81111561265357612653612b35565b6040518263ffffffff1660e01b815260040161266f9190613402565b6040805180830381865afa15801561268b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126af919061341c565b805190915061ffff1684108015906126cf5750602081015161ffff168411155b156126ee5781600c8111156126e6576126e6612b35565b949350505050565b50600101612625565b50600092915050565b6000612755826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127d29092919063ffffffff16565b80519091501561261b578080602001905181019061277391906134a3565b61261b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104fc565b60606127e184846000856127eb565b90505b9392505050565b60608247101561284c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104fc565b843b61289a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104fc565b600080866001600160a01b031685876040516128b691906134c5565b60006040518083038185875af1925050503d80600081146128f3576040519150601f19603f3d011682016040523d82523d6000602084013e6128f8565b606091505b5091509150612908828286612913565b979650505050505050565b606083156129225750816127e4565b8251156129325782518084602001fd5b8160405162461bcd60e51b81526004016104fc91906134e1565b60006020828403121561295e57600080fd5b81356001600160e01b0319811681146127e457600080fd5b80356001600160a01b038116811461298d57600080fd5b919050565b6000806000606084860312156129a757600080fd5b6129b084612976565b92506129be60208501612976565b9150604084013590509250925092565b6000602082840312156129e057600080fd5b6127e482612976565b6020808252825182820181905260009190848201906040850190845b81811015612a5c57612a49838551805182526020808201519083015260408082015190830152606080820151908301526080908101516001600160a01b0316910152565b9284019260a09290920191600101612a05565b50909695505050505050565b600060a08284031215612a7a57600080fd5b50919050565b60008060408385031215612a9357600080fd5b823567ffffffffffffffff811115612aaa57600080fd5b612ab685828601612a68565b95602094909401359450505050565b60008060408385031215612ad857600080fd5b612ae183612976565b946020939093013593505050565b60ff81168114611df657600080fd5b60008060408385031215612b1157600080fd5b612b1a83612976565b91506020830135612b2a81612aef565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b60048110612b5b57612b5b612b35565b9052565b612b6a828251612b4b565b6020818101519083015260408082015190830152606080820151908301526080808201519083015260a0908101516001600160a01b0316910152565b6020808252825182820181905260009190848201906040850190845b81811015612a5c57612bd5838551612b5f565b9284019260c09290920191600101612bc2565b60008060008060808587031215612bfe57600080fd5b612c0785612976565b9350612c1560208601612976565b93969395505050506040820135916060013590565b600060208284031215612c3c57600080fd5b5035919050565b60008060408385031215612c5657600080fd5b612c5f83612976565b9150612c6d60208401612976565b90509250929050565b815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a081016104cc565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612cf357612cf3612cb4565b604052919050565b600082601f830112612d0c57600080fd5b8135602067ffffffffffffffff821115612d2857612d28612cb4565b8160051b612d37828201612cca565b9283528481018201928281019087851115612d5157600080fd5b83870192505b8483101561290857823582529183019190830190612d57565b600080600080600060a08688031215612d8857600080fd5b612d9186612976565b94506020612da0818801612976565b9450604087013567ffffffffffffffff80821115612dbd57600080fd5b612dc98a838b01612cfb565b95506060890135915080821115612ddf57600080fd5b612deb8a838b01612cfb565b94506080890135915080821115612e0157600080fd5b818901915089601f830112612e1557600080fd5b813581811115612e2757612e27612cb4565b612e39601f8201601f19168501612cca565b91508082528a84828501011115612e4f57600080fd5b80848401858401376000848284010152508093505050509295509295909350565b600080600060608486031215612e8557600080fd5b612e8e84612976565b92506020840135612e9e81612aef565b929592945050506040919091013590565b60c08101612ebd8289612b4b565b60208201969096526040810194909452606084019290925260808301526001600160a01b031660a090910152919050565b60c081016104cc8284612b5f565b60008060408385031215612f0f57600080fd5b50508035926020909101359150565b60008060008060008060a08789031215612f3757600080fd5b612f4087612976565b9550612f4e60208801612976565b94506040870135935060608701359250608087013567ffffffffffffffff80821115612f7957600080fd5b818901915089601f830112612f8d57600080fd5b813581811115612f9c57600080fd5b8a6020828501011115612fae57600080fd5b6020830194508093505050509295509295509295565b600060208284031215612fd657600080fd5b813567ffffffffffffffff811115612fed57600080fd5b6126e684828501612a68565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006020828403121561307757600080fd5b81516127e481612aef565b602081016104cc8284612b4b565b6000602082840312156130a257600080fd5b5051919050565b6000808335601e198436030181126130c057600080fd5b83018035915067ffffffffffffffff8211156130db57600080fd5b6020019150600581901b36038213156130f357600080fd5b9250929050565b634e487b7160e01b600052603260045260246000fd5b805161ffff8116811461298d57600080fd5b60006020828403121561313457600080fd5b6127e482613110565b634e487b7160e01b600052601160045260246000fd5b600082198211156131665761316661313d565b500190565b6000808335601e1984360301811261318257600080fd5b83018035915067ffffffffffffffff82111561319d57600080fd5b6020019150368190038213156130f357600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60005b838110156131f65781810151838201526020016131de565b83811115613205576000848401525b50505050565b600081518084526132238160208601602086016131db565b601f01601f19169290920160200192915050565b600061012060018060a01b038d1683528b60208401528a60408401528960608401528860808401528060a0840152613272818401888a6131b2565b905082810360c0840152613286818761320b565b60e08401959095525050610100015298975050505050505050565b6000600182016132b3576132b361313d565b5060010190565b6001600160a01b0384168152606081016132d76020830185612b4b565b826040830152949350505050565b60008160001904831182151516156132ff576132ff61313d565b500290565b60008261332157634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156133385761333861313d565b500390565b6040810161334b8285612b4b565b8260208301529392505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b600061012060018060a01b038d1683528b60208401528a60408401528960608401528860808401528060a08401526133cb818401888a6131b2565b905082810360c08401526133df818761320b565b9150508360e083015261ffff83166101008301529b9a5050505050505050505050565b60208101600d831061341657613416612b35565b91905290565b60006040828403121561342e57600080fd5b82601f83011261343d57600080fd5b6040516040810181811067ffffffffffffffff8211171561346057613460612cb4565b806040525080604084018581111561347757600080fd5b845b818110156134985761348a81613110565b835260209283019201613479565b509195945050505050565b6000602082840312156134b557600080fd5b815180151581146127e457600080fd5b600082516134d78184602087016131db565b9190910192915050565b6020815260006127e4602083018461320b56fea164736f6c634300080d000a

Block Transaction Gas Used Reward
view all blocks collator

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.