Contract 0xA64E622943DF15C9c0AbD6a76162Bad5601FCC21

Contract Overview

Balance:
0 MATIC
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xca6988aa7c220ac39af3f5ab289e492835c3f921e9f293ff849bb9ff1af9e223Buy Voyage238866202022-01-14 18:43:22168 days 29 mins ago0x5657490942d837bc1bd4658552f1b4a6d1b42775 IN  0xa64e622943df15c9c0abd6a76162bad5601fcc210 MATIC0.00069794 2
0x62495c6002c21cdf68d6ad109e2e68ebaa37d133d526aa907e9c0c0aa8c882dbBuy Voyage238795622022-01-14 13:58:06168 days 5 hrs ago0x5657490942d837bc1bd4658552f1b4a6d1b42775 IN  0xa64e622943df15c9c0abd6a76162bad5601fcc210 MATIC0.000652659999 1.999999997
0x3f60da5de613cf80620d31e97792349b06d8b3aa6cb5044e4635d786f748e58dBuy Voyage236447542022-01-07 14:58:50175 days 4 hrs ago0xc32004eced24167e8aaef9690da3a70387a97a9b IN  0xa64e622943df15c9c0abd6a76162bad5601fcc210 MATIC0.000697940411 2.000001178
0xb135ed8b56c3a39757b8018f0cffe86503fcb190719b4e94c78b3118ab2998cdBuy Voyage236444462022-01-07 14:46:06175 days 4 hrs ago0xc32004eced24167e8aaef9690da3a70387a97a9b IN  0xa64e622943df15c9c0abd6a76162bad5601fcc210 MATIC0.000652659999 1.999999999
0x1371293a8856d7eb2ae196aabffc8c2b2fabae6b2e968f285f96a9813eef19a1Buy Voyage236030102022-01-06 14:37:31176 days 4 hrs ago0xc32004eced24167e8aaef9690da3a70387a97a9b IN  0xa64e622943df15c9c0abd6a76162bad5601fcc210 MATIC0.00071546 2
0xd3d9d9f26128d1fd20e3198b654c3a15437946125a3eccac7e37791588de27aeSet Voyage Contr...229537862021-12-21 20:02:24191 days 23 hrs ago0x4bb7e1d5c463ec80d0b316e83a090b00f7d87d1d IN  0xa64e622943df15c9c0abd6a76162bad5601fcc210 MATIC0.00047652 10.000000001
0xe7e7166074f0a18b9a41025d3beb502b1dc74911579763e5c84526722ce69461Set Tmap Contrac...229537702021-12-21 20:01:52191 days 23 hrs ago0x4bb7e1d5c463ec80d0b316e83a090b00f7d87d1d IN  0xa64e622943df15c9c0abd6a76162bad5601fcc210 MATIC0.00047719 10.000000001
0x4d952c1892f6bc2904b477f85d61c71d4318fd1225f5bea8d335f8c87ebafa5eSet Game Setting...229537652021-12-21 20:01:42191 days 23 hrs ago0x4bb7e1d5c463ec80d0b316e83a090b00f7d87d1d IN  0xa64e622943df15c9c0abd6a76162bad5601fcc210 MATIC0.00047674 10.000000001
0x1cd540eb71323c72cc9cae2d76c0203a8803756401f52109e660c473d4c8a8e8Set Causality Co...229537602021-12-21 20:01:32191 days 23 hrs ago0x4bb7e1d5c463ec80d0b316e83a090b00f7d87d1d IN  0xa64e622943df15c9c0abd6a76162bad5601fcc210 MATIC0.00047631 10.000000002
0x670882d8396f70b8c0cdd01f8ff947709c19ec58d7748fbd1f5fa36e9d16aa940x60806040229536472021-12-21 19:57:38191 days 23 hrs ago0x4bb7e1d5c463ec80d0b316e83a090b00f7d87d1d IN  Create: DPSCartographer0 MATIC0.1494263460
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DPSCartographer

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 16 : DPSCartographer.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

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

