Contract 0x06dc7692482ddce623dc4317509e68c699df1c08

Contract Overview

Balance:
0 MOVR

MOVR Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xa4805ce6156a55d1432635bda77aeb61a8d4cbcc3fd543e626f9b64e7a75f6b8Set Contract16741492022-04-04 20:59:36239 days 19 hrs ago0x16f615a38528764eea9c6388a8c4e1fc8305cbb3 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.000056092
0x8f2ccbc7bf96b0842e6ef3880c2ee0fff7005893c8cd20849c5417bc114d5ee0Lock To Claim Re...16741302022-04-04 20:51:42239 days 19 hrs ago0x29e56d960307f314e39a2a51a4a67659fcd11cbc IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0001636701
0x9149937caea5f5f7c633a5c74d7dc65510a29855344fd525d9b1ff84a744114aLock To Claim Re...16741182022-04-04 20:45:18239 days 19 hrs ago0x365cd1eacdb05afdfb19b23278633617e04dd78d IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0003719775
0x43cb216002d1490dbaab6f73b642391f0bbfae12ba196b4ad876a3c0cbe6888dLock To Claim Re...16741172022-04-04 20:45:06239 days 19 hrs ago0xbd0e02bd11431489988cdb6c6c72d750032780ac IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.000297582
0x828540f05bf250af34bdc3d98e4d011b2155b72b9a2c90d537c39e6d676f9343Lock To Claim Re...16740872022-04-04 20:30:48239 days 20 hrs ago0x491ffc953e1ab2751817ff90a5f32694a4841474 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.000297582
0x33af8c2737c19701c984d5f63c8e6d976f05340f4aa787fffb0dd2189b56da3eLock To Claim Re...16740712022-04-04 20:21:54239 days 20 hrs ago0xf2ff48b08ce5a73bf2c54d54a733154b274496cb IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0003719775
0x65318de519ce78a88fe809e188384994a7ff64d288ad937906962066840211a30x314fd59f16738782022-04-04 19:02:00239 days 21 hrs ago0xd140a2577f71004f6493e16645ee192fc5359a3c IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.009638525
0xd08eddf36c855d6f850408b82eba407673d697a75b32285798b74f7e37de51660x314fd59f16738582022-04-04 18:53:06239 days 21 hrs ago0xbea84c7f46ae4b7d65eed17602a8f5877bae1345 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.002836933
0x3354b14de181e14bcb512cf02a3c0544885a5f1cc5f247e2d78f392a1caf73e50x314fd59f16738352022-04-04 18:43:18239 days 21 hrs ago0xdbb2c6c8b09403d29621b6d82a594b6882a2ce1c IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.00176325
0xb129bb373f5f8d91d5301d6c9bc97e9ac28176cb176d4f3fe9e8a81d5b00bdeb0x314fd59f16738222022-04-04 18:38:00239 days 21 hrs ago0xc43b01249158d92e386c0c8bcbd41e4225d7043d IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0081418125
0x2ba4d96b09bfb779d63f088599e91a39cb15e26cbabc70341bc1c7f1f79ccc080x314fd59f16738172022-04-04 18:36:30239 days 21 hrs ago0xbd0e02bd11431489988cdb6c6c72d750032780ac IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.00260696
0x468cb2e0024eebb52711c020933f222721f54fd06819aabff6a54cd3e5abd8220x314fd59f16738172022-04-04 18:36:30239 days 21 hrs ago0x1fd271dc80f4cbdc55ad09a17ecf842b3fd02d4f IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.00054901
0x8e597f8b1ff996f21646dffe4e0dcc7156598be2fee68918c133e7cdb828c85e0x314fd59f16738152022-04-04 18:35:42239 days 21 hrs ago0x897a6515b2204f9d2682718f6ef12580a60bbaa8 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0035386043
0x3d220d3359b76d6ef95350071c46f1b6ee5a29534f18d03c616cf4f2871a37640x314fd59f16738112022-04-04 18:34:36239 days 21 hrs ago0x16fd97aad90e6d2c8ee522a475f08471f669b06d IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0080423125
0x7389788b1a3f8e2a1da1755f4de3c81cf11779d7dfa94f98aa6628af61c795250x314fd59f16738112022-04-04 18:34:36239 days 21 hrs ago0xadd515a5e37f702bcdf6c0a4cccceae392177b20 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.000548945
0x3989609d47285a43160fa957366c08155ec369280f47a07ab6370c086aa23085Lock To Claim Re...16738082022-04-04 18:33:06239 days 21 hrs ago0xc9ec5e85b2ec3a4f6e27984b0957e08ab377f0f7 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.000033889
0xa03ff3e6b554d83b173347f293ca7d314c3ff0f812103734afeb119d363298900x314fd59f16738082022-04-04 18:33:06239 days 21 hrs ago0x480b9571bd93428906307ffb888b94cf36b4c08c IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0001276775
0x4abe07de45befcdf78bae78fb1a22d1616fd9b8653f8798d2789105591cf43190x314fd59f16738082022-04-04 18:33:06239 days 21 hrs ago0x50ab3482ddbab69ec9cea29c334d2f2c10b6c3af IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0081417525
0x1492e6eb51e4962485d00857d8ab8529316f1405abf46f3117c1d981f61c84e70x314fd59f16738082022-04-04 18:33:06239 days 21 hrs ago0xa2c71bc81c352db93d943a62e0e799e82c2225c8 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0080435625
0x3554a13b9cdef614307a2267d5e121bc34b4e2cb87b97493deef7b571477f02f0x314fd59f16738082022-04-04 18:33:06239 days 21 hrs ago0xf0c56251ce95e39882cc58f3cc14272771ae2f44 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.00240123
0xd8d90221cbf28184f415d8336a942fac551376ef3f8577c4d9d3a041a57c0cb90x314fd59f16738082022-04-04 18:33:06239 days 21 hrs ago0x29e56d960307f314e39a2a51a4a67659fcd11cbc IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.006548075
0x569269cdffa3fba5f02b002249d63827bcdcd1e169b0412ec0767a9154c3b6290x314fd59f16738082022-04-04 18:33:06239 days 21 hrs ago0xa56cc2cc3fab1a0da80268ea83effbac3daaedc0 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0005092325
0x860d92bed17ec22e30a0950a9f9a2d4a0c7460289e2c8d65e5a615cfb9c401dbLock To Claim Re...16738082022-04-04 18:33:06239 days 21 hrs ago0x58e2c444194ea415efe13779aa006dc36a41c842 IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0000847225
0xf5735370e3ae1079e97936722acb7cddf924e357a237919e8008b8f5c1fc0caeLock To Claim Re...16738082022-04-04 18:33:06239 days 21 hrs ago0x4208ebace6a824ac3cd3e5aa504a112981391e4a IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0000847225
0x31cc9c83bd034cacb1fa598749a51699a2e1490e7b32a6b59a953e37d72d53990x314fd59f16738082022-04-04 18:33:06239 days 21 hrs ago0x480b9571bd93428906307ffb888b94cf36b4c08c IN  0x06dc7692482ddce623dc4317509e68c699df1c080 MOVR0.0081418125
[ Download CSV Export 
Parent Txn Hash Block From To Value
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

Contract Source Code (Solidity Standard Json-Input format)

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) 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;

        // 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 < userLockedChests.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);
        }
        delete lockedChests[msg.sender];

        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 ABI

