Contract 0x4c8770A46Ed59B5FB6E566CF0037BA88b5d4bE63

Contract Overview

Balance:
0 MATIC
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xddd890ac7aee9a227acc1c342ceba2a9865f9c5a3ab4346209f113927cce6101Claim Flagship244239692022-01-30 17:38:27152 days 2 hrs ago0x203f7eef99d4d40b137216f37db07176d5c0cd20 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000448074 2
0x28543e9efd688287c246afc31d044ca1ce6181f24ecfaa48f6738aedef380988Repair Flagship244239572022-01-30 17:38:03152 days 2 hrs ago0x203f7eef99d4d40b137216f37db07176d5c0cd20 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999999
0xe72d13b9dfa9c4f7750fe8f1e7b9c9dffcc04f843823cee5065aa726688f09d9Repair Flagship244181002022-01-30 13:46:27152 days 6 hrs ago0x203f7eef99d4d40b137216f37db07176d5c0cd20 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091658 2.000000001
0x0d50f27f8c3b7ae1b80252c2c9b3f1df9aa4173b2d5141203250568d76512ff3Repair Flagship244181002022-01-30 13:46:27152 days 6 hrs ago0x203f7eef99d4d40b137216f37db07176d5c0cd20 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091658 2.000000001
0xce8499339502ac1f049ad9d33afb4a66f422f34dfcb679e8960cdb12f0827bedRepair Flagship243154832022-01-27 12:57:39155 days 7 hrs ago0x2e2c78a4f76c6cf8fb879323dc4ee7b918acbcdc IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091633999 1.999999998
0xc445c297a6cc48674f6c3cb576af024a7f7f3e051452cc944cbb8b6285a229bfRepair Flagship243154822022-01-27 12:57:35155 days 7 hrs ago0x2e2c78a4f76c6cf8fb879323dc4ee7b918acbcdc IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091633999 1.999999998
0x9fc5d62bad01e366baabb635e468ea670409e2a7f73501daffb67940ecd201e4Repair Flagship243152072022-01-27 12:45:07155 days 7 hrs ago0x5114e0a7a2fc85685bc114477d7c3035d47daf8b IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999998
0xfc13e23a29d8e5d3a66751ef85acf15f4d992617a3617892c6ffab08a4b1d7edRepair Flagship243152062022-01-27 12:45:05155 days 7 hrs ago0x5114e0a7a2fc85685bc114477d7c3035d47daf8b IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999999
0x68a6d1898e4cd626fb7f5ba613c983713397c262359a666121bb962089f1ca8dRepair Flagship243152032022-01-27 12:44:59155 days 7 hrs ago0x5657490942d837bc1bd4658552f1b4a6d1b42775 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091633999 1.999999999
0xfdd87e5a32319b070fea258696ac5b6465c24d831b491c214926501e3aa5eb89Set Dps Contract243146362022-01-27 12:15:15155 days 8 hrs ago0x4bb7e1d5c463ec80d0b316e83a090b00f7d87d1d IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.0016641660
0xb69dae7b74970c3c226b5cf62eda17dc95fbcf47a349948b3fccf041e2137e42Repair Flagship243145202022-01-27 12:10:49155 days 8 hrs ago0x2e2c78a4f76c6cf8fb879323dc4ee7b918acbcdc IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000086033999 1.999999997
0xb0efc9e224aaf7ad974bb5a95d17f6b72085f0e30dad85e607e2b5517ac5e4a4Repair Flagship243144982022-01-27 12:10:05155 days 8 hrs ago0x2e2c78a4f76c6cf8fb879323dc4ee7b918acbcdc IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091633999 1.999999999
0x032d6ad1798f6224502476c38d774594f69611c7e03f6b7ee5121d0da79c2e0dRepair Flagship243144962022-01-27 12:10:01155 days 8 hrs ago0x2e2c78a4f76c6cf8fb879323dc4ee7b918acbcdc IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091633999 1.999999999
0x89806b00375e6c8f4be26d20a5fc1d2cf6e7f3e21d31ef4c6f2fd9f2bac47caaRepair Flagship243141962022-01-27 11:53:59155 days 8 hrs ago0xb5e5fdadfddb911d3cd80452f21378dd8bb046e8 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999999
0x738c077774f40c4c8485085569f9474a305c95f59bffb0baca6c072c799c83caRepair Flagship243141932022-01-27 11:53:47155 days 8 hrs ago0xb5e5fdadfddb911d3cd80452f21378dd8bb046e8 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999999
0xb027e47ed76803921843badc1e14a4ad7ebb1ea359c34a2dd8ddbb85e322a5a7Repair Flagship243141892022-01-27 11:53:31155 days 8 hrs ago0xb5e5fdadfddb911d3cd80452f21378dd8bb046e8 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999998
0x2d2fe726ab914041b5f3ac45aad78d38fb5e8f57d4955768af7c43f26861180bRepair Flagship243141862022-01-27 11:53:19155 days 8 hrs ago0xb5e5fdadfddb911d3cd80452f21378dd8bb046e8 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999998
0xd9ddc724251ac608a89fdfa164fa722efe9e8231c8e85987f0569d7b60c1bad8Repair Flagship243141832022-01-27 11:53:07155 days 8 hrs ago0xb5e5fdadfddb911d3cd80452f21378dd8bb046e8 IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999998
0x4b91edfcfddfc72f2727154b69252ed79be15108107ccad71d7c82a8d5820a67Set Dps Contract243140772022-01-27 11:48:03155 days 8 hrs ago0x4bb7e1d5c463ec80d0b316e83a090b00f7d87d1d IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.0016641660
0x4b69a3609ed951e2d126a2df6e27bffd7f2455f3b59ec325c0b7cd651c96d9a3Repair Flagship243139862022-01-27 11:43:57155 days 8 hrs ago0xd88f34679b914c4c677ddc78ae0bad7cdf6760cc IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091658 2
0x8d2637d4df9b9fc02c0c68a9c8113145e146a1a5a19f3d099c3274d21d1c4acbRepair Flagship243137792022-01-27 11:34:15155 days 9 hrs ago0xd88f34679b914c4c677ddc78ae0bad7cdf6760cc IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091658 2.000000001
0x180e89ab37d9a1e282b2479fe66b4cc059f8cdc9818cf80f8d4399a1f82d00fdRepair Flagship243136472022-01-27 11:27:59155 days 9 hrs ago0x5114e0a7a2fc85685bc114477d7c3035d47daf8b IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999998
0x308117042ba452b3885da1f7478480f3c13c19e240ef910177c2760687e8fce3Repair Flagship243136462022-01-27 11:27:57155 days 9 hrs ago0x5114e0a7a2fc85685bc114477d7c3035d47daf8b IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091657999 1.999999998
0x8fca896530563523b1d44827fa7db325351143c5303a3f9a8987904452b8d61dRepair Flagship243132602022-01-27 11:11:55155 days 9 hrs ago0x5114e0a7a2fc85685bc114477d7c3035d47daf8b IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091658 2
0xa9e90c18aef8e6745961997f7bdcae0fb6d5757f1aa6b5849b63e609c0c04b01Repair Flagship243130322022-01-27 11:00:47155 days 9 hrs ago0x5114e0a7a2fc85685bc114477d7c3035d47daf8b IN  0x4c8770a46ed59b5fb6e566cf0037ba88b5d4be630 MATIC0.000091658 2
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DPSShipyard

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 : DPSShipyard.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";