contract DPSCartographer is Ownable, ReentrancyGuard {
  using SafeERC20 for IERC20MintableBurnable;

  IERC20MintableBurnable public tmap;
  IERC20MintableBurnable public doubloons;
  VoyageI public voyage;
  DPSRandomI public causality;
  DPSGameSettingsI public gameSettings;

  uint256[] public voyages;

  event BoughtDoublons(address indexed _owner, uint256 _tmap, uint256 _doubloons);
  event SoldDoublons(address indexed _owner, uint256 _tmap, uint256 _doubloons);
  event VoyageCreated(address indexed _owner, uint256 _id, VOYAGE_TYPE _type);
  event SetContract(string indexed _target, address _contract);

  constructor() {}

  function buyDoubloons(uint256 _quantity) external nonReentrant {
    require(tmap.balanceOf(msg.sender) >= _quantity, "Not enough TMAP");
    doubloons.mint(msg.sender, _quantity * 2);
    tmap.burn(msg.sender, _quantity);

    emit BoughtDoublons(msg.sender, _quantity, _quantity * 2);
  }

  function sellDoubloons(uint256 _quantity) external nonReentrant {
    require(doubloons.balanceOf(msg.sender) >= _quantity, "Not enough Doubloons");
    doubloons.burn(msg.sender, _quantity);
    tmap.mint(msg.sender, _quantity / 2);

    emit BoughtDoublons(msg.sender, _quantity / 2, _quantity);
  }

  function buyVoyage(VOYAGE_TYPE _voyageType) external nonReentrant {
    uint256 amountOfTmap = gameSettings.getTMAPPerVoyageType(_voyageType);
    require(amountOfTmap > 0, "Invalid Voyage");
    require(tmap.balanceOf(msg.sender) >= amountOfTmap, "Not enought TMAP");
    uint256[] memory voyagesOfUser = voyage.tokensOfOwner(msg.sender);
    if (voyagesOfUser.length > 0) {
      require(
        voyage.getVoyageConfig(voyagesOfUser[voyagesOfUser.length - 1]).boughtAt < block.number,
        "You can not create 2 voyages in the same block"
      );
    }

    CartographerConfig memory currentVoyageConfigPerType = gameSettings.getVoyageConfig(_voyageType);
    uint8[] memory sequence = new uint8[](currentVoyageConfigPerType.totalInteractions);

    VoyageConfig memory voyageConfig = VoyageConfig(
      _voyageType,
      uint8(sequence.length),
      gameSettings.getBlockJumps(),
      sequence,
      block.number,
      currentVoyageConfigPerType.gapBetweenInteractions
    );

    uint256 voyageId = voyages.length + 1;
    voyages.push(voyageId);

    tmap.burn(msg.sender, amountOfTmap);
    voyage.mint(msg.sender, voyageId, voyageConfig);

    emit VoyageCreated(msg.sender, voyageId, _voyageType);
  }

  function viewVoyageConfiguration(CausalityParams memory causalityParams, uint256 _voyageId)
    external
    view
    returns (VoyageConfig memory voyageConfig)
  {
    voyageConfig = voyage.getVoyageConfig(_voyageId);
    CartographerConfig memory configForThisInteraction = gameSettings.getVoyageConfig(voyageConfig.typeOfVoyage);
    RandomInteractions memory randomInteractionsConfig;
    if (causalityParams._signature.length > 0) {
      randomInteractionsConfig.randomNoOfEnemies = causality.getRandom(
        causalityParams._address,
        causalityParams._blockNumber[0],
        causalityParams._hash1[0],
        causalityParams._hash2[0],
        causalityParams._timestamp[0],
        causalityParams._signature[0],
        "NOOFENEMIES",
        configForThisInteraction.minNoOfEnemies,
        configForThisInteraction.maxNoOfEnemies
      );
      randomInteractionsConfig.randomNoOfStorms = causality.getRandom(
        causalityParams._address,
        causalityParams._blockNumber[1],
        causalityParams._hash1[1],
        causalityParams._hash2[1],
        causalityParams._timestamp[1],
        causalityParams._signature[1],
        "NOOFSTORMS",
        configForThisInteraction.minNoOfStorms,
        configForThisInteraction.maxNoOfStorms
      );
    } else {
      randomInteractionsConfig.randomNoOfEnemies = causality.getRandomUnverified(
        causalityParams._address,
        causalityParams._blockNumber[0],
        causalityParams._hash1[0],
        causalityParams._hash2[0],
        causalityParams._timestamp[0],
        "NOOFENEMIES",
        configForThisInteraction.minNoOfEnemies,
        configForThisInteraction.maxNoOfEnemies
      );
      randomInteractionsConfig.randomNoOfStorms = causality.getRandomUnverified(
        causalityParams._address,
        causalityParams._blockNumber[1],
        causalityParams._hash1[1],
        causalityParams._hash2[1],
        causalityParams._timestamp[1],
        "NOOFSTORMS",
        configForThisInteraction.minNoOfStorms,
        configForThisInteraction.maxNoOfStorms
      );
    }
    randomInteractionsConfig.randomNoOfChests =
      configForThisInteraction.totalInteractions -
      randomInteractionsConfig.randomNoOfEnemies -
      randomInteractionsConfig.randomNoOfStorms;

    voyageConfig.sequence = new uint8[](configForThisInteraction.totalInteractions);
    randomInteractionsConfig.positionsForGeneratingInteractions = new uint256[](3);
    randomInteractionsConfig.positionsForGeneratingInteractions[0] = 1;
    randomInteractionsConfig.positionsForGeneratingInteractions[1] = 2;
    randomInteractionsConfig.positionsForGeneratingInteractions[2] = 3;
    for (uint8 i = 0; i < configForThisInteraction.totalInteractions; i++) {
      if (randomInteractionsConfig.generatedChests == randomInteractionsConfig.randomNoOfChests) {
        randomInteractionsConfig.positionsForGeneratingInteractions = removeByValue(
          randomInteractionsConfig.positionsForGeneratingInteractions,
          1
        );
        randomInteractionsConfig.generatedChests = 0;
      }
      if (randomInteractionsConfig.generatedStorms == randomInteractionsConfig.randomNoOfStorms) {
        randomInteractionsConfig.positionsForGeneratingInteractions = removeByValue(
          randomInteractionsConfig.positionsForGeneratingInteractions,
          2
        );
        randomInteractionsConfig.generatedStorms = 0;
      }
      if (randomInteractionsConfig.generatedEnemies == randomInteractionsConfig.randomNoOfEnemies) {
        randomInteractionsConfig.positionsForGeneratingInteractions = removeByValue(
          randomInteractionsConfig.positionsForGeneratingInteractions,
          3
        );
        randomInteractionsConfig.generatedEnemies = 0;
      }

      uint256 randomPosition;
      if (randomInteractionsConfig.positionsForGeneratingInteractions.length == 1) {
        randomPosition = 0;
      } else if (causalityParams._signature.length > 0) {
        randomPosition = causality.getRandom(
          causalityParams._address,
          causalityParams._blockNumber[i + 2],
          causalityParams._hash1[i + 2],
          causalityParams._hash2[i + 2],
          causalityParams._timestamp[i + 2],
          causalityParams._signature[i + 2],
          string(abi.encodePacked("INTERACTION", i)),
          0,
          uint8(randomInteractionsConfig.positionsForGeneratingInteractions.length) - 1
        );
      } else {
        randomPosition = causality.getRandomUnverified(
          causalityParams._address,
          causalityParams._blockNumber[i + 2],
          causalityParams._hash1[i + 2],
          causalityParams._hash2[i + 2],
          causalityParams._timestamp[i + 2],
          string(abi.encodePacked("INTERACTION", i)),
          0,
          uint8(randomInteractionsConfig.positionsForGeneratingInteractions.length) - 1
        );
      }
      uint8 selectedInteraction = uint8(randomInteractionsConfig.positionsForGeneratingInteractions[randomPosition]);
      voyageConfig.sequence[i] = selectedInteraction;

      if (selectedInteraction == 1) randomInteractionsConfig.generatedChests++;
      else if (selectedInteraction == 2) randomInteractionsConfig.generatedStorms++;
      else if (selectedInteraction == 3) randomInteractionsConfig.generatedEnemies++;
    }
  }

  function removeByValue(uint256[] memory values, uint256 value) internal pure returns (uint256[] memory) {
    uint256[] memory newValues = new uint256[](values.length - 1);
    uint256 k = 0;
    for (uint256 j = 0; j < values.length; j++) {
      if (values[j] == value) continue;
      newValues[k++] = values[j];
    }
    return newValues;
  }

  /**
   * @notice Reinitialization of voyages in case Cartographer gets redeployed
   * @param _start the start id, usually this needs to be 0
   * @param _end the end id, last voyage id that was minted
   */
  function reinitializeVoyages(uint256 _start, uint256 _end) external onlyOwner {
    uint256[] memory newVoyages;
    for (uint256 i = _start; i < _end; i++) {
      newVoyages[i] = i;
    }
    voyages = newVoyages;
  }

  /**
   * SETTERS & GETTERS
   */
  function setTmapContract(address _contract) external onlyOwner {
    require(_contract != address(0), "Can not be address 0");
    tmap = IERC20MintableBurnable(_contract);
    emit SetContract("TMAP", _contract);
  }

  function setDoubloonsContract(address _contract) external onlyOwner {
    require(_contract != address(0), "Can not be address 0");
    doubloons = IERC20MintableBurnable(_contract);
    emit SetContract("Doubloons", _contract);
  }

  function setVoyageContract(address _contract) external onlyOwner {
    require(_contract != address(0), "Can not be address 0");
    voyage = VoyageI(_contract);
    emit SetContract("Voyage", _contract);
  }

  function setCausalityContract(address _contract) external onlyOwner {
    require(_contract != address(0), "Can not be address 0");
    causality = DPSRandomI(_contract);
    emit SetContract("Causality", _contract);
  }

  function setGameSettingsContract(address _contract) external onlyOwner {
    require(_contract != address(0), "Can not be address 0");
    gameSettings = DPSGameSettingsI(_contract);
    emit SetContract("GameSettings", _contract);
  }
}