[{"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"}],"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"}]

60806040523480156200001157600080fd5b506200001d3362000027565b6001805562000077565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61344e80620000876000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c8063886f039a116100f9578063cb441dea11610097578063f23a6e6111610071578063f23a6e611461044f578063f2fde38b14610462578063f851553a14610475578063ffd7593c1461048857600080fd5b8063cb441dea14610409578063effe9cbe14610429578063f0f442601461043c57600080fd5b8063aacc4bbe116100d3578063aacc4bbe14610379578063b7297cf314610399578063bc197c81146103ac578063c6d11e8f146103e457600080fd5b8063886f039a146103425780638da5cb5b146103555780639f33d8811461036657600080fd5b8063618ad7971161016657806364026ac01161014057806364026ac0146103015780636f6b866d14610314578063715018a61461032757806385ddd2091461032f57600080fd5b8063618ad797146102bb57806361d027b3146102db57806362c2fd6b146102ee57600080fd5b80631464e0de116101a25780631464e0de14610231578063269ffd3a14610244578063314fd59f1461026457806353e2edea1461027757600080fd5b806301ffc9a7146101c9578063032c1cc4146101f15780630d7f50351461021c575b600080fd5b6101dc6101d7366004612907565b61049b565b60405190151581526020015b60405180910390f35b600354610204906001600160a01b031681565b6040516001600160a01b0390911681526020016101e8565b61022f61022a36600461294d565b6104d2565b005b600754610204906001600160a01b031681565b610257610252366004612989565b6105e0565b6040516101e891906129a4565b61022f610272366004612a23565b61068a565b61028a610285366004612a5e565b610fb6565b6040805195865260208601949094529284019190915260608301526001600160a01b0316608082015260a0016101e8565b6102ce6102c9366004612a97565b61100d565b6040516101e89190612b3f565b600854610204906001600160a01b031681565b600654610204906001600160a01b031681565b600254610204906001600160a01b031681565b61022f610322366004612b81565b6110fb565b61022f6111fc565b61022f61033d366004612bc3565b611232565b61022f610350366004612bdc565b6114b9565b6000546001600160a01b0316610204565b61022f610374366004612a97565b6115ce565b61038c610387366004612989565b611761565b6040516101e89190612c0f565b600454610204906001600160a01b031681565b6103cb6103ba366004612d09565b63bc197c8160e01b95945050505050565b6040516001600160e01b031990911681526020016101e8565b6103f76103f2366004612e09565b6117f9565b6040516101e896959493929190612e48565b61041c610417366004612989565b611867565b6040516101e89190612e87565b61022f610437366004612e95565b61193b565b61022f61044a366004612989565b611c37565b6103cb61045d366004612eb7565b611cdc565b61022f610470366004612989565b611d19565b61022f610483366004612a23565b611db4565b600554610204906001600160a01b031681565b60006001600160e01b03198216630271189760e51b14806104cc57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000546001600160a01b031633146105055760405162461bcd60e51b81526004016104fc90612f5d565b60405180910390fd5b6001600160a01b03821661052c57604051639fabe1c160e01b815260040160405180910390fd5b604051632142170760e11b81523060048201526001600160a01b038381166024830152604482018390528416906342842e0e90606401600060405180830381600087803b15801561057c57600080fd5b505af1158015610590573d6000803e3d6000fd5b5050604080516001600160a01b03868116825260208201869052871693507f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f90969250015b60405180910390a2505050565b6001600160a01b0381166000908152600c60209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561067f5760008481526020908190206040805160a08101825260058602909201805483526001808201548486015260028201549284019290925260038101546060840152600401546001600160a01b031660808301529083529092019101610618565b505050509050919050565b6002600154036106ac5760405162461bcd60e51b81526004016104fc90612f92565b60026001556004805460405163bc61e73360e01b81526008928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa1580156106fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071f9190612fc9565b60ff16600103610742576040516313d0ff5960e31b815260040160405180910390fd5b33600090815260096020526040808220815160c081019092528054829060ff16600381111561077357610773612ace565b600381111561078457610784612ace565b815260018201546020820152600282015460408201526003820154606082015260048201546080808301919091526005909201546001600160a01b031660a0909101528101519091506000036107f057604051632473a0d360e11b8152600160048201526024016104fc565b805160048054604051637a9749a360e01b815260009283926001600160a01b031691637a9749a39161082491879101612fe6565b602060405180830381865afa158015610841573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108659190612ff4565b90506000610873868061300d565b60008181106108845761088461305e565b90506020020135600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109029190613086565b61ffff16866020015161091591906130b7565b6109209060016130b7565b14610941576040516328d7be8d60e11b8152600260048201526024016104fc565b43600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa158015610995573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b99190613086565b61ffff1686602001516109cc91906130b7565b106109ed576040516328d7be8d60e11b8152600360048201526024016104fc565b60005b8560800151811015610cd3576005546000906001600160a01b0316636917123333610a1b8b8061300d565b6000818110610a2c57610a2c61305e565b905060200201358b8060200190610a43919061300d565b6000818110610a5457610a5461305e565b905060200201358c8060400190610a6b919061300d565b6000818110610a7c57610a7c61305e565b905060200201358d8060600190610a93919061300d565b6000818110610aa457610aa461305e565b905060200201358e8060800190610abb919061300d565b6000818110610acc57610acc61305e565b9050602002810190610ade91906130cf565b6040516c524557415244535f545950455f60981b6020820152602d81018c9052604d0160405160208183030381529060405260006127106040518b63ffffffff1660e01b8152600401610b3a9a9998979695949392919061319b565b602060405180830381865afa158015610b57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7b9190612ff4565b9050838111610b925782610b8e81613205565b9350505b436060880152336000908152600a6020526040812090876003811115610bba57610bba612ace565b60ff168152602080820192909252604001600090812080546001818101835591835292909120895160069093020180548a939192839160ff191690836003811115610c0757610c07612ace565b0217905550602082015160018281019190915560408084015160028085019190915560608501516003850155608085015160048086019190915560a090950151600590940180546001600160a01b0319166001600160a01b03958616179055548b51915163a29b3f5b60e01b815293169363a29b3f5b93610c8d9330939290910161321e565b600060405180830381600087803b158015610ca757600080fd5b505af1158015610cbb573d6000803e3d6000fd5b50505050508080610ccb90613205565b9150506109f0565b5060808501516004805460405163666fa66f60e11b81526001600160a01b039091169163ccdf4cde91610d0891899101612fe6565b602060405180830381865afa158015610d25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d499190612ff4565b610d539190613249565b92508215610e7f576007546040516340c10f1960e01b8152336004820152602481018590526001600160a01b03909116906340c10f1990604401600060405180830381600087803b158015610da757600080fd5b505af1158015610dbb573d6000803e3d6000fd5b5050505060006064846005610dd09190613249565b610dda9190613268565b6007546008546040516340c10f1960e01b81526001600160a01b0391821660048201526024810184905292935016906340c10f1990604401600060405180830381600087803b158015610e2c57600080fd5b505af1158015610e40573d6000803e3d6000fd5b505050507f715f224bde15d12b6a2a3fc1a65c87cae96f02f715a0d38cc3409776a462c54781604051610e7591815260200190565b60405180910390a1505b336000908152600960205260408120805460ff19168155600181018290556002810182905560038101829055600481019190915560050180546001600160a01b03191690558015610f3657600354604051630ab714fb60e11b815233600482015260006024820152604481018390526001600160a01b039091169063156e29f690606401600060405180830381600087803b158015610f1d57600080fd5b505af1158015610f31573d6000803e3d6000fd5b505050505b8451608086015160405133927fa8d0249bd1e379e1eecebbbd2758ce562c20d3014ae36b779bd9432362340de692610f6d9261328a565b60405180910390a260405181815233907f1b2d624122656c0cbbf3659d7b3dcaf0baea306d057563681987029962c869e59060200160405180910390a250506001805550505050565b600c6020528160005260406000208181548110610fd257600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492955090935091906001600160a01b031685565b6001600160a01b0382166000908152600a6020908152604080832060ff851684528252808320805482518185028101850190935280835260609492939192909184015b828210156110ef576000848152602090206040805160c08101909152600684029091018054829060ff16600381111561108b5761108b612ace565b600381111561109c5761109c612ace565b81526001828101546020808401919091526002840154604084015260038401546060840152600484015460808401526005909301546001600160a01b031660a09092019190915291835292019101611050565b50505050905092915050565b6000546001600160a01b031633146111255760405162461bcd60e51b81526004016104fc90612f5d565b6001600160a01b03831661114c57604051639fabe1c160e01b815260040160405180910390fd5b604051637921219560e11b81526001600160a01b0385169063f242432a9061117e9030908790879087906004016132a5565b600060405180830381600087803b15801561119857600080fd5b505af11580156111ac573d6000803e3d6000fd5b5050604080516001600160a01b03878116825260208201879052881693507f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f909692500160405180910390a250505050565b6000546001600160a01b031633146112265760405162461bcd60e51b81526004016104fc90612f5d565b6112306000612534565b565b6002600154036112545760405162461bcd60e51b81526004016104fc90612f92565b60026001556004805460405163bc61e73360e01b81526007928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa1580156112a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c79190612fc9565b60ff166001036112ea576040516313d0ff5960e31b815260040160405180910390fd5b336000908152600b60205260409020600301541561131e57604051632473a0d360e11b8152600160048201526024016104fc565b60048054604080516349311dbf60e01b815290516001600160a01b03909216926349311dbf9282820192602092908290030181865afa158015611365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113899190612ff4565b8111156113ac57604051632473a0d360e11b8152600260048201526024016104fc565b6040805160a0810182524381524260208083019182526000838501818152606085018781523360808701818152818552600b909552878420965187559451600187015590516002860155516003808601919091559151600494850180546001600160a01b0319166001600160a01b0392831617905591549451637921219560e11b8152949091169363f242432a9361144b9392309290918891016132a5565b600060405180830381600087803b15801561146557600080fd5b505af1158015611479573d6000803e3d6000fd5b50506040518381523392507f706ce89f7788c1a9d6bba121b3b681d4702c20e9ff6de6b3ea7364a88e233317915060200160405180910390a25060018055565b6000546001600160a01b031633146114e35760405162461bcd60e51b81526004016104fc90612f5d565b6001600160a01b03811661150a57604051639fabe1c160e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015611551573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115759190612ff4565b905061158b6001600160a01b0384168383612584565b604080516001600160a01b038481168252602082018490528516917f879f92dded0f26b83c3e00b12e0395dc72cfc3077343d1854ed6988edd1f909691016105d3565b6000546001600160a01b031633146115f85760405162461bcd60e51b81526004016104fc90612f5d565b6001600160a01b03821661161f57604051639fabe1c160e01b815260040160405180910390fd5b8060ff1660010361164a57600580546001600160a01b0319166001600160a01b03841617905561171d565b8060ff1660020361167557600680546001600160a01b0319166001600160a01b03841617905561171d565b8060ff166003036116a057600480546001600160a01b0319166001600160a01b03841617905561171d565b8060ff166004036116cb57600280546001600160a01b0319166001600160a01b03841617905561171d565b8060ff166005036116f657600780546001600160a01b0319166001600160a01b03841617905561171d565b8060ff1660060361171d57600380546001600160a01b0319166001600160a01b0384161790555b6040516001600160a01b038316815260ff8216907e0961cd4320f350803f764de4992b70c8fc5c948b5881a151f883df0af333579060200160405180910390a25050565b61179c6040518060a001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b506001600160a01b039081166000908152600b6020908152604091829020825160a0810184528154815260018201549281019290925260028101549282019290925260038201546060820152600490910154909116608082015290565b600a602052826000526040600020602052816000526040600020818154811061182157600080fd5b600091825260209091206006909102018054600182015460028301546003840154600485015460059095015460ff9094169750919550935091906001600160a01b031686565b6118aa6040805160c0810190915280600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b6001600160a01b03821660009081526009602052604090819020815160c081019092528054829060ff1660038111156118e5576118e5612ace565b60038111156118f6576118f6612ace565b8152600182015460208201526002820154604082015260038201546060820152600482015460808201526005909101546001600160a01b031660a09091015292915050565b60026001540361195d5760405162461bcd60e51b81526004016104fc90612f92565b60026001556004805460405163bc61e73360e01b81526006928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa1580156119ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d09190612fc9565b60ff166001036119f3576040516313d0ff5960e31b815260040160405180910390fd5b3360009081526009602052604090206004015415611a27576040516328d7be8d60e11b8152600160048201526024016104fc565b600254604051627eeac760e11b81523360048201526024810184905282916001600160a01b03169062fdd58e90604401602060405180830381865afa158015611a74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a989190612ff4565b1015611aba57604051632473a0d360e11b8152600160048201526024016104fc565b6040518060c00160405280836003811115611ad757611ad7612ace565b6003811115611ae857611ae8612ace565b81524360208083019190915242604080840191909152600060608401819052608084018690523360a09094018490529283526009909152902081518154829060ff19166001836003811115611b3f57611b3f612ace565b02179055506020820151600182015560408083015160028084019190915560608401516003840155608084015160048085019190915560a090940151600590930180546001600160a01b0319166001600160a01b03948516179055549051637921219560e11b815291169163f242432a91611bc2913391309188918891016132a5565b600060405180830381600087803b158015611bdc57600080fd5b505af1158015611bf0573d6000803e3d6000fd5b505060408051858152602081018590523393507f2d518bd3665f6fb933a8160586d0c68ec3488d7ca4f583809d07c977f97920e692500160405180910390a2505060018055565b6000546001600160a01b03163314611c615760405162461bcd60e51b81526004016104fc90612f5d565b6001600160a01b038116611c8857604051639fabe1c160e01b815260040160405180910390fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f63cc689e9d3377465b51fb094ea4ca5e0a1436b21f1ad30d707c696111c665009060200160405180910390a150565b60006001600160a01b0387163014611d06576040516282b42960e81b815260040160405180910390fd5b5063f23a6e6160e01b9695505050505050565b6000546001600160a01b03163314611d435760405162461bcd60e51b81526004016104fc90612f5d565b6001600160a01b038116611da85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fc565b611db181612534565b50565b600260015403611dd65760405162461bcd60e51b81526004016104fc90612f92565b60026001556004805460405163bc61e73360e01b81526009928101929092526001600160a01b03169063bc61e73390602401602060405180830381865afa158015611e25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e499190612fc9565b60ff16600103611e6c576040516313d0ff5960e31b815260040160405180910390fd5b336000908152600b6020908152604091829020825160a08101845281548152600182015492810192909252600281015492820192909252600382015460608201526004909101546001600160a01b03166080820152611ecb828061300d565b6000818110611edc57611edc61305e565b90506020020135600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5a9190613086565b8251611f6a9161ffff16906130b7565b611f759060016130b7565b14611f96576040516328d7be8d60e11b8152600260048201526024016104fc565b43600460009054906101000a90046001600160a01b03166001600160a01b031663a70ec4636040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200e9190613086565b825161201e9161ffff16906130b7565b1061203f576040516328d7be8d60e11b8152600360048201526024016104fc565b6000816060015167ffffffffffffffff81111561205e5761205e612c4d565b604051908082528060200260200182016040528015612087578160200160208202803683370190505b50436040848101918252336000908152600c60209081529181208054600180820183559183528383208851600590920201908155928701519083015591516002820155606085015160038201556080850151600490910180546001600160a01b0319166001600160a01b039092169190911790559091505b82606001518110156123b8576005546000906001600160a01b031663691712333361212a888061300d565b600081811061213b5761213b61305e565b90506020020135888060200190612152919061300d565b60008181106121635761216361305e565b9050602002013589806040019061217a919061300d565b600081811061218b5761218b61305e565b905060200201358a80606001906121a2919061300d565b60008181106121b3576121b361305e565b905060200201358b80608001906121ca919061300d565b60008181106121db576121db61305e565b90506020028101906121ed91906130cf565b604051684c4f434b5f424f585f60b81b6020820152602981018c905260490160408051601f19818403018152828252600480546309c9dcb160e01b8552925191936000936001600160a01b0316926309c9dcb1928083019260209291908290030181865afa158015612263573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122879190613086565b6040518b63ffffffff1660e01b81526004016122ac9a999897969594939291906132dd565b602060405180830381865afa1580156122c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ed9190612ff4565b90506122f8816125db565b83838151811061230a5761230a61305e565b6020026020010190600c81111561232357612323612ace565b9081600c81111561233657612336612ace565b905250600354604051637a94c56560e11b815230600482015260006024820152600160448201526001600160a01b039091169063f5298aca90606401600060405180830381600087803b15801561238c57600080fd5b505af11580156123a0573d6000803e3d6000fd5b505050505080806123b090613205565b9150506120ff565b50336000908152600b6020526040812081815560018101829055600281018290556003810182905560040180546001600160a01b03191690555b826060015181101561252a5760008282815181106124125761241261305e565b602002602001015190506000600c81111561242f5761242f612ace565b81600c81111561244157612441612ace565b0361244c5750612518565b6006546001600160a01b031663156e29f63383600c81111561247057612470612ace565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b1580156124bd57600080fd5b505af11580156124d1573d6000803e3d6000fd5b50505050336001600160a01b03167f363c1ce153bd4ee16fa06d5456b2b65bfbe89a83c25a18c0c8e435b403f4f4fe8260405161250e919061334f565b60405180910390a2505b8061252281613205565b9150506123f2565b5050600180555050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526125d69084906126bb565b505050565b600060015b600c81116126b2576004546000906001600160a01b0316632e06b2c183600c81111561260e5761260e612ace565b6040518263ffffffff1660e01b815260040161262a919061334f565b6040805180830381865afa158015612646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266a9190613369565b805190915061ffff16841080159061268a5750602081015161ffff168411155b156126a95781600c8111156126a1576126a1612ace565b949350505050565b506001016125e0565b50600092915050565b6000612710826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661278d9092919063ffffffff16565b8051909150156125d6578080602001905181019061272e91906133f0565b6125d65760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104fc565b606061279c84846000856127a6565b90505b9392505050565b6060824710156128075760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104fc565b843b6128555760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104fc565b600080866001600160a01b031685876040516128719190613412565b60006040518083038185875af1925050503d80600081146128ae576040519150601f19603f3d011682016040523d82523d6000602084013e6128b3565b606091505b50915091506128c38282866128ce565b979650505050505050565b606083156128dd57508161279f565b8251156128ed5782518084602001fd5b8160405162461bcd60e51b81526004016104fc919061342e565b60006020828403121561291957600080fd5b81356001600160e01b03198116811461279f57600080fd5b80356001600160a01b038116811461294857600080fd5b919050565b60008060006060848603121561296257600080fd5b61296b84612931565b925061297960208501612931565b9150604084013590509250925092565b60006020828403121561299b57600080fd5b61279f82612931565b6020808252825182820181905260009190848201906040850190845b81811015612a1757612a04838551805182526020808201519083015260408082015190830152606080820151908301526080908101516001600160a01b0316910152565b9284019260a092909201916001016129c0565b50909695505050505050565b600060208284031215612a3557600080fd5b813567ffffffffffffffff811115612a4c57600080fd5b820160a0818503121561279f57600080fd5b60008060408385031215612a7157600080fd5b612a7a83612931565b946020939093013593505050565b60ff81168114611db157600080fd5b60008060408385031215612aaa57600080fd5b612ab383612931565b91506020830135612ac381612a88565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b60048110612af457612af4612ace565b9052565b612b03828251612ae4565b6020818101519083015260408082015190830152606080820151908301526080808201519083015260a0908101516001600160a01b0316910152565b6020808252825182820181905260009190848201906040850190845b81811015612a1757612b6e838551612af8565b9284019260c09290920191600101612b5b565b60008060008060808587031215612b9757600080fd5b612ba085612931565b9350612bae60208601612931565b93969395505050506040820135916060013590565b600060208284031215612bd557600080fd5b5035919050565b60008060408385031215612bef57600080fd5b612bf883612931565b9150612c0660208401612931565b90509250929050565b815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a081016104cc565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c8c57612c8c612c4d565b604052919050565b600082601f830112612ca557600080fd5b8135602067ffffffffffffffff821115612cc157612cc1612c4d565b8160051b612cd0828201612c63565b9283528481018201928281019087851115612cea57600080fd5b83870192505b848310156128c357823582529183019190830190612cf0565b600080600080600060a08688031215612d2157600080fd5b612d2a86612931565b94506020612d39818801612931565b9450604087013567ffffffffffffffff80821115612d5657600080fd5b612d628a838b01612c94565b95506060890135915080821115612d7857600080fd5b612d848a838b01612c94565b94506080890135915080821115612d9a57600080fd5b818901915089601f830112612dae57600080fd5b813581811115612dc057612dc0612c4d565b612dd2601f8201601f19168501612c63565b91508082528a84828501011115612de857600080fd5b80848401858401376000848284010152508093505050509295509295909350565b600080600060608486031215612e1e57600080fd5b612e2784612931565b92506020840135612e3781612a88565b929592945050506040919091013590565b60c08101612e568289612ae4565b60208201969096526040810194909452606084019290925260808301526001600160a01b031660a090910152919050565b60c081016104cc8284612af8565b60008060408385031215612ea857600080fd5b50508035926020909101359150565b60008060008060008060a08789031215612ed057600080fd5b612ed987612931565b9550612ee760208801612931565b94506040870135935060608701359250608087013567ffffffffffffffff80821115612f1257600080fd5b818901915089601f830112612f2657600080fd5b813581811115612f3557600080fd5b8a6020828501011115612f4757600080fd5b6020830194508093505050509295509295509295565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060208284031215612fdb57600080fd5b815161279f81612a88565b602081016104cc8284612ae4565b60006020828403121561300657600080fd5b5051919050565b6000808335601e1984360301811261302457600080fd5b83018035915067ffffffffffffffff82111561303f57600080fd5b6020019150600581901b360382131561305757600080fd5b9250929050565b634e487b7160e01b600052603260045260246000fd5b805161ffff8116811461294857600080fd5b60006020828403121561309857600080fd5b61279f82613074565b634e487b7160e01b600052601160045260246000fd5b600082198211156130ca576130ca6130a1565b500190565b6000808335601e198436030181126130e657600080fd5b83018035915067ffffffffffffffff82111561310157600080fd5b60200191503681900382131561305757600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60005b8381101561315a578181015183820152602001613142565b83811115613169576000848401525b50505050565b6000815180845261318781602086016020860161313f565b601f01601f19169290920160200192915050565b600061012060018060a01b038d1683528b60208401528a60408401528960608401528860808401528060a08401526131d6818401888a613116565b905082810360c08401526131ea818761316f565b60e08401959095525050610100015298975050505050505050565b600060018201613217576132176130a1565b5060010190565b6001600160a01b03841681526060810161323b6020830185612ae4565b826040830152949350505050565b6000816000190483118215151615613263576132636130a1565b500290565b60008261328557634e487b7160e01b600052601260045260246000fd5b500490565b604081016132988285612ae4565b8260208301529392505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b600061012060018060a01b038d1683528b60208401528a60408401528960608401528860808401528060a0840152613318818401888a613116565b905082810360c084015261332c818761316f565b9150508360e083015261ffff83166101008301529b9a5050505050505050505050565b60208101600d831061336357613363612ace565b91905290565b60006040828403121561337b57600080fd5b82601f83011261338a57600080fd5b6040516040810181811067ffffffffffffffff821117156133ad576133ad612c4d565b80604052508060408401858111156133c457600080fd5b845b818110156133e5576133d781613074565b8352602092830192016133c6565b509195945050505050565b60006020828403121561340257600080fd5b8151801515811461279f57600080fd5b6000825161342481846020870161313f565b9190910192915050565b60208152600061279f602083018461316f56fea164736f6c634300080d000a

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.