contract DPSShipyard is Ownable, ReentrancyGuard {
  IERC721 public dps;
  FlagshipI public flagship;

  mapping(uint256 => bool) private mintedFlagships;

  event FlagshipMinted(address indexed _owner, uint16 _tokenId);
  event SetContract(string indexed _target, address _contract);
  event FlagshipRepaired(uint256 indexed _flagshipId);

  constructor() {}

  function claimFlagship(uint16 _dpsId) external nonReentrant {
    require(dps.ownerOf(_dpsId) == msg.sender, "You don't owe this DPS Pirate");
    require(!mintedFlagships[_dpsId], "Flagship already minted");
    mintedFlagships[_dpsId] = true;
    flagship.mint(msg.sender, _dpsId);
    emit FlagshipMinted(msg.sender, _dpsId);
  }

  function repairFlagship(uint256 _flagshipId) external nonReentrant {
    require(flagship.ownerOf(_flagshipId) == msg.sender, "You don't owe this Flagship");
    flagship.upgradePart(FLAGSHIP_PART.HEALTH, _flagshipId, 100);
    emit FlagshipRepaired(_flagshipId);
  }

  /**
   * SETTERS & GETTERS
   */
  function setDpsContract(address _contract) external onlyOwner {
    require(_contract != address(0), "Can not be address 0");
    dps = IERC721(_contract);
    emit SetContract("DPS", _contract);
  }

  function setFlagshipContract(address _contract) external onlyOwner {
    require(_contract != address(0), "Can not be address 0");
    flagship = FlagshipI(_contract);
    emit SetContract("Flagship", _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);
}

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":"uint16","name":"_tokenId","type":"uint16"}],"name":"FlagshipMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_flagshipId","type":"uint256"}],"name":"FlagshipRepaired","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"},{"inputs":[{"internalType":"uint16","name":"_dpsId","type":"uint16"}],"name":"claimFlagship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dps","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flagship","outputs":[{"internalType":"contract FlagshipI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_flagshipId","type":"uint256"}],"name":"repairFlagship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"setDpsContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"setFlagshipContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001a33610023565b60018055610073565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610936806100826000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80638da5cb5b116100665780638da5cb5b146100f7578063a09620fb14610108578063a1e40df81461011b578063e8de7c3f1461012e578063f2fde38b1461014157600080fd5b80633086f74d1461009857806341898d09146100c757806343f4089e146100dc578063715018a6146100ef575b600080fd5b6003546100ab906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100da6100d5366004610828565b610154565b005b6100da6100ea366004610868565b6103b0565b6100da610498565b6000546001600160a01b03166100ab565b6002546100ab906001600160a01b031681565b6100da610129366004610868565b6104ce565b6100da61013c366004610885565b610579565b6100da61014f366004610868565b61073d565b600260015414156101ac5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026001819055546040516331a9108f60e11b815261ffff8316600482015233916001600160a01b031690636352211e9060240160206040518083038186803b1580156101f857600080fd5b505afa15801561020c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610230919061089e565b6001600160a01b0316146102865760405162461bcd60e51b815260206004820152601d60248201527f596f7520646f6e2774206f77652074686973204450532050697261746500000060448201526064016101a3565b61ffff811660009081526004602052604090205460ff16156102ea5760405162461bcd60e51b815260206004820152601760248201527f466c61677368697020616c7265616479206d696e74656400000000000000000060448201526064016101a3565b61ffff8116600081815260046020819052604091829020805460ff1916600117905560035491516340c10f1960e01b8152339181019190915260248101929092526001600160a01b0316906340c10f1990604401600060405180830381600087803b15801561035857600080fd5b505af115801561036c573d6000803e3d6000fd5b505060405161ffff841681523392507f2890feb5d8d1c81cccd8ff6e918319a45f00588d253e36cce602112b9d2b0e0c915060200160405180910390a25060018055565b6000546001600160a01b031633146103da5760405162461bcd60e51b81526004016101a3906108bb565b6001600160a01b0381166104275760405162461bcd60e51b8152602060048201526014602482015273043616e206e6f74206265206164647265737320360641b60448201526064016101a3565b600280546001600160a01b0319166001600160a01b0383161790556040516244505360e81b81526003015b6040519081900381206001600160a01b0383168252907fbf2cc7083b32d1f5c82633af784e1285df86eb43c88d0752feea4bebb4a0b6d29060200160405180910390a250565b6000546001600160a01b031633146104c25760405162461bcd60e51b81526004016101a3906108bb565b6104cc60006107d8565b565b6000546001600160a01b031633146104f85760405162461bcd60e51b81526004016101a3906108bb565b6001600160a01b0381166105455760405162461bcd60e51b8152602060048201526014602482015273043616e206e6f74206265206164647265737320360641b60448201526064016101a3565b600380546001600160a01b0319166001600160a01b038316179055604051670466c6167736869760c41b8152600801610452565b600260015414156105cc5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016101a3565b60026001556003546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e9060240160206040518083038186803b15801561061557600080fd5b505afa158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d919061089e565b6001600160a01b0316146106a35760405162461bcd60e51b815260206004820152601b60248201527f596f7520646f6e2774206f7765207468697320466c616773686970000000000060448201526064016101a3565b600354604051639a55583960e01b81526001600160a01b0390911690639a555839906106d99060009085906064906004016108f0565b600060405180830381600087803b1580156106f357600080fd5b505af1158015610707573d6000803e3d6000fd5b50506040518392507f20d8223977d6b9d0eb961e3357248854b561d0857289a462f9f397847654075d9150600090a25060018055565b6000546001600160a01b031633146107675760405162461bcd60e51b81526004016101a3906108bb565b6001600160a01b0381166107cc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101a3565b6107d5816107d8565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561083a57600080fd5b813561ffff8116811461084c57600080fd5b9392505050565b6001600160a01b03811681146107d557600080fd5b60006020828403121561087a57600080fd5b813561084c81610853565b60006020828403121561089757600080fd5b5035919050565b6000602082840312156108b057600080fd5b815161084c81610853565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b606081016007851061091257634e487b7160e01b600052602160045260246000fd5b938152602081019290925260ff166040909101529056fea164736f6c6343000809000a

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