File 2 of 16 : 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 16 : 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 16 : 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 16 : 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 6 of 16 : 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 7 of 16 : DPSInterfaces.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

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

interface VoyageI 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);
}

interface DPSRandomI {
  function getRandomBatch(
    address _address,
    uint256[] memory _blockNumber,
    bytes32[] memory _hash1,
    bytes32[] memory _hash2,
    uint256[] memory _timestamp,
    bytes[] memory _signature,
    string[] memory _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[] memory _entropy,
    uint256 _min,
    uint256 _max
  ) external pure returns (uint256[] memory randoms);

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

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

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

  function getMaxPointsCap() external view returns (uint16);

  function getFlagshipBaseSkills() 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 getBlockJumps() external view returns (uint16);
}

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

interface SupportShipI is IERC721 {
  function getSkillBoostPerTokenId(uint256 _tokenId) external view returns (uint256, SUPPORT_SHIP_TYPE);

  function burn(uint256 _id) external;
}

interface FlagshipI 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);
}

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 CartographerI {
  function viewVoyageConfiguration(CausalityParams memory causalityParams, uint256 _voyageId)
    external
    view
    returns (VoyageConfig memory voyageConfig);
}

File 8 of 16 : DPSStructs.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

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 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 {
  address _address;
  uint256[] _blockNumber;
  bytes32[] _hash1;
  bytes32[] _hash2;
  uint256[] _timestamp;
  bytes[] _signature;
}

File 9 of 16 : 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 10 of 16 : 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 11 of 16 : 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 16 : 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 16 : 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 14 of 16 : 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 15 of 16 : 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;
}

File 16 of 16 : 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);
}

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

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tmap","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_doubloons","type":"uint256"}],"name":"BoughtDoublons","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":"string","name":"_target","type":"string"},{"indexed":false,"internalType":"address","name":"_contract","type":"address"}],"name":"SetContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_tmap","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_doubloons","type":"uint256"}],"name":"SoldDoublons","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"enum VOYAGE_TYPE","name":"_type","type":"uint8"}],"name":"VoyageCreated","type":"event"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"buyDoubloons","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum VOYAGE_TYPE","name":"_voyageType","type":"uint8"}],"name":"buyVoyage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"causality","outputs":[{"internalType":"contract DPSRandomI","name":"","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":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"reinitializeVoyages","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"sellDoubloons","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"setCausalityContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"setDoubloonsContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"setGameSettingsContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"setTmapContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"setVoyageContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tmap","outputs":[{"internalType":"contract IERC20MintableBurnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256[]","name":"_blockNumber","type":"uint256[]"},{"internalType":"bytes32[]","name":"_hash1","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_hash2","type":"bytes32[]"},{"internalType":"uint256[]","name":"_timestamp","type":"uint256[]"},{"internalType":"bytes[]","name":"_signature","type":"bytes[]"}],"internalType":"struct CausalityParams","name":"causalityParams","type":"tuple"},{"internalType":"uint256","name":"_voyageId","type":"uint256"}],"name":"viewVoyageConfiguration","outputs":[{"components":[{"internalType":"enum VOYAGE_TYPE","name":"typeOfVoyage","type":"uint8"},{"internalType":"uint8","name":"noOfInteractions","type":"uint8"},{"internalType":"uint16","name":"noOfBlockJumps","type":"uint16"},{"internalType":"uint8[]","name":"sequence","type":"uint8[]"},{"internalType":"uint256","name":"boughtAt","type":"uint256"},{"internalType":"uint256","name":"gapBetweenInteractions","type":"uint256"}],"internalType":"struct VoyageConfig","name":"voyageConfig","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voyage","outputs":[{"internalType":"contract VoyageI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"voyages","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5061001a33610023565b60018055610073565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b612b3a80620000836000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806380f669fd116100ad578063d6bc851811610071578063d6bc85181461024f578063ddbf6c5b14610270578063ea68ba8e14610283578063f2fde38b14610296578063ffd7593c146102a957600080fd5b806380f669fd146101f25780638da5cb5b14610205578063b7297cf314610216578063b9f37e3f14610229578063bdb02e501461023c57600080fd5b806340ed72cc116100f457806340ed72cc146101915780634e3975e5146101a4578063712796e5146101b7578063715018a6146101d75780637cc1e895146101df57600080fd5b8063061a966f146101265780631464e0de1461013b5780631526d0db1461016b5780633500f4481461017e575b600080fd5b610139610134366004611efc565b6102bc565b005b60035461014e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610139610179366004611f3a565b610345565b61013961018c366004611f5c565b61040c565b61013961019f366004611f5c565b61061f565b60025461014e906001600160a01b031681565b6101ca6101c5366004612158565b61082d565b604051610162919061233d565b61013961140a565b6101396101ed366004611f3a565b611440565b610139610200366004611f3a565b6114c0565b6000546001600160a01b031661014e565b60065461014e906001600160a01b031681565b60045461014e906001600160a01b031681565b61013961024a36600461235d565b611545565b61026261025d366004611f5c565b611b9a565b604051908152602001610162565b61013961027e366004611f3a565b611bbb565b610139610291366004611f3a565b611c3d565b6101396102a4366004611f3a565b611cc5565b60055461014e906001600160a01b031681565b6000546001600160a01b031633146102ef5760405162461bcd60e51b81526004016102e69061237a565b60405180910390fd5b6060825b8281101561032b578082828151811061030e5761030e6123af565b602090810291909101015280610323816123db565b9150506102f3565b50805161033f906007906020840190611e9c565b50505050565b6000546001600160a01b0316331461036f5760405162461bcd60e51b81526004016102e69061237a565b6001600160a01b0381166103955760405162461bcd60e51b81526004016102e6906123f6565b600380546001600160a01b0319166001600160a01b03831617905560405168446f75626c6f6f6e7360b81b81526009015b6040519081900381206001600160a01b0383168252907fbf2cc7083b32d1f5c82633af784e1285df86eb43c88d0752feea4bebb4a0b6d29060200160405180910390a250565b6002600154141561042f5760405162461bcd60e51b81526004016102e690612424565b60026001819055546040516370a0823160e01b815233600482015282916001600160a01b0316906370a082319060240160206040518083038186803b15801561047757600080fd5b505afa15801561048b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104af919061245b565b10156104ef5760405162461bcd60e51b815260206004820152600f60248201526e04e6f7420656e6f75676820544d415608c1b60448201526064016102e6565b6003546001600160a01b03166340c10f193361050c846002612474565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561055257600080fd5b505af1158015610566573d6000803e3d6000fd5b5050600254604051632770a7eb60e21b8152336004820152602481018590526001600160a01b039091169250639dc29fac9150604401600060405180830381600087803b1580156105b657600080fd5b505af11580156105ca573d6000803e3d6000fd5b503392507f473d227e7b1e11cf73b5ae100067ff6fb243ef3d3a01e185c8874c6d0381b96d91508390506105ff816002612474565b604080519283526020830191909152015b60405180910390a25060018055565b600260015414156106425760405162461bcd60e51b81526004016102e690612424565b60026001556003546040516370a0823160e01b815233600482015282916001600160a01b0316906370a082319060240160206040518083038186803b15801561068a57600080fd5b505afa15801561069e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c2919061245b565b10156107075760405162461bcd60e51b81526020600482015260146024820152734e6f7420656e6f75676820446f75626c6f6f6e7360601b60448201526064016102e6565b600354604051632770a7eb60e21b8152336004820152602481018390526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b15801561075357600080fd5b505af1158015610767573d6000803e3d6000fd5b5050600280546001600160a01b031692506340c10f199150339061078b9085612493565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156107d157600080fd5b505af11580156107e5573d6000803e3d6000fd5b503392507f473d227e7b1e11cf73b5ae100067ff6fb243ef3d3a01e185c8874c6d0381b96d91506108199050600284612493565b604080519182526020820185905201610610565b6040805160c0810182526000808252602082018190529181018290526060808201526080810182905260a0810191909152600480546040516352a701e360e01b81529182018490526001600160a01b0316906352a701e39060240160006040518083038186803b1580156108a057600080fd5b505afa1580156108b4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108dc91908101906124d8565b6006548151604051630cd6be8760e01b81529293506000926001600160a01b0390921691630cd6be8791610912916004016125ea565b6101006040518083038186803b15801561092b57600080fd5b505afa15801561093f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096391906125f8565b90506109ae6040518060e00160405280600081526020016000815260200160008152602001600060ff168152602001600060ff168152602001600060ff168152602001606081525090565b60a08501515115610c2a576005548551602087015180516001600160a01b039093169263691712339291906000906109e8576109e86123af565b60200260200101518860400151600081518110610a0757610a076123af565b60200260200101518960600151600081518110610a2657610a266123af565b60200260200101518a60800151600081518110610a4557610a456123af565b60200260200101518b60a00151600081518110610a6457610a646123af565b602002602001015189608001518a60a001516040518963ffffffff1660e01b8152600401610a99989796959493929190612706565b60206040518083038186803b158015610ab157600080fd5b505afa158015610ac5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae9919061245b565b60408201526005548551602087015180516001600160a01b039093169263691712339291906001908110610b1f57610b1f6123af565b60200260200101518860400151600181518110610b3e57610b3e6123af565b60200260200101518960600151600181518110610b5d57610b5d6123af565b60200260200101518a60800151600181518110610b7c57610b7c6123af565b60200260200101518b60a00151600181518110610b9b57610b9b6123af565b602002602001015189604001518a606001516040518963ffffffff1660e01b8152600401610bd098979695949392919061278a565b60206040518083038186803b158015610be857600080fd5b505afa158015610bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c20919061245b565b6020820152610e57565b6005548551602087015180516001600160a01b0390931692638d91cb33929190600090610c5957610c596123af565b60200260200101518860400151600081518110610c7857610c786123af565b60200260200101518960600151600081518110610c9757610c976123af565b60200260200101518a60800151600081518110610cb657610cb66123af565b602002602001015188608001518960a001516040518863ffffffff1660e01b8152600401610cea97969594939291906127ee565b60206040518083038186803b158015610d0257600080fd5b505afa158015610d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3a919061245b565b60408201526005548551602087015180516001600160a01b0390931692638d91cb339291906001908110610d7057610d706123af565b60200260200101518860400151600181518110610d8f57610d8f6123af565b60200260200101518960600151600181518110610dae57610dae6123af565b60200260200101518a60800151600181518110610dcd57610dcd6123af565b6020026020010151886040015189606001516040518863ffffffff1660e01b8152600401610e019796959493929190612861565b60206040518083038186803b158015610e1957600080fd5b505afa158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e51919061245b565b60208201525b806020015181604001518360c0015160ff16610e7391906128b2565b610e7d91906128b2565b815260c082015160ff1667ffffffffffffffff811115610e9f57610e9f611f75565b604051908082528060200260200182016040528015610ec8578160200160208202803683370190505b506060840152604080516003808252608082019092529081602001602082028036833750505060c08201819052805160019190600090610f0a57610f0a6123af565b60200260200101818152505060028160c00151600181518110610f2f57610f2f6123af565b60200260200101818152505060038160c00151600281518110610f5457610f546123af565b60200260200101818152505060005b8260c0015160ff168160ff161015611401578151606083015160ff161415610fa157610f948260c001516001611d60565b60c0830152600060608301525b8160200151826080015160ff161415610fd057610fc38260c001516002611d60565b60c0830152600060808301525b81604001518260a0015160ff161415610fff57610ff28260c001516003611d60565b60c0830152600060a08301525b60008260c0015151600114156110175750600061133c565b60a087015151156111c857600554875160208901516001600160a01b03909216916369171233919061104a8660026128c9565b60ff168151811061105d5761105d6123af565b60200260200101518a6040015186600261107791906128c9565b60ff168151811061108a5761108a6123af565b60200260200101518b606001518760026110a491906128c9565b60ff16815181106110b7576110b76123af565b60200260200101518c608001518860026110d191906128c9565b60ff16815181106110e4576110e46123af565b60200260200101518d60a001518960026110fe91906128c9565b60ff1681518110611111576111116123af565b60200260200101518960405160200161112a91906128ee565b604051602081830303815290604052600060018d60c001515161114d919061291a565b6040518a63ffffffff1660e01b81526004016111719998979695949392919061293d565b60206040518083038186803b15801561118957600080fd5b505afa15801561119d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c1919061245b565b905061133c565b600554875160208901516001600160a01b0390921691638d91cb3391906111f08660026128c9565b60ff1681518110611203576112036123af565b60200260200101518a6040015186600261121d91906128c9565b60ff1681518110611230576112306123af565b60200260200101518b6060015187600261124a91906128c9565b60ff168151811061125d5761125d6123af565b60200260200101518c6080015188600261127791906128c9565b60ff168151811061128a5761128a6123af565b6020026020010151886040516020016112a391906128ee565b604051602081830303815290604052600060018c60c00151516112c6919061291a565b6040518963ffffffff1660e01b81526004016112e99897969594939291906129ac565b60206040518083038186803b15801561130157600080fd5b505afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611339919061245b565b90505b60008360c001518281518110611354576113546123af565b602002602001015190508086606001518460ff1681518110611378576113786123af565b60ff92831660209182029290920101528116600114156113ad57606084018051906113a282612a05565b60ff169052506113ec565b8060ff16600214156113c957608084018051906113a282612a05565b8060ff16600314156113ec5760a084018051906113e582612a05565b60ff169052505b505080806113f990612a05565b915050610f63565b50505092915050565b6000546001600160a01b031633146114345760405162461bcd60e51b81526004016102e69061237a565b61143e6000611e4c565b565b6000546001600160a01b0316331461146a5760405162461bcd60e51b81526004016102e69061237a565b6001600160a01b0381166114905760405162461bcd60e51b81526004016102e6906123f6565b600280546001600160a01b0319166001600160a01b038316179055604051630544d41560e41b81526004016103c6565b6000546001600160a01b031633146114ea5760405162461bcd60e51b81526004016102e69061237a565b6001600160a01b0381166115105760405162461bcd60e51b81526004016102e6906123f6565b600580546001600160a01b0319166001600160a01b0383161790556040516843617573616c69747960b81b81526009016103c6565b600260015414156115685760405162461bcd60e51b81526004016102e690612424565b60026001556006546040516367fa631960e01b81526000916001600160a01b0316906367fa63199061159e9085906004016125ea565b60206040518083038186803b1580156115b657600080fd5b505afa1580156115ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ee919061245b565b9050600081116116315760405162461bcd60e51b815260206004820152600e60248201526d496e76616c696420566f7961676560901b60448201526064016102e6565b6002546040516370a0823160e01b815233600482015282916001600160a01b0316906370a082319060240160206040518083038186803b15801561167457600080fd5b505afa158015611688573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ac919061245b565b10156116ed5760405162461bcd60e51b815260206004820152601060248201526f04e6f7420656e6f7567687420544d41560841b60448201526064016102e6565b60048054604051632118854760e21b815233928101929092526000916001600160a01b0390911690638462151c9060240160006040518083038186803b15801561173657600080fd5b505afa15801561174a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117729190810190612a25565b80519091501561189357600454815143916001600160a01b0316906352a701e39084906117a1906001906128b2565b815181106117b1576117b16123af565b60200260200101516040518263ffffffff1660e01b81526004016117d791815260200190565b60006040518083038186803b1580156117ef57600080fd5b505afa158015611803573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261182b91908101906124d8565b60800151106118935760405162461bcd60e51b815260206004820152602e60248201527f596f752063616e206e6f7420637265617465203220766f796167657320696e2060448201526d7468652073616d6520626c6f636b60901b60648201526084016102e6565b600654604051630cd6be8760e01b81526000916001600160a01b031690630cd6be87906118c49087906004016125ea565b6101006040518083038186803b1580156118dd57600080fd5b505afa1580156118f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191591906125f8565b905060008160c0015160ff1667ffffffffffffffff81111561193957611939611f75565b604051908082528060200260200182016040528015611962578160200160208202803683370190505b50905060006040518060c001604052808760038111156119845761198461226e565b8152602001835160ff168152602001600660009054906101000a90046001600160a01b03166001600160a01b0316630bcac4876040518163ffffffff1660e01b815260040160206040518083038186803b1580156119e157600080fd5b505afa1580156119f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a199190612ab6565b61ffff1681526020810184905243604082015260e0850151606090910152600754909150600090611a4b906001612ad1565b600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68801819055600254604051632770a7eb60e21b8152336004820152602481018990529192506001600160a01b031690639dc29fac90604401600060405180830381600087803b158015611acd57600080fd5b505af1158015611ae1573d6000803e3d6000fd5b505060048054604051631afb74b160e31b81526001600160a01b03909116935063d7dba5889250611b189133918691889101612ae9565b600060405180830381600087803b158015611b3257600080fd5b505af1158015611b46573d6000803e3d6000fd5b50505050336001600160a01b03167f8761c2e02e44f22776b48baa2d2e5aeb3ab724081fa92bba494f048c1256c5cb8289604051611b85929190612b19565b60405180910390a25050600180555050505050565b60078181548110611baa57600080fd5b600091825260209091200154905081565b6000546001600160a01b03163314611be55760405162461bcd60e51b81526004016102e69061237a565b6001600160a01b038116611c0b5760405162461bcd60e51b81526004016102e6906123f6565b600480546001600160a01b0319166001600160a01b03831617905560405165566f7961676560d01b81526006016103c6565b6000546001600160a01b03163314611c675760405162461bcd60e51b81526004016102e69061237a565b6001600160a01b038116611c8d5760405162461bcd60e51b81526004016102e6906123f6565b600680546001600160a01b0319166001600160a01b0383161790556040516b47616d6553657474696e677360a01b8152600c016103c6565b6000546001600160a01b03163314611cef5760405162461bcd60e51b81526004016102e69061237a565b6001600160a01b038116611d545760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102e6565b611d5d81611e4c565b50565b6060600060018451611d7291906128b2565b67ffffffffffffffff811115611d8a57611d8a611f75565b604051908082528060200260200182016040528015611db3578160200160208202803683370190505b5090506000805b8551811015611e405784868281518110611dd657611dd66123af565b60200260200101511415611de957611e2e565b858181518110611dfb57611dfb6123af565b6020026020010151838380611e0f906123db565b945081518110611e2157611e216123af565b6020026020010181815250505b80611e38816123db565b915050611dba565b50909150505b92915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054828255906000526020600020908101928215611ed7579160200282015b82811115611ed7578251825591602001919060010190611ebc565b50611ee3929150611ee7565b5090565b5b80821115611ee35760008155600101611ee8565b60008060408385031215611f0f57600080fd5b50508035926020909101359150565b80356001600160a01b0381168114611f3557600080fd5b919050565b600060208284031215611f4c57600080fd5b611f5582611f1e565b9392505050565b600060208284031215611f6e57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715611fae57611fae611f75565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611fdd57611fdd611f75565b604052919050565b600067ffffffffffffffff821115611fff57611fff611f75565b5060051b60200190565b600082601f83011261201a57600080fd5b8135602061202f61202a83611fe5565b611fb4565b82815260059290921b8401810191818101908684111561204e57600080fd5b8286015b848110156120695780358352918301918301612052565b509695505050505050565b6000601f838184011261208657600080fd5b8235602061209661202a83611fe5565b82815260059290921b850181019181810190878411156120b557600080fd5b8287015b8481101561214c57803567ffffffffffffffff808211156120da5760008081fd5b818a0191508a603f8301126120ef5760008081fd5b8582013560408282111561210557612105611f75565b612116828b01601f19168901611fb4565b92508183528c8183860101111561212d5760008081fd5b81818501898501375060009082018701528452509183019183016120b9565b50979650505050505050565b6000806040838503121561216b57600080fd5b823567ffffffffffffffff8082111561218357600080fd5b9084019060c0828703121561219757600080fd5b61219f611f8b565b6121a883611f1e565b81526020830135828111156121bc57600080fd5b6121c888828601612009565b6020830152506040830135828111156121e057600080fd5b6121ec88828601612009565b60408301525060608301358281111561220457600080fd5b61221088828601612009565b60608301525060808301358281111561222857600080fd5b61223488828601612009565b60808301525060a08301358281111561224c57600080fd5b61225888828601612074565b60a0830152509660209590950135955050505050565b634e487b7160e01b600052602160045260246000fd5b600481106122a257634e487b7160e01b600052602160045260246000fd5b9052565b600060c083016122b7848451612284565b60208084015160ff8082168388015261ffff60408701511660408801526060860151915060c0606088015283825180865260e0890191508484019550600093505b8084101561231a578551831682529484019460019390930192908401906122f8565b506080870151608089015260a087015160a0890152809550505050505092915050565b602081526000611f5560208301846122a6565b60048110611d5d57600080fd5b60006020828403121561236f57600080fd5b8135611f5581612350565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156123ef576123ef6123c5565b5060010190565b602080825260149082015273043616e206e6f74206265206164647265737320360641b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006020828403121561246d57600080fd5b5051919050565b600081600019048311821515161561248e5761248e6123c5565b500290565b6000826124b057634e487b7160e01b600052601260045260246000fd5b500490565b805160ff81168114611f3557600080fd5b805161ffff81168114611f3557600080fd5b600060208083850312156124eb57600080fd5b825167ffffffffffffffff8082111561250357600080fd5b9084019060c0828703121561251757600080fd5b61251f611f8b565b825161252a81612350565b81526125378385016124b5565b84820152612547604084016124c6565b604082015260608301518281111561255e57600080fd5b83019150601f8201871361257157600080fd5b815161257f61202a82611fe5565b81815260059190911b8301850190858101908983111561259e57600080fd5b938601935b828510156125c3576125b4856124b5565b825293860193908601906125a3565b606084015250506080838101519082015260a0928301519281019290925250949350505050565b60208101611e468284612284565b600061010080838503121561260c57600080fd5b6040519081019067ffffffffffffffff8211818310171561262f5761262f611f75565b8160405261263c846124b5565b815261264a602085016124b5565b602082015261265b604085016124b5565b604082015261266c606085016124b5565b606082015261267d608085016124b5565b608082015261268e60a085016124b5565b60a082015261269f60c085016124b5565b60c082015260e084015160e0820152809250505092915050565b6000815180845260005b818110156126df576020818501810151868301820152016126c3565b818111156126f1576000602083870101525b50601f01601f19169290920160200192915050565b600061012060018060a01b038b1683528960208401528860408401528760608401528660808401528060a0840152612740818401876126b9565b83810360c0850152600b81526a4e4f4f46454e454d49455360a81b60208201529050604081015b91505060ff841660e083015260ff83166101008301529998505050505050505050565b600061012060018060a01b038b1683528960208401528860408401528760608401528660808401528060a08401526127c4818401876126b9565b83810360c0850152600a8152694e4f4f4653544f524d5360b01b6020820152905060408101612767565b600061010060018060a01b038a1683528860208401528760408401528660608401528560808401528060a0840152612840818401600b81526a4e4f4f46454e454d49455360a81b602082015260400190565b91505060ff841660c083015260ff831660e083015298975050505050505050565b600061010060018060a01b038a1683528860208401528760408401528660608401528560808401528060a0840152612840818401600a8152694e4f4f4653544f524d5360b01b602082015260400190565b6000828210156128c4576128c46123c5565b500390565b600060ff821660ff84168060ff038211156128e6576128e66123c5565b019392505050565b6a24a72a22a920a1aa24a7a760a91b815260f89190911b6001600160f81b031916600b820152600c0190565b600060ff821660ff841680821015612934576129346123c5565b90039392505050565b600061012060018060a01b038c1683528a60208401528960408401528860608401528760808401528060a0840152612977818401886126b9565b905082810360c084015261298b81876126b9565b9150508360e083015260ff83166101008301529a9950505050505050505050565b600061010060018060a01b038b1683528960208401528860408401528760608401528660808401528060a08401526129e6818401876126b9565b9150508360c083015260ff831660e08301529998505050505050505050565b600060ff821660ff811415612a1c57612a1c6123c5565b60010192915050565b60006020808385031215612a3857600080fd5b825167ffffffffffffffff811115612a4f57600080fd5b8301601f81018513612a6057600080fd5b8051612a6e61202a82611fe5565b81815260059190911b82018301908381019087831115612a8d57600080fd5b928401925b82841015612aab57835182529284019290840190612a92565b979650505050505050565b600060208284031215612ac857600080fd5b611f55826124c6565b60008219821115612ae457612ae46123c5565b500190565b60018060a01b0384168152826020820152606060408201526000612b1060608301846122a6565b95945050505050565b82815260408101611f55602083018461228456fea164736f6c6343000809000a

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading