GLMR Price: $0.020675 (-2.17%)

Contract

0xECE126517D091bEFDd3C371b295f59b4fE2fef38

Overview

GLMR Balance

Moonbeam Chain LogoMoonbeam Chain LogoMoonbeam Chain Logo0 GLMR

GLMR Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Set Contract34285112023-04-25 18:45:301006 days ago1682448330IN
0xECE12651...4fE2fef38
0 GLMR0.00311817101
Set Features Per...33865282023-04-19 14:16:421012 days ago1681913802IN
0xECE12651...4fE2fef38
0 GLMR0.00488377101.5
Set Features Per...33865252023-04-19 14:16:061012 days ago1681913766IN
0xECE12651...4fE2fef38
0 GLMR0.0048116100
Set Contract33865032023-04-19 14:11:181012 days ago1681913478IN
0xECE12651...4fE2fef38
0 GLMR0.00489804102
Set Contract33865022023-04-19 14:11:061012 days ago1681913466IN
0xECE12651...4fE2fef38
0 GLMR0.0048002100
Set Contract33864992023-04-19 14:10:301012 days ago1681913430IN
0xECE12651...4fE2fef38
0 GLMR0.00486494101.41
Set Contract33864972023-04-19 14:10:061012 days ago1681913406IN
0xECE12651...4fE2fef38
0 GLMR0.00486631101.5
Set Contract33864942023-04-19 14:09:241012 days ago1681913364IN
0xECE12651...4fE2fef38
0 GLMR0.00486337101.5
Set Contract33864932023-04-19 14:09:061012 days ago1681913346IN
0xECE12651...4fE2fef38
0 GLMR0.00486042101.5
Set Contract33864902023-04-19 14:08:301012 days ago1681913310IN
0xECE12651...4fE2fef38
0 GLMR0.00485748101.5
Set Contract33864892023-04-19 14:08:121012 days ago1681913292IN
0xECE12651...4fE2fef38
0 GLMR0.00487845102
Set Contract33864872023-04-19 14:07:481012 days ago1681913268IN
0xECE12651...4fE2fef38
0 GLMR0.00487549102
Set Contract33864862023-04-19 14:07:361012 days ago1681913256IN
0xECE12651...4fE2fef38
0 GLMR0.00484865101.5
Set Contract33864832023-04-19 14:06:541012 days ago1681913214IN
0xECE12651...4fE2fef38
0 GLMR0.00484571101.5

View more zero value Internal Transactions in Advanced View mode

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DPSGameEngine

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/DPSStructs.sol";
import "./interfaces/DPSInterfaces.sol";
import "./../interfaces/IERC20MintableBurnable.sol";

contract DPSGameEngine is DPSGameEngineI, Ownable {
    DPSQRNGI public random;
    DPSSupportShipI public supportShip;
    MintableBurnableIERC1155 public artifact;
    DPSCartographerI public cartographer;
    DPSGameSettingsI public gameSettings;
    DPSGameEngineI public gameEngine;
    DPSDocksI public docks;
    DPSDoubloonMinterI public doubloonsMinter;
    DPSChestsIV2 public chests;
    DPSCrewForCoinI public crewForCoin;
    address public treasury;
    address public plunderers;

    /// @notice an array that keeps for each pirate contract, a contract to get the features out of
    mapping(IERC721 => DPSPirateFeaturesI) public featuresPerPirate;

    /// @notice mapping to keep a nonce for an user at each random action
    mapping(address => uint256) public nonces;

    event SetContract(uint256 _target, address _contract);
    event TreasuryUpdate(uint256 _amount);
    event WonLockBocks(address indexed _user, uint256 _amount);
    event ChangedTreasury(address _newTreasury);
    event OpenedLockBox(address indexed _owner, ARTIFACT_TYPE _type);
    event FeaturesPerPirateChanged(IERC721 indexed _pirate, DPSPirateFeaturesI _feature);
    event RandomNumberGeneratedRewardChest(address indexed owner, uint256 randomResult);
    event RandomNumberGeneratedRewardLockedBox(address indexed owner, uint256 randomResult);

    /**
     * @notice computes skills for the flagship based on the level of the part of the flagship + base skills of the flagship
     * @param levels levels for each part, needs to respect the order of the levels from flagship
     * @param _claimingRewardsCache the cache object that contains the skill points per skill type
     * @return cached object with the skill points updated
     */
    function computeFlagShipSkills(
        uint8[7] memory levels,
        VoyageStatusCache memory _claimingRewardsCache
    ) private view returns (VoyageStatusCache memory) {
        unchecked {
            uint16[7] memory skillsPerPart = gameSettings.getSkillsPerFlagshipParts();
            uint8[7] memory skillTypes = gameSettings.getSkillTypeOfEachFlagshipPart();
            uint256 flagshipBaseSkills = gameSettings.flagshipBaseSkills();
            _claimingRewardsCache.luck += flagshipBaseSkills;
            _claimingRewardsCache.navigation += flagshipBaseSkills;
            _claimingRewardsCache.strength += flagshipBaseSkills;
            for (uint256 i; i < 7; ++i) {
                if (skillTypes[i] == uint8(SKILL_TYPE.LUCK)) _claimingRewardsCache.luck += skillsPerPart[i] * levels[i];
                if (skillTypes[i] == uint8(SKILL_TYPE.NAVIGATION))
                    _claimingRewardsCache.navigation += skillsPerPart[i] * levels[i];
                if (skillTypes[i] == uint8(SKILL_TYPE.STRENGTH))
                    _claimingRewardsCache.strength += skillsPerPart[i] * levels[i];
            }
            return _claimingRewardsCache;
        }
    }

    /**
     * @notice computes skills for the support ships as there are multiple types that apply skills to different skill type: navigation, luck, strength
     * @param _supportShips the array of support ships
     * @param _artifactIds the array of artifacts
     * @param _claimingRewardsCache the cache object that contains the skill points per skill type
     * @return cached object with the skill points updated
     */
    function computeSupportSkills(
        uint8[9] memory _supportShips,
        uint16[13] memory _artifactIds,
        VoyageStatusCache memory _claimingRewardsCache
    ) private view returns (VoyageStatusCache memory) {
        unchecked {
            uint16 skill;
            for (uint256 i = 1; i < 13; ++i) {
                ARTIFACT_TYPE _type = ARTIFACT_TYPE(i);
                if (_artifactIds[i] == 0) continue;
                skill = gameSettings.artifactsSkillBoosts(_type);
                if (
                    _type == ARTIFACT_TYPE.COMMON_STRENGTH ||
                    _type == ARTIFACT_TYPE.RARE_STRENGTH ||
                    _type == ARTIFACT_TYPE.EPIC_STRENGTH ||
                    _type == ARTIFACT_TYPE.LEGENDARY_STRENGTH
                ) _claimingRewardsCache.strength += skill * _artifactIds[i];
                else if (
                    _type == ARTIFACT_TYPE.COMMON_LUCK ||
                    _type == ARTIFACT_TYPE.RARE_LUCK ||
                    _type == ARTIFACT_TYPE.EPIC_LUCK ||
                    _type == ARTIFACT_TYPE.LEGENDARY_LUCK
                ) _claimingRewardsCache.luck += skill * _artifactIds[i];
                else if (
                    _type == ARTIFACT_TYPE.COMMON_NAVIGATION ||
                    _type == ARTIFACT_TYPE.RARE_NAVIGATION ||
                    _type == ARTIFACT_TYPE.EPIC_NAVIGATION ||
                    _type == ARTIFACT_TYPE.LEGENDARY_NAVIGATION
                ) _claimingRewardsCache.navigation += skill * _artifactIds[i];
            }

            for (uint256 i; i < 9; ++i) {
                if (_supportShips[i] == 0) continue;
                SUPPORT_SHIP_TYPE supportShipType = SUPPORT_SHIP_TYPE(i);
                skill = gameSettings.supportShipsSkillBoosts(supportShipType);
                if (
                    supportShipType == SUPPORT_SHIP_TYPE.SLOOP_STRENGTH ||
                    supportShipType == SUPPORT_SHIP_TYPE.CARAVEL_STRENGTH ||
                    supportShipType == SUPPORT_SHIP_TYPE.GALLEON_STRENGTH
                ) _claimingRewardsCache.strength += skill * _supportShips[i];
                else if (
                    supportShipType == SUPPORT_SHIP_TYPE.SLOOP_LUCK ||
                    supportShipType == SUPPORT_SHIP_TYPE.CARAVEL_LUCK ||
                    supportShipType == SUPPORT_SHIP_TYPE.GALLEON_LUCK
                ) _claimingRewardsCache.luck += skill * _supportShips[i];
                else if (
                    supportShipType == SUPPORT_SHIP_TYPE.SLOOP_NAVIGATION ||
                    supportShipType == SUPPORT_SHIP_TYPE.CARAVEL_NAVIGATION ||
                    supportShipType == SUPPORT_SHIP_TYPE.GALLEON_NAVIGATION
                ) _claimingRewardsCache.navigation += skill * _supportShips[i];
            }
            return _claimingRewardsCache;
        }
    }

    /**
     * @notice interprets a randomness result, meaning that based on the skill points accumulated from base pirate skills,
     *         flagship + support ships, we do a comparison between the result of the randomness and the skill points.
     *         if random > skill points than this interaction fails. Things to notice: if STORM or ENEMY fails then we
     *         destroy a support ship (if exists) or do health damage of 100% which will result in skipping all the upcoming
     *         interactions
     * @param _result - random number generated
     * @param _voyageResult - the result object that is cached and sent along for later on saving into storage
     * @param _lockedVoyage - locked voyage that contains the support ship objects that will get modified (sent as storage) if interaction failed
     * @param _claimingRewardsCache - cache object sent along for points updates
     * @param _interaction - interaction that we compute the outcome for
     * @param _index - current index of interaction, used to update the outcome
     * @return updated voyage results and claimingRewardsCache (this updates in case of a support ship getting destroyed)
     */
    function interpretResults(
        uint256 _result,
        VoyageResult memory _voyageResult,
        LockedVoyageV2 memory _lockedVoyage,
        VoyageStatusCache memory _claimingRewardsCache,
        INTERACTION _interaction,
        uint256 _randomNumber,
        uint256 _index
    ) private view returns (VoyageResult memory, VoyageStatusCache memory) {
        if (_interaction == INTERACTION.CHEST && _result <= _claimingRewardsCache.luck) {
            _voyageResult.awardedChests++;
            _voyageResult.interactionResults[_index] = 1;
        } else if (
            (_interaction == INTERACTION.STORM && _result > _claimingRewardsCache.navigation) ||
            (_interaction == INTERACTION.ENEMY && _result > _claimingRewardsCache.strength)
        ) {
            if (_lockedVoyage.totalSupportShips - _voyageResult.totalSupportShipsDestroyed > 0) {
                _voyageResult.totalSupportShipsDestroyed++;
                uint256 supportShipTypesLength;
                for (uint256 i; i < 9; ++i) {
                    if (
                        _lockedVoyage.supportShips[i] > _voyageResult.destroyedSupportShips[i] &&
                        _lockedVoyage.supportShips[i] - _voyageResult.destroyedSupportShips[i] > 0
                    ) supportShipTypesLength++;
                }

                uint256[] memory supportShipTypes = new uint256[](supportShipTypesLength);
                uint256 j;
                for (uint256 i; i < 9; ++i) {
                    if (
                        _lockedVoyage.supportShips[i] > _voyageResult.destroyedSupportShips[i] &&
                        _lockedVoyage.supportShips[i] - _voyageResult.destroyedSupportShips[i] > 0
                    ) {
                        supportShipTypes[j] = i;
                        j++;
                    }
                }

                uint256 chosenType = random.getRandomNumber(
                    _randomNumber,
                    _lockedVoyage.lockedBlock,
                    string(abi.encode("SUPPORT_SHIP_", _index)),
                    uint8(1),
                    supportShipTypesLength
                ) % (supportShipTypesLength);

                SUPPORT_SHIP_TYPE supportShipType = SUPPORT_SHIP_TYPE.SLOOP_STRENGTH;
                for (uint256 i; i < supportShipTypesLength; ++i) {
                    if (chosenType == i) {
                        supportShipType = SUPPORT_SHIP_TYPE(supportShipTypes[i]);
                    }
                }
                _voyageResult.destroyedSupportShips[uint8(supportShipType)]++;
                _voyageResult.intDestroyedSupportShips[_index] = uint8(supportShipType);

                uint16 points = gameSettings.supportShipsSkillBoosts(supportShipType);

                if (
                    supportShipType == SUPPORT_SHIP_TYPE.SLOOP_STRENGTH ||
                    supportShipType == SUPPORT_SHIP_TYPE.CARAVEL_STRENGTH ||
                    supportShipType == SUPPORT_SHIP_TYPE.GALLEON_STRENGTH
                ) _claimingRewardsCache.strength -= points;
                else if (
                    supportShipType == SUPPORT_SHIP_TYPE.SLOOP_LUCK ||
                    supportShipType == SUPPORT_SHIP_TYPE.CARAVEL_LUCK ||
                    supportShipType == SUPPORT_SHIP_TYPE.GALLEON_LUCK
                ) _claimingRewardsCache.luck -= points;
                else if (
                    supportShipType == SUPPORT_SHIP_TYPE.SLOOP_NAVIGATION ||
                    supportShipType == SUPPORT_SHIP_TYPE.CARAVEL_NAVIGATION ||
                    supportShipType == SUPPORT_SHIP_TYPE.GALLEON_NAVIGATION
                ) _claimingRewardsCache.navigation -= points;
            } else {
                _voyageResult.healthDamage = 100;
            }
        } else if (_interaction != INTERACTION.CHEST) {
            _voyageResult.interactionResults[_index] = 1;
        }

        return (_voyageResult, _claimingRewardsCache);
    }

    function debuffVoyage(
        uint16 _voyageType,
        VoyageStatusCache memory _claimingRewardsCache
    ) private view returns (VoyageStatusCache memory) {
        uint16 debuffs = gameSettings.voyageDebuffs(uint256(_voyageType));

        if (_claimingRewardsCache.strength > debuffs) _claimingRewardsCache.strength -= debuffs;
        else _claimingRewardsCache.strength = 0;

        if (_claimingRewardsCache.luck > debuffs) _claimingRewardsCache.luck -= debuffs;
        else _claimingRewardsCache.luck = 0;

        if (_claimingRewardsCache.navigation > debuffs) _claimingRewardsCache.navigation -= debuffs;
        else _claimingRewardsCache.navigation = 0;
        return _claimingRewardsCache;
    }

    function sanityCheckLockVoyages(
        LockedVoyageV2 memory _existingVoyage,
        LockedVoyageV2 memory _finishedVoyage,
        LockedVoyageV2 memory _lockedVoyage,
        VoyageConfigV2 memory _voyageConfig,
        uint256 _totalSupportShips,
        DPSFlagshipI _flagship
    ) external view override {
        // if flagship is unhealthy
        if (_flagship.getPartsLevel(_lockedVoyage.flagshipId)[uint256(FLAGSHIP_PART.HEALTH)] != 100) revert Unhealthy();

        // if it is already started
        if (_existingVoyage.voyageId != 0) revert WrongState(1);

        // if it is already finished
        if (_finishedVoyage.voyageId != 0) revert WrongState(2);

        uint256 totalArtifacts;
        for (uint256 i; i < 13; ++i) {
            if (_lockedVoyage.artifactIds[i] > 0) totalArtifacts += _lockedVoyage.artifactIds[i];
        }

        if (totalArtifacts > gameSettings.maxArtifactsPerVoyage(_voyageConfig.typeOfVoyage)) revert WrongParams(1);

        // too many support ships
        if (
            _totalSupportShips > gameSettings.maxSupportShipsPerVoyageType(_voyageConfig.typeOfVoyage) ||
            _totalSupportShips != _lockedVoyage.totalSupportShips
        ) revert WrongState(3);
    }

    /**
     * @notice computing voyage state based on the locked voyage skills and config and causality params
     * @param _lockedVoyage - locked voyage items
     * @param _sequence - sequence of interactions
     * @param _randomNumber - the random number generated for this voyage
     * @return VoyageResult - containing the results of a voyage based on interactions
     */
    function computeVoyageState(
        LockedVoyageV2 memory _lockedVoyage,
        uint8[] memory _sequence,
        uint256 _randomNumber
    ) external view override returns (VoyageResult memory) {
        uint16[3] memory features;
        DPSPirateFeaturesI dpsFeatures = featuresPerPirate[_lockedVoyage.pirate];

        if (address(dpsFeatures) != address(0)) {
            (, features) = dpsFeatures.getTraitsAndSkills(uint16(_lockedVoyage.dpsId));
        } else {
            features[0] = 150;
            features[1] = 150;
            features[2] = 150;
        }
        VoyageStatusCache memory claimingRewardsCache;

        // traits not set
        if (features[0] == 0) revert WrongState(6);
        unchecked {
            claimingRewardsCache.luck += features[0];
            claimingRewardsCache.navigation += features[1];
            claimingRewardsCache.strength += features[2];
            claimingRewardsCache = computeFlagShipSkills(
                _lockedVoyage.flagship.getPartsLevel(_lockedVoyage.flagshipId),
                claimingRewardsCache
            );
            claimingRewardsCache = computeSupportSkills(
                _lockedVoyage.supportShips,
                _lockedVoyage.artifactIds,
                claimingRewardsCache
            );

            VoyageResult memory voyageResult;
            uint256 maxRollCap = gameSettings.maxRollCap();
            voyageResult.interactionResults = new uint8[](_sequence.length);
            voyageResult.interactionRNGs = new uint16[](_sequence.length);
            voyageResult.intDestroyedSupportShips = new uint8[](_sequence.length);
            claimingRewardsCache = debuffVoyage(_lockedVoyage.voyageType, claimingRewardsCache);
            claimingRewardsCache = applyMaxSkillCap(claimingRewardsCache);

            for (uint256 i; i < _sequence.length; ++i) {
                INTERACTION interaction = INTERACTION(_sequence[i]);
                if (interaction == INTERACTION.NONE || voyageResult.healthDamage == 100) {
                    voyageResult.skippedInteractions++;
                    continue;
                }

                claimingRewardsCache.entropy = string(abi.encode("INTERACTION_RESULT_", i, "_", _lockedVoyage.voyageId));
                uint256 result = random.getRandomNumber(
                    _randomNumber,
                    _lockedVoyage.lockedBlock,
                    claimingRewardsCache.entropy,
                    0,
                    maxRollCap
                );

                (voyageResult, claimingRewardsCache) = interpretResults(
                    result,
                    voyageResult,
                    _lockedVoyage,
                    claimingRewardsCache,
                    interaction,
                    _randomNumber,
                    i
                );
                voyageResult.interactionRNGs[i] = uint16(result);
            }
            return voyageResult;
        }
    }

    function rewardChest(uint256 _randomNumber, uint256 _amount, uint256 voyageType, address _owner) external override {
        if (msg.sender != plunderers && msg.sender != owner()) revert Unauthorized();
        uint256 maxRoll = gameSettings.maxRollPerChest(voyageType);
        uint256 rewardedLockBox = 0;
        uint256 doubloonsRewards;

        for (uint256 i; i < _amount; ++i) {
            uint256 result = random.getRandomNumber(
                _randomNumber,
                nonces[_owner]++,
                string(abi.encode("REWARDS_TYPE_", i)),
                0,
                10000
            );
            emit RandomNumberGeneratedRewardChest(_owner, result);
            if (result <= maxRoll) rewardedLockBox++;
        }
        doubloonsRewards = gameSettings.chestDoubloonRewards(voyageType) * _amount;

        if (doubloonsRewards > 0) {
            doubloonsMinter.mintDoubloons(_owner, doubloonsRewards);

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

        if (rewardedLockBox > 0) {
            // minting lock boxes
            chests.mint(_owner, 4, rewardedLockBox);
            emit WonLockBocks(_owner, rewardedLockBox);
        }
    }

    function rewardLockedBox(uint256 _randomNumber, uint256 _amount, address _owner) external override {
        if (msg.sender != plunderers && msg.sender != owner()) revert Unauthorized();
        ARTIFACT_TYPE[] memory artifacts = new ARTIFACT_TYPE[](_amount);

        for (uint i; i < _amount; ++i) {
            uint256 result = random.getRandomNumber(
                _randomNumber,
                nonces[_owner]++,
                string(abi.encode("LOCK_BOX_", i)),
                0,
                gameSettings.maxRollCapLockBoxes()
            );

            emit RandomNumberGeneratedRewardLockedBox(_owner, result);
            artifacts[i] = interpretLockedBoxResult(result);
        }

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

    /**
     * @notice in case the pirate or flagship was borrowed, the owners can claim so they can claim their assets back once they expired
     *         or if none are borrowed, then the owner must be the msg.sender
     * @param _claimer who claims the voyage
     * @param _lockedVoyage the voyage we want to claim
     * @param _ownerOfVoyage the owner of the voyage stored in the docks
     */
    function checkIfViableClaimer(
        address _claimer,
        LockedVoyageV2 memory _lockedVoyage,
        address _ownerOfVoyage
    ) external view returns (bool) {
        DPSCrewForCoinI.Asset memory assetDPS = crewForCoin.isDPSInMarket(_lockedVoyage.dpsId);
        DPSCrewForCoinI.Asset memory assetFlagship = crewForCoin.isFlagshipInMarket(_lockedVoyage.flagshipId);
        if (assetDPS.borrower != address(0) || assetFlagship.borrower != address(0)) {
            return
                (crewForCoin.isDPSExpired(assetDPS.targetId) && assetDPS.lender == _claimer) ||
                assetDPS.borrower == _claimer ||
                (crewForCoin.isFlagshipExpired(assetFlagship.targetId) && assetFlagship.lender == _claimer) ||
                assetFlagship.borrower == _claimer;
        } else return _claimer == _ownerOfVoyage;
    }

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

    function getLockedVoyageByOwnerAndId(
        address _owner,
        uint256 _voyageId,
        DPSVoyageIV2 _voyage
    ) external view returns (LockedVoyageV2 memory locked) {
        LockedVoyageV2[] memory cachedVoyages = docks.getLockedVoyagesForOwner(_owner, 0, _voyage.maxMintedId());
        for (uint256 i; i < cachedVoyages.length; ++i) {
            if (cachedVoyages[i].voyageId == _voyageId) return cachedVoyages[i];
        }
    }

    function getFinishedVoyageByOwnerAndId(
        address _owner,
        uint256 _voyageId,
        DPSVoyageIV2 _voyage
    ) external view returns (LockedVoyageV2 memory locked) {
        LockedVoyageV2[] memory cachedVoyages = docks.getFinishedVoyagesForOwner(_owner, 0, _voyage.maxMintedId());
        for (uint256 i; i < cachedVoyages.length; ++i) {
            if (cachedVoyages[i].voyageId == _voyageId) return cachedVoyages[i];
        }
    }

    function applyMaxSkillCap(
        VoyageStatusCache memory _claimingRewardsCache
    ) internal view returns (VoyageStatusCache memory modifiedCached) {
        uint256 maxSkillsCap = gameSettings.maxSkillsCap();
        if (_claimingRewardsCache.navigation > maxSkillsCap) _claimingRewardsCache.navigation = maxSkillsCap;

        if (_claimingRewardsCache.luck > maxSkillsCap) _claimingRewardsCache.luck = maxSkillsCap;

        if (_claimingRewardsCache.strength > maxSkillsCap) _claimingRewardsCache.strength = maxSkillsCap;
        modifiedCached = _claimingRewardsCache;
    }

    /**
     * SETTERS & GETTERS
     */
    function setContract(address _contract, uint8 _target) external onlyOwner {
        if (_target == 1) random = DPSQRNGI(_contract);
        else if (_target == 2) supportShip = DPSSupportShipI(_contract);
        else if (_target == 3) artifact = MintableBurnableIERC1155(_contract);
        else if (_target == 4) gameSettings = DPSGameSettingsI(_contract);
        else if (_target == 5) cartographer = DPSCartographerI(_contract);
        else if (_target == 6) chests = DPSChestsIV2(_contract);
        else if (_target == 7) docks = DPSDocksI(_contract);
        else if (_target == 8) doubloonsMinter = DPSDoubloonMinterI(_contract);
        else if (_target == 9) treasury = _contract;
        else if (_target == 10) plunderers = _contract;
        else if (_target == 11) crewForCoin = DPSCrewForCoinI(_contract);
        emit SetContract(_target, _contract);
    }

    function setFeaturesPerPirate(IERC721 _pirate, DPSPirateFeaturesI _feature) external onlyOwner {
        featuresPerPirate[_pirate] = _feature;
        emit FeaturesPerPirateChanged(_pirate, _feature);
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 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;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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);

    /**
     * @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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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`.
     *
     * 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;

    /**
     * @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 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// 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;
}

// 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 12 of 13 : DPSInterfaces.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

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

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

    function burn(uint256 _tokenId) external;

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

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

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

    function maxMintedId() external view returns (uint256);

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

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

    function burn(uint256 _tokenId) external;

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

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

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

    function maxMintedId() external view returns (uint256);

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

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

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

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

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

    function checkCausalityParams(
        CausalityParams calldata _causalityParams,
        VoyageConfigV2 calldata _voyageConfig,
        LockedVoyageV2 calldata _lockedVoyage
    ) external pure;
}

interface DPSGameSettingsI {
    function voyageConfigPerType(uint256 _type) external view returns (CartographerConfig memory);

    function maxSkillsCap() external view returns (uint16);

    function maxRollCap() external view returns (uint16);

    function flagshipBaseSkills() external view returns (uint16);

    function maxOpenLockBoxes() external view returns (uint256);

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

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

    function tmapPerVoyage(uint256 _type) external view returns (uint256);

    function gapBetweenVoyagesCreation() external view returns (uint256);

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

    function isPausedNonReentrant(uint8 _component) external view;

    function tmapPerDoubloon() external view returns (uint256);

    function repairFlagshipCost() external view returns (uint256);

    function doubloonPerFlagshipUpgradePerLevel(uint256 _level) external view returns (uint256);

    function voyageDebuffs(uint256 _type) external view returns (uint16);

    function maxArtifactsPerVoyage(uint16 _type) external view returns (uint256);

    function chestDoubloonRewards(uint256 _type) external view returns (uint256);

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

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

    function maxSupportShipsPerVoyageType(uint256 _type) external view returns (uint8);

    function maxRollPerChest(uint256 _type) external view returns (uint256);

    function maxRollCapLockBoxes() external view returns (uint16);

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

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

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

interface DPSGameEngineI {
    function sanityCheckLockVoyages(
        LockedVoyageV2 memory existingVoyage,
        LockedVoyageV2 memory finishedVoyage,
        LockedVoyageV2 memory lockedVoyage,
        VoyageConfigV2 memory voyageConfig,
        uint256 totalSupportShips,
        DPSFlagshipI _flagship
    ) external view;

    function computeVoyageState(
        LockedVoyageV2 memory _lockedVoyage,
        uint8[] memory _sequence,
        uint256 _randomNumber
    ) external view returns (VoyageResult memory);

    function rewardChest(
        uint256 _randomNumber,
        uint256 _amount,
        uint256 _voyageType,
        address _owner
    ) external;

    function rewardLockedBox(
        uint256 _randomNumber,
        uint256 _amount,
        address _owner
    ) external;

    function checkIfViableClaimer(
        address _claimer,
        LockedVoyageV2 memory _lockedVoyage,
        address _ownerOfVoyage
    ) external view returns (bool);
}

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

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

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

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

    function burn(uint256 _id) external;

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

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

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

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

interface DPSCartographerI {
    function viewVoyageConfiguration(
        uint256 _voyageId,
        DPSVoyageIV2 _voyage
    ) external view returns (VoyageConfigV2 memory voyageConfig);

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

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

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

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

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

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

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

interface DPSDocksI {
    function getFinishedVoyagesForOwner(
        address _owner,
        uint256 _start,
        uint256 _stop
    ) external view returns (LockedVoyageV2[] memory finished);

    function getLockedVoyagesForOwner(
        address _owner,
        uint256 _start,
        uint256 _stop
    ) external view returns (LockedVoyageV2[] memory locked);
}

interface DPSQRNGI {
    function makeRequestUint256(bytes calldata _uniqueId) external;

    function makeRequestUint256Array(uint256 _size, bytes32 _uniqueId) external;

    function getRandomResult(bytes calldata _uniqueId) external view returns (uint256);

    function getRandomResultArray(bytes32 _uniqueId) external view returns (uint256[] memory);

    function getRandomNumber(
        uint256 _randomNumber,
        uint256 _blockNumber,
        string calldata _entropy,
        uint256 _min,
        uint256 _max
    ) external pure returns (uint256);
}

interface DPSCrewForCoinI {
    struct Asset {
        uint32 targetId;
        bool borrowed;
        address borrower;
        uint32 epochs;
        address lender;
        uint64 startTime;
        uint64 endTime;
        uint256 doubloonsPerEpoch;
    }

    function isDPSInMarket(uint256 _tokenId) external view returns (Asset memory);

    function isFlagshipInMarket(uint256 _tokenId) external view returns (Asset memory);

    function isDPSExpired(uint256 _assetId) external view returns (bool);

    function isFlagshipExpired(uint256 _assetId) external view returns (bool);
}

interface DPSDoubloonMinterI {
    function mintDoubloons(address _to, uint256 _amount) external;

    function burnDoubloons(address _from, uint256 _amount) external;
}

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

import "./DPSInterfaces.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";

enum VOYAGE_TYPE {
    EASY,
    MEDIUM,
    HARD,
    LEGENDARY,
    CUSTOM
}

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

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

enum INTERACTION {
    NONE,
    CHEST,
    STORM,
    ENEMY
}

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

enum SKILL_TYPE {
    LUCK,
    STRENGTH,
    NAVIGATION
}

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

struct VoyageConfigV2 {
    uint16 typeOfVoyage;
    uint8 noOfInteractions;
    // 1 - Chest 2 - Storm 3 - Enemy
    uint8[] sequence;
    uint256 boughtAt;
    uint256 gapBetweenInteractions;
    bytes uniqueId;
}

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;
    uint256 randomPosition;
}

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

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

struct LockedVoyageV2 {
    uint8 totalSupportShips;
    uint16 voyageType;
    uint16[13] artifactIds;
    uint8[9] supportShips; //this should be an array for each type, expressing the quantities he took on a trip
    uint8[] sequence;
    uint16 navigation;
    uint16 luck;
    uint16 strength;
    uint256 voyageId;
    uint256 dpsId;
    uint256 flagshipId;
    uint256 lockedBlock;
    uint256 lockedTimestamp;
    uint256 claimedTime;
    bytes uniqueId;
    DPSVoyageIV2 voyage;
    IERC721Metadata pirate;
    DPSFlagshipI flagship;
}

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

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

error AddressZero();
error Paused();
error WrongParams(uint256 _location);
error WrongState(uint256 _state);
error Unauthorized();
error NotEnoughTokens();
error Unhealthy();
error ExternalCallFailed();
error NotFulfilled();
error NotViableClaimer();
error InvalidPartToUpgrade();

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"Unhealthy","type":"error"},{"inputs":[{"internalType":"uint256","name":"_location","type":"uint256"}],"name":"WrongParams","type":"error"},{"inputs":[{"internalType":"uint256","name":"_state","type":"uint256"}],"name":"WrongState","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newTreasury","type":"address"}],"name":"ChangedTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC721","name":"_pirate","type":"address"},{"indexed":false,"internalType":"contract DPSPirateFeaturesI","name":"_feature","type":"address"}],"name":"FeaturesPerPirateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":false,"internalType":"enum ARTIFACT_TYPE","name":"_type","type":"uint8"}],"name":"OpenedLockBox","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"randomResult","type":"uint256"}],"name":"RandomNumberGeneratedRewardChest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"randomResult","type":"uint256"}],"name":"RandomNumberGeneratedRewardLockedBox","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_target","type":"uint256"},{"indexed":false,"internalType":"address","name":"_contract","type":"address"}],"name":"SetContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TreasuryUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"WonLockBocks","type":"event"},{"inputs":[],"name":"artifact","outputs":[{"internalType":"contract MintableBurnableIERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cartographer","outputs":[{"internalType":"contract DPSCartographerI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_claimer","type":"address"},{"components":[{"internalType":"uint8","name":"totalSupportShips","type":"uint8"},{"internalType":"uint16","name":"voyageType","type":"uint16"},{"internalType":"uint16[13]","name":"artifactIds","type":"uint16[13]"},{"internalType":"uint8[9]","name":"supportShips","type":"uint8[9]"},{"internalType":"uint8[]","name":"sequence","type":"uint8[]"},{"internalType":"uint16","name":"navigation","type":"uint16"},{"internalType":"uint16","name":"luck","type":"uint16"},{"internalType":"uint16","name":"strength","type":"uint16"},{"internalType":"uint256","name":"voyageId","type":"uint256"},{"internalType":"uint256","name":"dpsId","type":"uint256"},{"internalType":"uint256","name":"flagshipId","type":"uint256"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedTime","type":"uint256"},{"internalType":"bytes","name":"uniqueId","type":"bytes"},{"internalType":"contract DPSVoyageIV2","name":"voyage","type":"address"},{"internalType":"contract IERC721Metadata","name":"pirate","type":"address"},{"internalType":"contract DPSFlagshipI","name":"flagship","type":"address"}],"internalType":"struct LockedVoyageV2","name":"_lockedVoyage","type":"tuple"},{"internalType":"address","name":"_ownerOfVoyage","type":"address"}],"name":"checkIfViableClaimer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chests","outputs":[{"internalType":"contract DPSChestsIV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"totalSupportShips","type":"uint8"},{"internalType":"uint16","name":"voyageType","type":"uint16"},{"internalType":"uint16[13]","name":"artifactIds","type":"uint16[13]"},{"internalType":"uint8[9]","name":"supportShips","type":"uint8[9]"},{"internalType":"uint8[]","name":"sequence","type":"uint8[]"},{"internalType":"uint16","name":"navigation","type":"uint16"},{"internalType":"uint16","name":"luck","type":"uint16"},{"internalType":"uint16","name":"strength","type":"uint16"},{"internalType":"uint256","name":"voyageId","type":"uint256"},{"internalType":"uint256","name":"dpsId","type":"uint256"},{"internalType":"uint256","name":"flagshipId","type":"uint256"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedTime","type":"uint256"},{"internalType":"bytes","name":"uniqueId","type":"bytes"},{"internalType":"contract DPSVoyageIV2","name":"voyage","type":"address"},{"internalType":"contract IERC721Metadata","name":"pirate","type":"address"},{"internalType":"contract DPSFlagshipI","name":"flagship","type":"address"}],"internalType":"struct LockedVoyageV2","name":"_lockedVoyage","type":"tuple"},{"internalType":"uint8[]","name":"_sequence","type":"uint8[]"},{"internalType":"uint256","name":"_randomNumber","type":"uint256"}],"name":"computeVoyageState","outputs":[{"components":[{"internalType":"uint16","name":"awardedChests","type":"uint16"},{"internalType":"uint8[9]","name":"destroyedSupportShips","type":"uint8[9]"},{"internalType":"uint8","name":"totalSupportShipsDestroyed","type":"uint8"},{"internalType":"uint8","name":"healthDamage","type":"uint8"},{"internalType":"uint16","name":"skippedInteractions","type":"uint16"},{"internalType":"uint16[]","name":"interactionRNGs","type":"uint16[]"},{"internalType":"uint8[]","name":"interactionResults","type":"uint8[]"},{"internalType":"uint8[]","name":"intDestroyedSupportShips","type":"uint8[]"}],"internalType":"struct VoyageResult","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crewForCoin","outputs":[{"internalType":"contract DPSCrewForCoinI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"docks","outputs":[{"internalType":"contract DPSDocksI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"doubloonsMinter","outputs":[{"internalType":"contract DPSDoubloonMinterI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"name":"featuresPerPirate","outputs":[{"internalType":"contract DPSPirateFeaturesI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameEngine","outputs":[{"internalType":"contract DPSGameEngineI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameSettings","outputs":[{"internalType":"contract DPSGameSettingsI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_voyageId","type":"uint256"},{"internalType":"contract DPSVoyageIV2","name":"_voyage","type":"address"}],"name":"getFinishedVoyageByOwnerAndId","outputs":[{"components":[{"internalType":"uint8","name":"totalSupportShips","type":"uint8"},{"internalType":"uint16","name":"voyageType","type":"uint16"},{"internalType":"uint16[13]","name":"artifactIds","type":"uint16[13]"},{"internalType":"uint8[9]","name":"supportShips","type":"uint8[9]"},{"internalType":"uint8[]","name":"sequence","type":"uint8[]"},{"internalType":"uint16","name":"navigation","type":"uint16"},{"internalType":"uint16","name":"luck","type":"uint16"},{"internalType":"uint16","name":"strength","type":"uint16"},{"internalType":"uint256","name":"voyageId","type":"uint256"},{"internalType":"uint256","name":"dpsId","type":"uint256"},{"internalType":"uint256","name":"flagshipId","type":"uint256"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedTime","type":"uint256"},{"internalType":"bytes","name":"uniqueId","type":"bytes"},{"internalType":"contract DPSVoyageIV2","name":"voyage","type":"address"},{"internalType":"contract IERC721Metadata","name":"pirate","type":"address"},{"internalType":"contract DPSFlagshipI","name":"flagship","type":"address"}],"internalType":"struct LockedVoyageV2","name":"locked","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_voyageId","type":"uint256"},{"internalType":"contract DPSVoyageIV2","name":"_voyage","type":"address"}],"name":"getLockedVoyageByOwnerAndId","outputs":[{"components":[{"internalType":"uint8","name":"totalSupportShips","type":"uint8"},{"internalType":"uint16","name":"voyageType","type":"uint16"},{"internalType":"uint16[13]","name":"artifactIds","type":"uint16[13]"},{"internalType":"uint8[9]","name":"supportShips","type":"uint8[9]"},{"internalType":"uint8[]","name":"sequence","type":"uint8[]"},{"internalType":"uint16","name":"navigation","type":"uint16"},{"internalType":"uint16","name":"luck","type":"uint16"},{"internalType":"uint16","name":"strength","type":"uint16"},{"internalType":"uint256","name":"voyageId","type":"uint256"},{"internalType":"uint256","name":"dpsId","type":"uint256"},{"internalType":"uint256","name":"flagshipId","type":"uint256"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedTime","type":"uint256"},{"internalType":"bytes","name":"uniqueId","type":"bytes"},{"internalType":"contract DPSVoyageIV2","name":"voyage","type":"address"},{"internalType":"contract IERC721Metadata","name":"pirate","type":"address"},{"internalType":"contract DPSFlagshipI","name":"flagship","type":"address"}],"internalType":"struct LockedVoyageV2","name":"locked","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"plunderers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"random","outputs":[{"internalType":"contract DPSQRNGI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_randomNumber","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"voyageType","type":"uint256"},{"internalType":"address","name":"_owner","type":"address"}],"name":"rewardChest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_randomNumber","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_owner","type":"address"}],"name":"rewardLockedBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"totalSupportShips","type":"uint8"},{"internalType":"uint16","name":"voyageType","type":"uint16"},{"internalType":"uint16[13]","name":"artifactIds","type":"uint16[13]"},{"internalType":"uint8[9]","name":"supportShips","type":"uint8[9]"},{"internalType":"uint8[]","name":"sequence","type":"uint8[]"},{"internalType":"uint16","name":"navigation","type":"uint16"},{"internalType":"uint16","name":"luck","type":"uint16"},{"internalType":"uint16","name":"strength","type":"uint16"},{"internalType":"uint256","name":"voyageId","type":"uint256"},{"internalType":"uint256","name":"dpsId","type":"uint256"},{"internalType":"uint256","name":"flagshipId","type":"uint256"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedTime","type":"uint256"},{"internalType":"bytes","name":"uniqueId","type":"bytes"},{"internalType":"contract DPSVoyageIV2","name":"voyage","type":"address"},{"internalType":"contract IERC721Metadata","name":"pirate","type":"address"},{"internalType":"contract DPSFlagshipI","name":"flagship","type":"address"}],"internalType":"struct LockedVoyageV2","name":"_existingVoyage","type":"tuple"},{"components":[{"internalType":"uint8","name":"totalSupportShips","type":"uint8"},{"internalType":"uint16","name":"voyageType","type":"uint16"},{"internalType":"uint16[13]","name":"artifactIds","type":"uint16[13]"},{"internalType":"uint8[9]","name":"supportShips","type":"uint8[9]"},{"internalType":"uint8[]","name":"sequence","type":"uint8[]"},{"internalType":"uint16","name":"navigation","type":"uint16"},{"internalType":"uint16","name":"luck","type":"uint16"},{"internalType":"uint16","name":"strength","type":"uint16"},{"internalType":"uint256","name":"voyageId","type":"uint256"},{"internalType":"uint256","name":"dpsId","type":"uint256"},{"internalType":"uint256","name":"flagshipId","type":"uint256"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedTime","type":"uint256"},{"internalType":"bytes","name":"uniqueId","type":"bytes"},{"internalType":"contract DPSVoyageIV2","name":"voyage","type":"address"},{"internalType":"contract IERC721Metadata","name":"pirate","type":"address"},{"internalType":"contract DPSFlagshipI","name":"flagship","type":"address"}],"internalType":"struct LockedVoyageV2","name":"_finishedVoyage","type":"tuple"},{"components":[{"internalType":"uint8","name":"totalSupportShips","type":"uint8"},{"internalType":"uint16","name":"voyageType","type":"uint16"},{"internalType":"uint16[13]","name":"artifactIds","type":"uint16[13]"},{"internalType":"uint8[9]","name":"supportShips","type":"uint8[9]"},{"internalType":"uint8[]","name":"sequence","type":"uint8[]"},{"internalType":"uint16","name":"navigation","type":"uint16"},{"internalType":"uint16","name":"luck","type":"uint16"},{"internalType":"uint16","name":"strength","type":"uint16"},{"internalType":"uint256","name":"voyageId","type":"uint256"},{"internalType":"uint256","name":"dpsId","type":"uint256"},{"internalType":"uint256","name":"flagshipId","type":"uint256"},{"internalType":"uint256","name":"lockedBlock","type":"uint256"},{"internalType":"uint256","name":"lockedTimestamp","type":"uint256"},{"internalType":"uint256","name":"claimedTime","type":"uint256"},{"internalType":"bytes","name":"uniqueId","type":"bytes"},{"internalType":"contract DPSVoyageIV2","name":"voyage","type":"address"},{"internalType":"contract IERC721Metadata","name":"pirate","type":"address"},{"internalType":"contract DPSFlagshipI","name":"flagship","type":"address"}],"internalType":"struct LockedVoyageV2","name":"_lockedVoyage","type":"tuple"},{"components":[{"internalType":"uint16","name":"typeOfVoyage","type":"uint16"},{"internalType":"uint8","name":"noOfInteractions","type":"uint8"},{"internalType":"uint8[]","name":"sequence","type":"uint8[]"},{"internalType":"uint256","name":"boughtAt","type":"uint256"},{"internalType":"uint256","name":"gapBetweenInteractions","type":"uint256"},{"internalType":"bytes","name":"uniqueId","type":"bytes"}],"internalType":"struct VoyageConfigV2","name":"_voyageConfig","type":"tuple"},{"internalType":"uint256","name":"_totalSupportShips","type":"uint256"},{"internalType":"contract DPSFlagshipI","name":"_flagship","type":"address"}],"name":"sanityCheckLockVoyages","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"uint8","name":"_target","type":"uint8"}],"name":"setContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"_pirate","type":"address"},{"internalType":"contract DPSPirateFeaturesI","name":"_feature","type":"address"}],"name":"setFeaturesPerPirate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supportShip","outputs":[{"internalType":"contract DPSSupportShipI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506200001d3362000023565b62000073565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61451380620000836000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c80637ecebe00116100de578063bc89416911610097578063e533627611610071578063e5336276146103a6578063f0514d49146103b9578063f2fde38b146103cc578063f4fe46a2146103df57600080fd5b8063bc89416914610350578063c5e815c714610370578063c8ff2c921461039357600080fd5b80637ecebe00146102c55780638da5cb5b146102f35780639f33d88114610304578063a225632614610317578063b0aa111b1461032a578063b7297cf31461033d57600080fd5b80634cb5bca81161014b57806362c2fd6b1161012557806362c2fd6b14610284578063647aba3014610297578063715018a6146102aa578063797f87ba146102b257600080fd5b80634cb5bca8146102495780635ec01e4d1461025e57806361d027b31461027157600080fd5b80630745742a1461019357806308b59f57146101bc5780632baf4596146101e757806331891228146101fa5780633c2f22bc146102235780634054eaa414610236575b600080fd5b6101a66101a1366004613081565b6103f2565b6040516101b391906131a4565b60405180910390f35b600c546101cf906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b600a546101cf906001600160a01b031681565b6101cf6102083660046132fc565b600d602052600090815260409020546001600160a01b031681565b6002546101cf906001600160a01b031681565b6007546101cf906001600160a01b031681565b61025c610257366004613835565b610558565b005b6001546101cf906001600160a01b031681565b600b546101cf906001600160a01b031681565b6003546101cf906001600160a01b031681565b6004546101cf906001600160a01b031681565b61025c6107f7565b6009546101cf906001600160a01b031681565b6102e56102d33660046132fc565b600e6020526000908152604090205481565b6040519081526020016101b3565b6000546001600160a01b03166101cf565b61025c6103123660046138fa565b61080b565b61025c610325366004613933565b610a30565b6101a6610338366004613081565b610dd5565b6005546101cf906001600160a01b031681565b61036361035e366004613961565b610f20565b6040516101b39190613a01565b61038361037e366004613aba565b611456565b60405190151581526020016101b3565b6008546101cf906001600160a01b031681565b6006546101cf906001600160a01b031681565b61025c6103c7366004613b12565b61171d565b61025c6103da3660046132fc565b61178c565b61025c6103ed366004613b40565b611805565b6103fa612eeb565b6000600760009054906101000a90046001600160a01b03166001600160a01b0316637bc53f3e866000866001600160a01b03166307c560016040518163ffffffff1660e01b8152600401602060405180830381865afa158015610461573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104859190613b81565b6040518463ffffffff1660e01b81526004016104a393929190613b9a565b600060405180830381865afa1580156104c0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104e89190810190613d2e565b905060005b815181101561054e578482828151811061050957610509613f3b565b602002602001015161010001510361053e5781818151811061052d5761052d613f3b565b602002602001015192505050610551565b61054781613f67565b90506104ed565b50505b9392505050565b61014084015160405163a3df934f60e01b815260048101919091526001600160a01b0382169063a3df934f9060240160e060405180830381865afa1580156105a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c89190613f80565b5160ff166064146105ec57604051631f6de81d60e21b815260040160405180910390fd5b61010086015115610618576040516328d7be8d60e11b8152600160048201526024015b60405180910390fd5b6101008501511561063f576040516328d7be8d60e11b81526002600482015260240161060f565b6000805b600d8110156106af576000866040015182600d811061066457610664613f3b565b602002015161ffff16111561069f57856040015181600d811061068957610689613f3b565b602002015161069c9061ffff1683613ff4565b91505b6106a881613f67565b9050610643565b50600554845160405163058c9e0560e01b815261ffff90911660048201526001600160a01b039091169063058c9e0590602401602060405180830381865afa1580156106ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107239190613b81565b81111561074657604051632473a0d360e11b81526001600482015260240161060f565b60055484516040516321c4e01760e01b815261ffff90911660048201526001600160a01b03909116906321c4e01790602401602060405180830381865afa158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b99190614007565b60ff168311806107cd5750845160ff168314155b156107ee576040516328d7be8d60e11b81526003600482015260240161060f565b50505050505050565b6107ff611c6f565b6108096000611cc9565b565b610813611c6f565b8060ff1660010361083e57600180546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660020361086957600280546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660030361089457600380546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff166004036108bf57600580546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff166005036108ea57600480546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660060361091557600980546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660070361094057600780546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660080361096b57600880546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660090361099657600b80546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff16600a036109c157600c80546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff16600b036109e857600a80546001600160a01b0319166001600160a01b0384161790555b6040805160ff831681526001600160a01b03841660208201527fd58da2325ce084e36b92ea4c1a90706ffa665d07ec064f887de9dbb8f15f4995910160405180910390a15050565b600c546001600160a01b03163314801590610a5657506000546001600160a01b03163314155b15610a73576040516282b42960e81b815260040160405180910390fd5b6000826001600160401b03811115610a8d57610a8d613319565b604051908082528060200260200182016040528015610ab6578160200160208202803683370190505b50905060005b83811015610cab576001546001600160a01b038481166000908152600e602052604081208054919392909216916355f5423091899185610afb83613f67565b90915550604080516020810182905260096060820152684c4f434b5f424f585f60b81b608082015290810187905260a00160408051601f198184030181528282526005546309c9dcb160e01b8452915190926000926001600160a01b0316916309c9dcb1916004808201926020929091908290030181865afa158015610b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba99190614024565b6040518663ffffffff1660e01b8152600401610bc9959493929190614041565b602060405180830381865afa158015610be6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0a9190613b81565b9050836001600160a01b03167f8e7792cc94f9d8cc0ee7971f922d5f561e7dcca1ce9e8d1b666d7377d777f73182604051610c4791815260200190565b60405180910390a2610c5881611d19565b838381518110610c6a57610c6a613f3b565b6020026020010190600c811115610c8357610c83613fde565b9081600c811115610c9657610c96613fde565b905250610ca4905081613f67565b9050610abc565b5060005b83811015610dce576000828281518110610ccb57610ccb613f3b565b602002602001015190506000600c811115610ce857610ce8613fde565b81600c811115610cfa57610cfa613fde565b03610d055750610dbe565b6003546001600160a01b031663156e29f68583600c811115610d2957610d29613fde565b60016040518463ffffffff1660e01b8152600401610d4993929190613b9a565b600060405180830381600087803b158015610d6357600080fd5b505af1158015610d77573d6000803e3d6000fd5b50505050836001600160a01b03167f363c1ce153bd4ee16fa06d5456b2b65bfbe89a83c25a18c0c8e435b403f4f4fe82604051610db4919061407c565b60405180910390a2505b610dc781613f67565b9050610caf565b5050505050565b610ddd612eeb565b6000600760009054906101000a90046001600160a01b03166001600160a01b0316639b610b0a866000866001600160a01b03166307c560016040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e689190613b81565b6040518463ffffffff1660e01b8152600401610e8693929190613b9a565b600060405180830381865afa158015610ea3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ecb9190810190613d2e565b905060005b815181101561054e5784828281518110610eec57610eec613f3b565b6020026020010151610100015103610f105781818151811061052d5761052d613f3b565b610f1981613f67565b9050610ed0565b610f28612fa7565b610f30613000565b6102008501516001600160a01b039081166000908152600d6020526040902054168015610fd7576101208601516040516306814e3960e31b815261ffff90911660048201526001600160a01b0382169063340a71c890602401600060405180830381865afa158015610fa6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fce919081019061410c565b9250610fe99050565b60968083526020830181905260408301525b6110146040518060800160405280600081526020016000815260200160008152602001606081525090565b825161ffff1660000361103d576040516328d7be8d60e11b81526006600482015260240161060f565b825160208201805161ffff909216909101905282600160200201516040828101805161ffff93841601905284810151835192169091018252610220880151610140890151915163a3df934f60e01b815260048101929092526110f5916001600160a01b039091169063a3df934f9060240160e060405180830381865afa1580156110cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ef9190613f80565b82611df9565b905061110a87606001518860400151836120fa565b9050611114612fa7565b6005546040805163dc5fa7ab60e01b815290516000926001600160a01b03169163dc5fa7ab9160048083019260209291908290030181865afa15801561115e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111829190614024565b61ffff16905087516001600160401b038111156111a1576111a1613319565b6040519080825280602002602001820160405280156111ca578160200160208202803683370190505b5060c083015287516001600160401b038111156111e9576111e9613319565b604051908082528060200260200182016040528015611212578160200160208202803683370190505b5060a083015287516001600160401b0381111561123157611231613319565b60405190808252806020026020018201604052801561125a578160200160208202803683370190505b5060e0830152602089015161126f908461260c565b925061127a83612750565b925060005b885181101561144857600089828151811061129c5761129c613f3b565b602002602001015160ff1660038111156112b8576112b8613fde565b905060008160038111156112ce576112ce613fde565b14806112e15750836060015160ff166064145b156112fb575060808301805160010161ffff169052611440565b6101008b0151604051611361918491602001608080825260139082015272494e544552414354494f4e5f524553554c545f60681b60a0820152602081019290925260c060408301819052600190830152605f60f81b60e083015260608201526101000190565b60408051601f19818403018152918152606087018290526001546101608e0151915163055f542360e41b81526000936001600160a01b03909216926355f54230926113b6928f92919087908b906004016141d2565b602060405180830381865afa1580156113d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f79190613b81565b905061140881868e89868f8961282b565b8097508196505050808560a00151848151811061142757611427613f3b565b602002602001019061ffff16908161ffff168152505050505b60010161127f565b509098975050505050505050565b600a546101208301516040516353a901bf60e11b815260009283926001600160a01b039091169163a752037e916114939160040190815260200190565b61010060405180830381865afa1580156114b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d59190614240565b600a5461014086015160405163608ad89160e01b81529293506000926001600160a01b039092169163608ad891916115139160040190815260200190565b61010060405180830381865afa158015611531573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115559190614240565b60408301519091506001600160a01b031615158061157f575060408101516001600160a01b031615155b156116ff57600a548251604051634fb09c1560e11b815263ffffffff90911660048201526001600160a01b0390911690639f61382a90602401602060405180830381865afa1580156115d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f99190614305565b801561161a5750856001600160a01b031682608001516001600160a01b0316145b8061163a5750856001600160a01b031682604001516001600160a01b0316145b806116d65750600a54815160405163f1c12e8360e01b815263ffffffff90911660048201526001600160a01b039091169063f1c12e8390602401602060405180830381865afa158015611691573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b59190614305565b80156116d65750856001600160a01b031681608001516001600160a01b0316145b806116f65750856001600160a01b031681604001516001600160a01b0316145b92505050610551565b836001600160a01b0316866001600160a01b03161492505050610551565b611725611c6f565b6001600160a01b038281166000818152600d602090815260409182902080546001600160a01b0319169486169485179055905192835290917fb8fe955c54b89d88fb80eead555ff305d6cf025b2ebe917b38b1e7282592b9f6910160405180910390a25050565b611794611c6f565b6001600160a01b0381166117f95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161060f565b61180281611cc9565b50565b600c546001600160a01b0316331480159061182b57506000546001600160a01b03163314155b15611848576040516282b42960e81b815260040160405180910390fd5b600554604051631df5e93560e01b8152600481018490526000916001600160a01b031690631df5e93590602401602060405180830381865afa158015611892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b69190613b81565b9050600080805b86811015611a11576001546001600160a01b038681166000908152600e602052604081208054919392909216916355f54230918c91856118fc83613f67565b909155506040805160208101829052600d60608201526c524557415244535f545950455f60981b608082015290810187905260a00160405160208183030381529060405260006127106040518663ffffffff1660e01b81526004016119659594939291906141d2565b602060405180830381865afa158015611982573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a69190613b81565b9050856001600160a01b03167f455cdc926e241c130ef73b19f38723a632ef3ce7e4b2f5e563b6dabfd87fbcb0826040516119e391815260200190565b60405180910390a2848111611a0057836119fc81613f67565b9450505b50611a0a81613f67565b90506118bd565b50600554604051632532304160e21b81526004810187905287916001600160a01b0316906394c8c10490602401602060405180830381865afa158015611a5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a7f9190613b81565b611a899190614320565b90508015611bb75760085460405163160493e760e01b81526001600160a01b038681166004830152602482018490529091169063160493e790604401600060405180830381600087803b158015611adf57600080fd5b505af1158015611af3573d6000803e3d6000fd5b5050505060006064826005611b089190614320565b611b12919061434d565b600854600b5460405163160493e760e01b81526001600160a01b03918216600482015260248101849052929350169063160493e790604401600060405180830381600087803b158015611b6457600080fd5b505af1158015611b78573d6000803e3d6000fd5b505050507f715f224bde15d12b6a2a3fc1a65c87cae96f02f715a0d38cc3409776a462c54781604051611bad91815260200190565b60405180910390a1505b81156107ee57600954604051630ab714fb60e11b81526001600160a01b039091169063156e29f690611bf190879060049087908201613b9a565b600060405180830381600087803b158015611c0b57600080fd5b505af1158015611c1f573d6000803e3d6000fd5b50505050836001600160a01b03167f1b2d624122656c0cbbf3659d7b3dcaf0baea306d057563681987029962c869e583604051611c5e91815260200190565b60405180910390a250505050505050565b6000546001600160a01b031633146108095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060015b600c8111611df0576005546000906001600160a01b0316632e06b2c183600c811115611d4c57611d4c613fde565b6040518263ffffffff1660e01b8152600401611d68919061407c565b6040805180830381865afa158015611d84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da89190614361565b805190915061ffff168410801590611dc85750602081015161ffff168411155b15611de75781600c811115611ddf57611ddf613fde565b949350505050565b50600101611d1e565b50600092915050565b611e246040518060800160405280600081526020016000815260200160008152602001606081525090565b6005546040805163017ba3c160e71b815290516000926001600160a01b03169163bdd1e0809160048083019260e09291908290030181865afa158015611e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9291906143de565b90506000600560009054906101000a90046001600160a01b03166001600160a01b031663904b33d36040518163ffffffff1660e01b815260040160e060405180830381865afa158015611ee9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0d9190613f80565b90506000600560009054906101000a90046001600160a01b03166001600160a01b0316638601b2296040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f889190614024565b60208601805161ffff92909216918201905260408601805182019052855181018652905060005b60078110156120ec576000838260078110611fcc57611fcc613f3b565b602002015160ff160361201f57868160078110611feb57611feb613f3b565b602002015160ff1684826007811061200557612005613f3b565b60200201510261ffff168660200181815101915081815250505b600283826007811061203357612033613f3b565b602002015160ff16036120865786816007811061205257612052613f3b565b602002015160ff1684826007811061206c5761206c613f3b565b60200201510261ffff168660400181815101915081815250505b600183826007811061209a5761209a613f3b565b602002015160ff16036120e4578681600781106120b9576120b9613f3b565b602002015160ff168482600781106120d3576120d3613f3b565b60200201518751910261ffff160186525b600101611faf565b508493505050505b92915050565b6121256040518060800160405280600081526020016000815260200160008152602001606081525090565b600060015b600d8110156123be57600081600c81111561214757612147613fde565b90508582600d811061215b5761215b613f3b565b602002015161ffff1660000361217157506123b6565b600554604051637bc3a0cb60e01b81526001600160a01b0390911690637bc3a0cb906121a190849060040161407c565b602060405180830381865afa1580156121be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e29190614024565b9250600181600c8111156121f8576121f8613fde565b14806122155750600481600c81111561221357612213613fde565b145b806122315750600781600c81111561222f5761222f613fde565b145b8061224d5750600a81600c81111561224b5761224b613fde565b145b1561227a578582600d811061226457612264613f3b565b6020020151855190840261ffff160185526123b4565b600281600c81111561228e5761228e613fde565b14806122ab5750600581600c8111156122a9576122a9613fde565b145b806122c75750600881600c8111156122c5576122c5613fde565b145b806122e35750600b81600c8111156122e1576122e1613fde565b145b15612319578582600d81106122fa576122fa613f3b565b6020020151830261ffff168560200181815101915081815250506123b4565b600381600c81111561232d5761232d613fde565b148061234a5750600681600c81111561234857612348613fde565b145b806123665750600981600c81111561236457612364613fde565b145b806123825750600c81600c81111561238057612380613fde565b145b156123b4578582600d811061239957612399613f3b565b6020020151830261ffff168560400181815101915081815250505b505b60010161212a565b5060005b6009811015612602578581600981106123dd576123dd613f3b565b602002015160ff16156125fa5760008160088111156123fe576123fe613fde565b60055460405163e68c751960e01b81529192506001600160a01b03169063e68c75199061242f90849060040161443c565b602060405180830381865afa15801561244c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124709190614024565b9250600081600881111561248657612486613fde565b14806124a3575060038160088111156124a1576124a1613fde565b145b806124bf575060068160088111156124bd576124bd613fde565b145b156124f0578682600981106124d6576124d6613f3b565b6020020151855160ff909116840261ffff160185526125f8565b600181600881111561250457612504613fde565b14806125215750600481600881111561251f5761251f613fde565b145b8061253d5750600781600881111561253b5761253b613fde565b145b156125765786826009811061255457612554613f3b565b602002015160ff16830261ffff168560200181815101915081815250506125f8565b600281600881111561258a5761258a613fde565b14806125a7575060058160088111156125a5576125a5613fde565b145b806125c3575060088160088111156125c1576125c1613fde565b145b156125f8578682600981106125da576125da613f3b565b602002015160ff16830261ffff168560400181815101915081815250505b505b6001016123c2565b5091949350505050565b6126376040518060800160405280600081526020016000815260200160008152602001606081525090565b6005546040516292538760e11b815261ffff851660048201526000916001600160a01b031690630124a70e90602401602060405180830381865afa158015612683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126a79190614024565b90508061ffff16836000015111156126d7578061ffff16836000018181516126cf9190614450565b9052506126dc565b600083525b8061ffff168360200151111561270a578061ffff16836020018181516127029190614450565b905250612712565b600060208401525b8061ffff1683604001511115612740578061ffff16836040018181516127389190614450565b905250612748565b600060408401525b509092915050565b61277b6040518060800160405280600081526020016000815260200160008152602001606081525090565b60055460408051632999d5b960e11b815290516000926001600160a01b031691635333ab729160048083019260209291908290030181865afa1580156127c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e99190614024565b61ffff169050808360400151111561280357604083018190525b808360200151111561281757602083018190525b8251811015612824578083525b5090919050565b612833612fa7565b61285e6040518060800160405280600081526020016000815260200160008152602001606081525090565b600185600381111561287257612872613fde565b148015612883575085602001518911155b156128d15787518861289482614463565b61ffff1661ffff168152505060018860c0015184815181106128b8576128b8613f3b565b602002602001019060ff16908160ff1681525050612edc565b60028560038111156128e5576128e5613fde565b1480156128f55750856040015189115b8061291c5750600385600381111561290f5761290f613fde565b14801561291c5750855189115b15612e96576040880151875160009161293491614484565b60ff161115612e8a576040880180519061294d8261449d565b60ff169052506000805b6009811015612a0e578960200151816009811061297657612976613f3b565b602002015160ff168960600151826009811061299457612994613f3b565b602002015160ff161180156129eb575060008a6020015182600981106129bc576129bc613f3b565b60200201518a6060015183600981106129d7576129d7613f3b565b60200201516129e69190614484565b60ff16115b156129fe57816129fa81613f67565b9250505b612a0781613f67565b9050612957565b506000816001600160401b03811115612a2957612a29613319565b604051908082528060200260200182016040528015612a52578160200160208202803683370190505b5090506000805b6009811015612b2e578b602001518160098110612a7857612a78613f3b565b602002015160ff168b606001518260098110612a9657612a96613f3b565b602002015160ff16118015612aed575060008c602001518260098110612abe57612abe613f3b565b60200201518c606001518360098110612ad957612ad9613f3b565b6020020151612ae89190614484565b60ff16115b15612b1e5780838381518110612b0557612b05613f3b565b602090810291909101015281612b1a81613f67565b9250505b612b2781613f67565b9050612a59565b50600180546101608c01516040805160208101829052600d60608201526c535550504f52545f534849505f60981b6080808301919091528183018c90528251808303909101815260a082019283905263055f542360e41b90925260009488946001600160a01b0316936355f5423093612bae938f9390889060a4016144bc565b602060405180830381865afa158015612bcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bef9190613b81565b612bf991906144f2565b90506000805b85811015612c4c57808303612c3c57848181518110612c2057612c20613f3b565b60200260200101516008811115612c3957612c39613fde565b91505b612c4581613f67565b9050612bff565b508c60200151816008811115612c6457612c64613fde565b60ff1660098110612c7757612c77613f3b565b60200201805190612c878261449d565b60ff16905250806008811115612c9f57612c9f613fde565b8d60e001518981518110612cb557612cb5613f3b565b60ff9092166020928302919091019091015260055460405163e68c751960e01b81526000916001600160a01b03169063e68c751990612cf890859060040161443c565b602060405180830381865afa158015612d15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d399190614024565b90506000826008811115612d4f57612d4f613fde565b1480612d6c57506003826008811115612d6a57612d6a613fde565b145b80612d8857506006826008811115612d8657612d86613fde565b145b15612dab578061ffff168c600001818151612da39190614450565b905250612e7f565b6001826008811115612dbf57612dbf613fde565b1480612ddc57506004826008811115612dda57612dda613fde565b145b80612df857506007826008811115612df657612df6613fde565b145b15612e13578061ffff168c602001818151612da39190614450565b6002826008811115612e2757612e27613fde565b1480612e4457506005826008811115612e4257612e42613fde565b145b80612e6057506008826008811115612e5e57612e5e613fde565b145b15612e7f578061ffff168c604001818151612e7b9190614450565b9052505b505050505050612edc565b60646060890152612edc565b6001856003811115612eaa57612eaa613fde565b14612edc5760018860c001518481518110612ec757612ec7613f3b565b602002602001019060ff16908160ff16815250505b50959793965092945050505050565b604080516102408101825260008082526020820152908101612f0b61301e565b8152602001612f1861303d565b815260200160608152602001600061ffff168152602001600061ffff168152602001600061ffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016060815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b031681525090565b604051806101000160405280600061ffff168152602001612fc661303d565b8152602001600060ff168152602001600060ff168152602001600061ffff1681526020016060815260200160608152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b604051806101a00160405280600d906020820280368337509192915050565b6040518061012001604052806009906020820280368337509192915050565b6001600160a01b038116811461180257600080fd5b803561307c8161305c565b919050565b60008060006060848603121561309657600080fd5b83356130a18161305c565b92506020840135915060408401356130b88161305c565b809150509250925092565b8060005b600d8110156130ea57815161ffff168452602093840193909101906001016130c7565b50505050565b8060005b60098110156130ea57815160ff168452602093840193909101906001016130f4565b600081518084526020808501945080840160005b8381101561314957815160ff168752958201959082019060010161312a565b509495945050505050565b60005b8381101561316f578181015183820152602001613157565b50506000910152565b60008151808452613190816020860160208601613154565b601f01601f19169290920160200192915050565b602081526131b860208201835160ff169052565b600060208301516131cf604084018261ffff169052565b5060408301516131e260608401826130c3565b5060608301516102006131f7818501836130f0565b608085015191506104c0806103208601526132166104e0860184613116565b925060a086015161322e61034087018261ffff169052565b5060c086015161ffff90811661036087015260e0870151166103808601526101008601516103a08601526101208601516103c08601526101408601516103e08601526101608601516104008601526101808601516104208601526101a08601516104408601526101c0860151858403601f19016104608701526132b18482613178565b9350506101e08601516132d06104808701826001600160a01b03169052565b50908501516001600160a01b039081166104a08601526102209095015190941692909301919091525090565b60006020828403121561330e57600080fd5b81356105518161305c565b634e487b7160e01b600052604160045260246000fd5b60405161024081016001600160401b038111828210171561335257613352613319565b60405290565b60405160c081016001600160401b038111828210171561335257613352613319565b6040516101a081016001600160401b038111828210171561335257613352613319565b60405161012081016001600160401b038111828210171561335257613352613319565b60405160e081016001600160401b038111828210171561335257613352613319565b60405161010081016001600160401b038111828210171561335257613352613319565b604051601f8201601f191681016001600160401b038111828210171561342d5761342d613319565b604052919050565b60ff8116811461180257600080fd5b803561307c81613435565b61ffff8116811461180257600080fd5b803561307c8161344f565b600082601f83011261347b57600080fd5b61348361337a565b806101a084018581111561349657600080fd5b845b818110156134b95780356134ab8161344f565b845260209384019301613498565b509095945050505050565b600082601f8301126134d557600080fd5b6134dd61339d565b806101208401858111156134f057600080fd5b845b818110156134b957803561350581613435565b8452602093840193016134f2565b60006001600160401b0382111561352c5761352c613319565b5060051b60200190565b600082601f83011261354757600080fd5b8135602061355c61355783613513565b613405565b82815260059290921b8401810191818101908684111561357b57600080fd5b8286015b8481101561359f57803561359281613435565b835291830191830161357f565b509695505050505050565b60006001600160401b038211156135c3576135c3613319565b50601f01601f191660200190565b600082601f8301126135e257600080fd5b81356135f0613557826135aa565b81815284602083860101111561360557600080fd5b816020850160208301376000918101602001919091529392505050565b60006104c0828403121561363557600080fd5b61363d61332f565b905061364882613444565b81526136566020830161345f565b6020820152613668836040840161346a565b60408201526101e061367c848285016134c4565b60608301526103008301356001600160401b038082111561369c57600080fd5b6136a886838701613536565b60808501526136ba610320860161345f565b60a08501526136cc610340860161345f565b60c08501526136de610360860161345f565b60e08501526103808501356101008501526103a08501356101208501526103c08501356101408501526103e08501356101608501526104008501356101808501526104208501356101a085015261044085013591508082111561374057600080fd5b5061374d858286016135d1565b6101c0840152506137616104608401613071565b908201526137726104808301613071565b6102008201526137856104a08301613071565b61022082015292915050565b600060c082840312156137a357600080fd5b6137ab613358565b90506137b68261345f565b81526137c460208301613444565b602082015260408201356001600160401b03808211156137e357600080fd5b6137ef85838601613536565b6040840152606084013560608401526080840135608084015260a084013591508082111561381c57600080fd5b50613829848285016135d1565b60a08301525092915050565b60008060008060008060c0878903121561384e57600080fd5b86356001600160401b038082111561386557600080fd5b6138718a838b01613622565b9750602089013591508082111561388757600080fd5b6138938a838b01613622565b965060408901359150808211156138a957600080fd5b6138b58a838b01613622565b955060608901359150808211156138cb57600080fd5b506138d889828a01613791565b935050608087013591506138ee60a08801613071565b90509295509295509295565b6000806040838503121561390d57600080fd5b82356139188161305c565b9150602083013561392881613435565b809150509250929050565b60008060006060848603121561394857600080fd5b833592506020840135915060408401356130b88161305c565b60008060006060848603121561397657600080fd5b83356001600160401b038082111561398d57600080fd5b61399987838801613622565b945060208601359150808211156139af57600080fd5b506139bc86828701613536565b925050604084013590509250925092565b600081518084526020808501945080840160005b8381101561314957815161ffff16875295820195908201906001016139e1565b60208152613a1660208201835161ffff169052565b60006020830151613a2a60408401826130f0565b50604083015160ff908116610160840152606084015116610180830152608083015161ffff166101a083015260a08301516102006101c08401819052613a746102208501836139cd565b915060c0850151601f1980868503016101e0870152613a938483613116565b935060e0870151915080868503018387015250613ab08382613116565b9695505050505050565b600080600060608486031215613acf57600080fd5b8335613ada8161305c565b925060208401356001600160401b03811115613af557600080fd5b613b0186828701613622565b92505060408401356130b88161305c565b60008060408385031215613b2557600080fd5b8235613b308161305c565b915060208301356139288161305c565b60008060008060808587031215613b5657600080fd5b8435935060208501359250604085013591506060850135613b768161305c565b939692955090935050565b600060208284031215613b9357600080fd5b5051919050565b6001600160a01b039390931683526020830191909152604082015260600190565b805161307c81613435565b805161307c8161344f565b600082601f830112613be257600080fd5b613bea61337a565b806101a0840185811115613bfd57600080fd5b845b818110156134b9578051613c128161344f565b845260209384019301613bff565b600082601f830112613c3157600080fd5b613c3961339d565b80610120840185811115613c4c57600080fd5b845b818110156134b9578051613c6181613435565b845260209384019301613c4e565b600082601f830112613c8057600080fd5b81516020613c9061355783613513565b82815260059290921b84018101918181019086841115613caf57600080fd5b8286015b8481101561359f578051613cc681613435565b8352918301918301613cb3565b6000613ce1613557846135aa565b9050828152838383011115613cf557600080fd5b610551836020830184613154565b600082601f830112613d1457600080fd5b61055183835160208501613cd3565b805161307c8161305c565b60006020808385031215613d4157600080fd5b82516001600160401b0380821115613d5857600080fd5b818501915085601f830112613d6c57600080fd5b8151613d7a61355782613513565b81815260059190911b83018401908481019088831115613d9957600080fd5b8585015b83811015613f2e57805185811115613db55760008081fd5b86016104c0818c03601f1901811315613dce5760008081fd5b613dd661332f565b613de18a8401613bbb565b81526040613df0818501613bc6565b8b8301526060613e028f828701613bd1565b828401526102009150613e178f838701613c20565b9083015261032084015189811115613e2f5760008081fd5b613e3d8f8d83880101613c6f565b608084015250613e506103408501613bc6565b60a0830152613e626103608501613bc6565b60c0830152613e746103808501613bc6565b60e08301526103a08401516101008301526103c08401516101208301526103e08401516101408301526104008401516101608301526104208401516101808301526104408401516101a083015261046084015189811115613ed55760008081fd5b613ee38f8d83880101613d03565b6101c084015250613ef76104808501613d23565b6101e0830152613f0a6104a08501613d23565b90820152613f19838301613d23565b61022082015285525050918601918601613d9d565b5098975050505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201613f7957613f79613f51565b5060010190565b600060e08284031215613f9257600080fd5b82601f830112613fa157600080fd5b613fa96133c0565b8060e0840185811115613fbb57600080fd5b845b818110156134b9578051613fd081613435565b845260209384019301613fbd565b634e487b7160e01b600052602160045260246000fd5b808201808211156120f4576120f4613f51565b60006020828403121561401957600080fd5b815161055181613435565b60006020828403121561403657600080fd5b81516105518161344f565b85815284602082015260a06040820152600061406060a0830186613178565b905083606083015261ffff831660808301529695505050505050565b60208101600d831061409057614090613fde565b91905290565b600082601f8301126140a757600080fd5b604051606081018181106001600160401b03821117156140c9576140c9613319565b6040528060608401858111156140de57600080fd5b845b818110156141015780516140f38161344f565b8352602092830192016140e0565b509195945050505050565b6000806080838503121561411f57600080fd5b82516001600160401b038082111561413657600080fd5b8185019150601f868184011261414b57600080fd5b6141536133e2565b8061010085018981111561416657600080fd5b855b818110156141b2578051868111156141805760008081fd5b87018581018c136141915760008081fd5b805160206141a28e83838601613cd3565b8752909501945050602001614168565b505080965050505050506141c98460208501614096565b90509250929050565b85815284602082015260a0604082015260006141f160a0830186613178565b606083019490945250608001529392505050565b805163ffffffff8116811461307c57600080fd5b8051801515811461307c57600080fd5b80516001600160401b038116811461307c57600080fd5b600061010080838503121561425457600080fd5b604051908101906001600160401b038211818310171561427657614276613319565b8160405261428384614205565b815261429160208501614219565b6020820152604084015191506142a68261305c565b8160408201526142b860608501614205565b60608201526142c960808501613d23565b60808201526142da60a08501614229565b60a08201526142eb60c08501614229565b60c082015260e084015160e0820152809250505092915050565b60006020828403121561431757600080fd5b61055182614219565b80820281158282048414176120f4576120f4613f51565b634e487b7160e01b600052601260045260246000fd5b60008261435c5761435c614337565b500490565b60006040828403121561437357600080fd5b82601f83011261438257600080fd5b604051604081018181106001600160401b03821117156143a4576143a4613319565b80604052508060408401858111156143bb57600080fd5b845b818110156141015780516143d08161344f565b8352602092830192016143bd565b600060e082840312156143f057600080fd5b82601f8301126143ff57600080fd5b6144076133c0565b8060e084018581111561441957600080fd5b845b818110156134b957805161442e8161344f565b84526020938401930161441b565b602081016009831061409057614090613fde565b818103818111156120f4576120f4613f51565b600061ffff80831681810361447a5761447a613f51565b6001019392505050565b60ff82811682821603908111156120f4576120f4613f51565b600060ff821660ff81036144b3576144b3613f51565b60010192915050565b85815284602082015260a0604082015260006144db60a0830186613178565b60ff94909416606083015250608001529392505050565b60008261450157614501614337565b50069056fea164736f6c6343000811000a

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80637ecebe00116100de578063bc89416911610097578063e533627611610071578063e5336276146103a6578063f0514d49146103b9578063f2fde38b146103cc578063f4fe46a2146103df57600080fd5b8063bc89416914610350578063c5e815c714610370578063c8ff2c921461039357600080fd5b80637ecebe00146102c55780638da5cb5b146102f35780639f33d88114610304578063a225632614610317578063b0aa111b1461032a578063b7297cf31461033d57600080fd5b80634cb5bca81161014b57806362c2fd6b1161012557806362c2fd6b14610284578063647aba3014610297578063715018a6146102aa578063797f87ba146102b257600080fd5b80634cb5bca8146102495780635ec01e4d1461025e57806361d027b31461027157600080fd5b80630745742a1461019357806308b59f57146101bc5780632baf4596146101e757806331891228146101fa5780633c2f22bc146102235780634054eaa414610236575b600080fd5b6101a66101a1366004613081565b6103f2565b6040516101b391906131a4565b60405180910390f35b600c546101cf906001600160a01b031681565b6040516001600160a01b0390911681526020016101b3565b600a546101cf906001600160a01b031681565b6101cf6102083660046132fc565b600d602052600090815260409020546001600160a01b031681565b6002546101cf906001600160a01b031681565b6007546101cf906001600160a01b031681565b61025c610257366004613835565b610558565b005b6001546101cf906001600160a01b031681565b600b546101cf906001600160a01b031681565b6003546101cf906001600160a01b031681565b6004546101cf906001600160a01b031681565b61025c6107f7565b6009546101cf906001600160a01b031681565b6102e56102d33660046132fc565b600e6020526000908152604090205481565b6040519081526020016101b3565b6000546001600160a01b03166101cf565b61025c6103123660046138fa565b61080b565b61025c610325366004613933565b610a30565b6101a6610338366004613081565b610dd5565b6005546101cf906001600160a01b031681565b61036361035e366004613961565b610f20565b6040516101b39190613a01565b61038361037e366004613aba565b611456565b60405190151581526020016101b3565b6008546101cf906001600160a01b031681565b6006546101cf906001600160a01b031681565b61025c6103c7366004613b12565b61171d565b61025c6103da3660046132fc565b61178c565b61025c6103ed366004613b40565b611805565b6103fa612eeb565b6000600760009054906101000a90046001600160a01b03166001600160a01b0316637bc53f3e866000866001600160a01b03166307c560016040518163ffffffff1660e01b8152600401602060405180830381865afa158015610461573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104859190613b81565b6040518463ffffffff1660e01b81526004016104a393929190613b9a565b600060405180830381865afa1580156104c0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104e89190810190613d2e565b905060005b815181101561054e578482828151811061050957610509613f3b565b602002602001015161010001510361053e5781818151811061052d5761052d613f3b565b602002602001015192505050610551565b61054781613f67565b90506104ed565b50505b9392505050565b61014084015160405163a3df934f60e01b815260048101919091526001600160a01b0382169063a3df934f9060240160e060405180830381865afa1580156105a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c89190613f80565b5160ff166064146105ec57604051631f6de81d60e21b815260040160405180910390fd5b61010086015115610618576040516328d7be8d60e11b8152600160048201526024015b60405180910390fd5b6101008501511561063f576040516328d7be8d60e11b81526002600482015260240161060f565b6000805b600d8110156106af576000866040015182600d811061066457610664613f3b565b602002015161ffff16111561069f57856040015181600d811061068957610689613f3b565b602002015161069c9061ffff1683613ff4565b91505b6106a881613f67565b9050610643565b50600554845160405163058c9e0560e01b815261ffff90911660048201526001600160a01b039091169063058c9e0590602401602060405180830381865afa1580156106ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107239190613b81565b81111561074657604051632473a0d360e11b81526001600482015260240161060f565b60055484516040516321c4e01760e01b815261ffff90911660048201526001600160a01b03909116906321c4e01790602401602060405180830381865afa158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b99190614007565b60ff168311806107cd5750845160ff168314155b156107ee576040516328d7be8d60e11b81526003600482015260240161060f565b50505050505050565b6107ff611c6f565b6108096000611cc9565b565b610813611c6f565b8060ff1660010361083e57600180546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660020361086957600280546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660030361089457600380546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff166004036108bf57600580546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff166005036108ea57600480546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660060361091557600980546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660070361094057600780546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660080361096b57600880546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff1660090361099657600b80546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff16600a036109c157600c80546001600160a01b0319166001600160a01b0384161790556109e8565b8060ff16600b036109e857600a80546001600160a01b0319166001600160a01b0384161790555b6040805160ff831681526001600160a01b03841660208201527fd58da2325ce084e36b92ea4c1a90706ffa665d07ec064f887de9dbb8f15f4995910160405180910390a15050565b600c546001600160a01b03163314801590610a5657506000546001600160a01b03163314155b15610a73576040516282b42960e81b815260040160405180910390fd5b6000826001600160401b03811115610a8d57610a8d613319565b604051908082528060200260200182016040528015610ab6578160200160208202803683370190505b50905060005b83811015610cab576001546001600160a01b038481166000908152600e602052604081208054919392909216916355f5423091899185610afb83613f67565b90915550604080516020810182905260096060820152684c4f434b5f424f585f60b81b608082015290810187905260a00160408051601f198184030181528282526005546309c9dcb160e01b8452915190926000926001600160a01b0316916309c9dcb1916004808201926020929091908290030181865afa158015610b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba99190614024565b6040518663ffffffff1660e01b8152600401610bc9959493929190614041565b602060405180830381865afa158015610be6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0a9190613b81565b9050836001600160a01b03167f8e7792cc94f9d8cc0ee7971f922d5f561e7dcca1ce9e8d1b666d7377d777f73182604051610c4791815260200190565b60405180910390a2610c5881611d19565b838381518110610c6a57610c6a613f3b565b6020026020010190600c811115610c8357610c83613fde565b9081600c811115610c9657610c96613fde565b905250610ca4905081613f67565b9050610abc565b5060005b83811015610dce576000828281518110610ccb57610ccb613f3b565b602002602001015190506000600c811115610ce857610ce8613fde565b81600c811115610cfa57610cfa613fde565b03610d055750610dbe565b6003546001600160a01b031663156e29f68583600c811115610d2957610d29613fde565b60016040518463ffffffff1660e01b8152600401610d4993929190613b9a565b600060405180830381600087803b158015610d6357600080fd5b505af1158015610d77573d6000803e3d6000fd5b50505050836001600160a01b03167f363c1ce153bd4ee16fa06d5456b2b65bfbe89a83c25a18c0c8e435b403f4f4fe82604051610db4919061407c565b60405180910390a2505b610dc781613f67565b9050610caf565b5050505050565b610ddd612eeb565b6000600760009054906101000a90046001600160a01b03166001600160a01b0316639b610b0a866000866001600160a01b03166307c560016040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e689190613b81565b6040518463ffffffff1660e01b8152600401610e8693929190613b9a565b600060405180830381865afa158015610ea3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ecb9190810190613d2e565b905060005b815181101561054e5784828281518110610eec57610eec613f3b565b6020026020010151610100015103610f105781818151811061052d5761052d613f3b565b610f1981613f67565b9050610ed0565b610f28612fa7565b610f30613000565b6102008501516001600160a01b039081166000908152600d6020526040902054168015610fd7576101208601516040516306814e3960e31b815261ffff90911660048201526001600160a01b0382169063340a71c890602401600060405180830381865afa158015610fa6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fce919081019061410c565b9250610fe99050565b60968083526020830181905260408301525b6110146040518060800160405280600081526020016000815260200160008152602001606081525090565b825161ffff1660000361103d576040516328d7be8d60e11b81526006600482015260240161060f565b825160208201805161ffff909216909101905282600160200201516040828101805161ffff93841601905284810151835192169091018252610220880151610140890151915163a3df934f60e01b815260048101929092526110f5916001600160a01b039091169063a3df934f9060240160e060405180830381865afa1580156110cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ef9190613f80565b82611df9565b905061110a87606001518860400151836120fa565b9050611114612fa7565b6005546040805163dc5fa7ab60e01b815290516000926001600160a01b03169163dc5fa7ab9160048083019260209291908290030181865afa15801561115e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111829190614024565b61ffff16905087516001600160401b038111156111a1576111a1613319565b6040519080825280602002602001820160405280156111ca578160200160208202803683370190505b5060c083015287516001600160401b038111156111e9576111e9613319565b604051908082528060200260200182016040528015611212578160200160208202803683370190505b5060a083015287516001600160401b0381111561123157611231613319565b60405190808252806020026020018201604052801561125a578160200160208202803683370190505b5060e0830152602089015161126f908461260c565b925061127a83612750565b925060005b885181101561144857600089828151811061129c5761129c613f3b565b602002602001015160ff1660038111156112b8576112b8613fde565b905060008160038111156112ce576112ce613fde565b14806112e15750836060015160ff166064145b156112fb575060808301805160010161ffff169052611440565b6101008b0151604051611361918491602001608080825260139082015272494e544552414354494f4e5f524553554c545f60681b60a0820152602081019290925260c060408301819052600190830152605f60f81b60e083015260608201526101000190565b60408051601f19818403018152918152606087018290526001546101608e0151915163055f542360e41b81526000936001600160a01b03909216926355f54230926113b6928f92919087908b906004016141d2565b602060405180830381865afa1580156113d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f79190613b81565b905061140881868e89868f8961282b565b8097508196505050808560a00151848151811061142757611427613f3b565b602002602001019061ffff16908161ffff168152505050505b60010161127f565b509098975050505050505050565b600a546101208301516040516353a901bf60e11b815260009283926001600160a01b039091169163a752037e916114939160040190815260200190565b61010060405180830381865afa1580156114b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d59190614240565b600a5461014086015160405163608ad89160e01b81529293506000926001600160a01b039092169163608ad891916115139160040190815260200190565b61010060405180830381865afa158015611531573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115559190614240565b60408301519091506001600160a01b031615158061157f575060408101516001600160a01b031615155b156116ff57600a548251604051634fb09c1560e11b815263ffffffff90911660048201526001600160a01b0390911690639f61382a90602401602060405180830381865afa1580156115d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115f99190614305565b801561161a5750856001600160a01b031682608001516001600160a01b0316145b8061163a5750856001600160a01b031682604001516001600160a01b0316145b806116d65750600a54815160405163f1c12e8360e01b815263ffffffff90911660048201526001600160a01b039091169063f1c12e8390602401602060405180830381865afa158015611691573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b59190614305565b80156116d65750856001600160a01b031681608001516001600160a01b0316145b806116f65750856001600160a01b031681604001516001600160a01b0316145b92505050610551565b836001600160a01b0316866001600160a01b03161492505050610551565b611725611c6f565b6001600160a01b038281166000818152600d602090815260409182902080546001600160a01b0319169486169485179055905192835290917fb8fe955c54b89d88fb80eead555ff305d6cf025b2ebe917b38b1e7282592b9f6910160405180910390a25050565b611794611c6f565b6001600160a01b0381166117f95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161060f565b61180281611cc9565b50565b600c546001600160a01b0316331480159061182b57506000546001600160a01b03163314155b15611848576040516282b42960e81b815260040160405180910390fd5b600554604051631df5e93560e01b8152600481018490526000916001600160a01b031690631df5e93590602401602060405180830381865afa158015611892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b69190613b81565b9050600080805b86811015611a11576001546001600160a01b038681166000908152600e602052604081208054919392909216916355f54230918c91856118fc83613f67565b909155506040805160208101829052600d60608201526c524557415244535f545950455f60981b608082015290810187905260a00160405160208183030381529060405260006127106040518663ffffffff1660e01b81526004016119659594939291906141d2565b602060405180830381865afa158015611982573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a69190613b81565b9050856001600160a01b03167f455cdc926e241c130ef73b19f38723a632ef3ce7e4b2f5e563b6dabfd87fbcb0826040516119e391815260200190565b60405180910390a2848111611a0057836119fc81613f67565b9450505b50611a0a81613f67565b90506118bd565b50600554604051632532304160e21b81526004810187905287916001600160a01b0316906394c8c10490602401602060405180830381865afa158015611a5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a7f9190613b81565b611a899190614320565b90508015611bb75760085460405163160493e760e01b81526001600160a01b038681166004830152602482018490529091169063160493e790604401600060405180830381600087803b158015611adf57600080fd5b505af1158015611af3573d6000803e3d6000fd5b5050505060006064826005611b089190614320565b611b12919061434d565b600854600b5460405163160493e760e01b81526001600160a01b03918216600482015260248101849052929350169063160493e790604401600060405180830381600087803b158015611b6457600080fd5b505af1158015611b78573d6000803e3d6000fd5b505050507f715f224bde15d12b6a2a3fc1a65c87cae96f02f715a0d38cc3409776a462c54781604051611bad91815260200190565b60405180910390a1505b81156107ee57600954604051630ab714fb60e11b81526001600160a01b039091169063156e29f690611bf190879060049087908201613b9a565b600060405180830381600087803b158015611c0b57600080fd5b505af1158015611c1f573d6000803e3d6000fd5b50505050836001600160a01b03167f1b2d624122656c0cbbf3659d7b3dcaf0baea306d057563681987029962c869e583604051611c5e91815260200190565b60405180910390a250505050505050565b6000546001600160a01b031633146108095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060015b600c8111611df0576005546000906001600160a01b0316632e06b2c183600c811115611d4c57611d4c613fde565b6040518263ffffffff1660e01b8152600401611d68919061407c565b6040805180830381865afa158015611d84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da89190614361565b805190915061ffff168410801590611dc85750602081015161ffff168411155b15611de75781600c811115611ddf57611ddf613fde565b949350505050565b50600101611d1e565b50600092915050565b611e246040518060800160405280600081526020016000815260200160008152602001606081525090565b6005546040805163017ba3c160e71b815290516000926001600160a01b03169163bdd1e0809160048083019260e09291908290030181865afa158015611e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9291906143de565b90506000600560009054906101000a90046001600160a01b03166001600160a01b031663904b33d36040518163ffffffff1660e01b815260040160e060405180830381865afa158015611ee9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0d9190613f80565b90506000600560009054906101000a90046001600160a01b03166001600160a01b0316638601b2296040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f889190614024565b60208601805161ffff92909216918201905260408601805182019052855181018652905060005b60078110156120ec576000838260078110611fcc57611fcc613f3b565b602002015160ff160361201f57868160078110611feb57611feb613f3b565b602002015160ff1684826007811061200557612005613f3b565b60200201510261ffff168660200181815101915081815250505b600283826007811061203357612033613f3b565b602002015160ff16036120865786816007811061205257612052613f3b565b602002015160ff1684826007811061206c5761206c613f3b565b60200201510261ffff168660400181815101915081815250505b600183826007811061209a5761209a613f3b565b602002015160ff16036120e4578681600781106120b9576120b9613f3b565b602002015160ff168482600781106120d3576120d3613f3b565b60200201518751910261ffff160186525b600101611faf565b508493505050505b92915050565b6121256040518060800160405280600081526020016000815260200160008152602001606081525090565b600060015b600d8110156123be57600081600c81111561214757612147613fde565b90508582600d811061215b5761215b613f3b565b602002015161ffff1660000361217157506123b6565b600554604051637bc3a0cb60e01b81526001600160a01b0390911690637bc3a0cb906121a190849060040161407c565b602060405180830381865afa1580156121be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e29190614024565b9250600181600c8111156121f8576121f8613fde565b14806122155750600481600c81111561221357612213613fde565b145b806122315750600781600c81111561222f5761222f613fde565b145b8061224d5750600a81600c81111561224b5761224b613fde565b145b1561227a578582600d811061226457612264613f3b565b6020020151855190840261ffff160185526123b4565b600281600c81111561228e5761228e613fde565b14806122ab5750600581600c8111156122a9576122a9613fde565b145b806122c75750600881600c8111156122c5576122c5613fde565b145b806122e35750600b81600c8111156122e1576122e1613fde565b145b15612319578582600d81106122fa576122fa613f3b565b6020020151830261ffff168560200181815101915081815250506123b4565b600381600c81111561232d5761232d613fde565b148061234a5750600681600c81111561234857612348613fde565b145b806123665750600981600c81111561236457612364613fde565b145b806123825750600c81600c81111561238057612380613fde565b145b156123b4578582600d811061239957612399613f3b565b6020020151830261ffff168560400181815101915081815250505b505b60010161212a565b5060005b6009811015612602578581600981106123dd576123dd613f3b565b602002015160ff16156125fa5760008160088111156123fe576123fe613fde565b60055460405163e68c751960e01b81529192506001600160a01b03169063e68c75199061242f90849060040161443c565b602060405180830381865afa15801561244c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124709190614024565b9250600081600881111561248657612486613fde565b14806124a3575060038160088111156124a1576124a1613fde565b145b806124bf575060068160088111156124bd576124bd613fde565b145b156124f0578682600981106124d6576124d6613f3b565b6020020151855160ff909116840261ffff160185526125f8565b600181600881111561250457612504613fde565b14806125215750600481600881111561251f5761251f613fde565b145b8061253d5750600781600881111561253b5761253b613fde565b145b156125765786826009811061255457612554613f3b565b602002015160ff16830261ffff168560200181815101915081815250506125f8565b600281600881111561258a5761258a613fde565b14806125a7575060058160088111156125a5576125a5613fde565b145b806125c3575060088160088111156125c1576125c1613fde565b145b156125f8578682600981106125da576125da613f3b565b602002015160ff16830261ffff168560400181815101915081815250505b505b6001016123c2565b5091949350505050565b6126376040518060800160405280600081526020016000815260200160008152602001606081525090565b6005546040516292538760e11b815261ffff851660048201526000916001600160a01b031690630124a70e90602401602060405180830381865afa158015612683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126a79190614024565b90508061ffff16836000015111156126d7578061ffff16836000018181516126cf9190614450565b9052506126dc565b600083525b8061ffff168360200151111561270a578061ffff16836020018181516127029190614450565b905250612712565b600060208401525b8061ffff1683604001511115612740578061ffff16836040018181516127389190614450565b905250612748565b600060408401525b509092915050565b61277b6040518060800160405280600081526020016000815260200160008152602001606081525090565b60055460408051632999d5b960e11b815290516000926001600160a01b031691635333ab729160048083019260209291908290030181865afa1580156127c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e99190614024565b61ffff169050808360400151111561280357604083018190525b808360200151111561281757602083018190525b8251811015612824578083525b5090919050565b612833612fa7565b61285e6040518060800160405280600081526020016000815260200160008152602001606081525090565b600185600381111561287257612872613fde565b148015612883575085602001518911155b156128d15787518861289482614463565b61ffff1661ffff168152505060018860c0015184815181106128b8576128b8613f3b565b602002602001019060ff16908160ff1681525050612edc565b60028560038111156128e5576128e5613fde565b1480156128f55750856040015189115b8061291c5750600385600381111561290f5761290f613fde565b14801561291c5750855189115b15612e96576040880151875160009161293491614484565b60ff161115612e8a576040880180519061294d8261449d565b60ff169052506000805b6009811015612a0e578960200151816009811061297657612976613f3b565b602002015160ff168960600151826009811061299457612994613f3b565b602002015160ff161180156129eb575060008a6020015182600981106129bc576129bc613f3b565b60200201518a6060015183600981106129d7576129d7613f3b565b60200201516129e69190614484565b60ff16115b156129fe57816129fa81613f67565b9250505b612a0781613f67565b9050612957565b506000816001600160401b03811115612a2957612a29613319565b604051908082528060200260200182016040528015612a52578160200160208202803683370190505b5090506000805b6009811015612b2e578b602001518160098110612a7857612a78613f3b565b602002015160ff168b606001518260098110612a9657612a96613f3b565b602002015160ff16118015612aed575060008c602001518260098110612abe57612abe613f3b565b60200201518c606001518360098110612ad957612ad9613f3b565b6020020151612ae89190614484565b60ff16115b15612b1e5780838381518110612b0557612b05613f3b565b602090810291909101015281612b1a81613f67565b9250505b612b2781613f67565b9050612a59565b50600180546101608c01516040805160208101829052600d60608201526c535550504f52545f534849505f60981b6080808301919091528183018c90528251808303909101815260a082019283905263055f542360e41b90925260009488946001600160a01b0316936355f5423093612bae938f9390889060a4016144bc565b602060405180830381865afa158015612bcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bef9190613b81565b612bf991906144f2565b90506000805b85811015612c4c57808303612c3c57848181518110612c2057612c20613f3b565b60200260200101516008811115612c3957612c39613fde565b91505b612c4581613f67565b9050612bff565b508c60200151816008811115612c6457612c64613fde565b60ff1660098110612c7757612c77613f3b565b60200201805190612c878261449d565b60ff16905250806008811115612c9f57612c9f613fde565b8d60e001518981518110612cb557612cb5613f3b565b60ff9092166020928302919091019091015260055460405163e68c751960e01b81526000916001600160a01b03169063e68c751990612cf890859060040161443c565b602060405180830381865afa158015612d15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d399190614024565b90506000826008811115612d4f57612d4f613fde565b1480612d6c57506003826008811115612d6a57612d6a613fde565b145b80612d8857506006826008811115612d8657612d86613fde565b145b15612dab578061ffff168c600001818151612da39190614450565b905250612e7f565b6001826008811115612dbf57612dbf613fde565b1480612ddc57506004826008811115612dda57612dda613fde565b145b80612df857506007826008811115612df657612df6613fde565b145b15612e13578061ffff168c602001818151612da39190614450565b6002826008811115612e2757612e27613fde565b1480612e4457506005826008811115612e4257612e42613fde565b145b80612e6057506008826008811115612e5e57612e5e613fde565b145b15612e7f578061ffff168c604001818151612e7b9190614450565b9052505b505050505050612edc565b60646060890152612edc565b6001856003811115612eaa57612eaa613fde565b14612edc5760018860c001518481518110612ec757612ec7613f3b565b602002602001019060ff16908160ff16815250505b50959793965092945050505050565b604080516102408101825260008082526020820152908101612f0b61301e565b8152602001612f1861303d565b815260200160608152602001600061ffff168152602001600061ffff168152602001600061ffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016060815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b031681525090565b604051806101000160405280600061ffff168152602001612fc661303d565b8152602001600060ff168152602001600060ff168152602001600061ffff1681526020016060815260200160608152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b604051806101a00160405280600d906020820280368337509192915050565b6040518061012001604052806009906020820280368337509192915050565b6001600160a01b038116811461180257600080fd5b803561307c8161305c565b919050565b60008060006060848603121561309657600080fd5b83356130a18161305c565b92506020840135915060408401356130b88161305c565b809150509250925092565b8060005b600d8110156130ea57815161ffff168452602093840193909101906001016130c7565b50505050565b8060005b60098110156130ea57815160ff168452602093840193909101906001016130f4565b600081518084526020808501945080840160005b8381101561314957815160ff168752958201959082019060010161312a565b509495945050505050565b60005b8381101561316f578181015183820152602001613157565b50506000910152565b60008151808452613190816020860160208601613154565b601f01601f19169290920160200192915050565b602081526131b860208201835160ff169052565b600060208301516131cf604084018261ffff169052565b5060408301516131e260608401826130c3565b5060608301516102006131f7818501836130f0565b608085015191506104c0806103208601526132166104e0860184613116565b925060a086015161322e61034087018261ffff169052565b5060c086015161ffff90811661036087015260e0870151166103808601526101008601516103a08601526101208601516103c08601526101408601516103e08601526101608601516104008601526101808601516104208601526101a08601516104408601526101c0860151858403601f19016104608701526132b18482613178565b9350506101e08601516132d06104808701826001600160a01b03169052565b50908501516001600160a01b039081166104a08601526102209095015190941692909301919091525090565b60006020828403121561330e57600080fd5b81356105518161305c565b634e487b7160e01b600052604160045260246000fd5b60405161024081016001600160401b038111828210171561335257613352613319565b60405290565b60405160c081016001600160401b038111828210171561335257613352613319565b6040516101a081016001600160401b038111828210171561335257613352613319565b60405161012081016001600160401b038111828210171561335257613352613319565b60405160e081016001600160401b038111828210171561335257613352613319565b60405161010081016001600160401b038111828210171561335257613352613319565b604051601f8201601f191681016001600160401b038111828210171561342d5761342d613319565b604052919050565b60ff8116811461180257600080fd5b803561307c81613435565b61ffff8116811461180257600080fd5b803561307c8161344f565b600082601f83011261347b57600080fd5b61348361337a565b806101a084018581111561349657600080fd5b845b818110156134b95780356134ab8161344f565b845260209384019301613498565b509095945050505050565b600082601f8301126134d557600080fd5b6134dd61339d565b806101208401858111156134f057600080fd5b845b818110156134b957803561350581613435565b8452602093840193016134f2565b60006001600160401b0382111561352c5761352c613319565b5060051b60200190565b600082601f83011261354757600080fd5b8135602061355c61355783613513565b613405565b82815260059290921b8401810191818101908684111561357b57600080fd5b8286015b8481101561359f57803561359281613435565b835291830191830161357f565b509695505050505050565b60006001600160401b038211156135c3576135c3613319565b50601f01601f191660200190565b600082601f8301126135e257600080fd5b81356135f0613557826135aa565b81815284602083860101111561360557600080fd5b816020850160208301376000918101602001919091529392505050565b60006104c0828403121561363557600080fd5b61363d61332f565b905061364882613444565b81526136566020830161345f565b6020820152613668836040840161346a565b60408201526101e061367c848285016134c4565b60608301526103008301356001600160401b038082111561369c57600080fd5b6136a886838701613536565b60808501526136ba610320860161345f565b60a08501526136cc610340860161345f565b60c08501526136de610360860161345f565b60e08501526103808501356101008501526103a08501356101208501526103c08501356101408501526103e08501356101608501526104008501356101808501526104208501356101a085015261044085013591508082111561374057600080fd5b5061374d858286016135d1565b6101c0840152506137616104608401613071565b908201526137726104808301613071565b6102008201526137856104a08301613071565b61022082015292915050565b600060c082840312156137a357600080fd5b6137ab613358565b90506137b68261345f565b81526137c460208301613444565b602082015260408201356001600160401b03808211156137e357600080fd5b6137ef85838601613536565b6040840152606084013560608401526080840135608084015260a084013591508082111561381c57600080fd5b50613829848285016135d1565b60a08301525092915050565b60008060008060008060c0878903121561384e57600080fd5b86356001600160401b038082111561386557600080fd5b6138718a838b01613622565b9750602089013591508082111561388757600080fd5b6138938a838b01613622565b965060408901359150808211156138a957600080fd5b6138b58a838b01613622565b955060608901359150808211156138cb57600080fd5b506138d889828a01613791565b935050608087013591506138ee60a08801613071565b90509295509295509295565b6000806040838503121561390d57600080fd5b82356139188161305c565b9150602083013561392881613435565b809150509250929050565b60008060006060848603121561394857600080fd5b833592506020840135915060408401356130b88161305c565b60008060006060848603121561397657600080fd5b83356001600160401b038082111561398d57600080fd5b61399987838801613622565b945060208601359150808211156139af57600080fd5b506139bc86828701613536565b925050604084013590509250925092565b600081518084526020808501945080840160005b8381101561314957815161ffff16875295820195908201906001016139e1565b60208152613a1660208201835161ffff169052565b60006020830151613a2a60408401826130f0565b50604083015160ff908116610160840152606084015116610180830152608083015161ffff166101a083015260a08301516102006101c08401819052613a746102208501836139cd565b915060c0850151601f1980868503016101e0870152613a938483613116565b935060e0870151915080868503018387015250613ab08382613116565b9695505050505050565b600080600060608486031215613acf57600080fd5b8335613ada8161305c565b925060208401356001600160401b03811115613af557600080fd5b613b0186828701613622565b92505060408401356130b88161305c565b60008060408385031215613b2557600080fd5b8235613b308161305c565b915060208301356139288161305c565b60008060008060808587031215613b5657600080fd5b8435935060208501359250604085013591506060850135613b768161305c565b939692955090935050565b600060208284031215613b9357600080fd5b5051919050565b6001600160a01b039390931683526020830191909152604082015260600190565b805161307c81613435565b805161307c8161344f565b600082601f830112613be257600080fd5b613bea61337a565b806101a0840185811115613bfd57600080fd5b845b818110156134b9578051613c128161344f565b845260209384019301613bff565b600082601f830112613c3157600080fd5b613c3961339d565b80610120840185811115613c4c57600080fd5b845b818110156134b9578051613c6181613435565b845260209384019301613c4e565b600082601f830112613c8057600080fd5b81516020613c9061355783613513565b82815260059290921b84018101918181019086841115613caf57600080fd5b8286015b8481101561359f578051613cc681613435565b8352918301918301613cb3565b6000613ce1613557846135aa565b9050828152838383011115613cf557600080fd5b610551836020830184613154565b600082601f830112613d1457600080fd5b61055183835160208501613cd3565b805161307c8161305c565b60006020808385031215613d4157600080fd5b82516001600160401b0380821115613d5857600080fd5b818501915085601f830112613d6c57600080fd5b8151613d7a61355782613513565b81815260059190911b83018401908481019088831115613d9957600080fd5b8585015b83811015613f2e57805185811115613db55760008081fd5b86016104c0818c03601f1901811315613dce5760008081fd5b613dd661332f565b613de18a8401613bbb565b81526040613df0818501613bc6565b8b8301526060613e028f828701613bd1565b828401526102009150613e178f838701613c20565b9083015261032084015189811115613e2f5760008081fd5b613e3d8f8d83880101613c6f565b608084015250613e506103408501613bc6565b60a0830152613e626103608501613bc6565b60c0830152613e746103808501613bc6565b60e08301526103a08401516101008301526103c08401516101208301526103e08401516101408301526104008401516101608301526104208401516101808301526104408401516101a083015261046084015189811115613ed55760008081fd5b613ee38f8d83880101613d03565b6101c084015250613ef76104808501613d23565b6101e0830152613f0a6104a08501613d23565b90820152613f19838301613d23565b61022082015285525050918601918601613d9d565b5098975050505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201613f7957613f79613f51565b5060010190565b600060e08284031215613f9257600080fd5b82601f830112613fa157600080fd5b613fa96133c0565b8060e0840185811115613fbb57600080fd5b845b818110156134b9578051613fd081613435565b845260209384019301613fbd565b634e487b7160e01b600052602160045260246000fd5b808201808211156120f4576120f4613f51565b60006020828403121561401957600080fd5b815161055181613435565b60006020828403121561403657600080fd5b81516105518161344f565b85815284602082015260a06040820152600061406060a0830186613178565b905083606083015261ffff831660808301529695505050505050565b60208101600d831061409057614090613fde565b91905290565b600082601f8301126140a757600080fd5b604051606081018181106001600160401b03821117156140c9576140c9613319565b6040528060608401858111156140de57600080fd5b845b818110156141015780516140f38161344f565b8352602092830192016140e0565b509195945050505050565b6000806080838503121561411f57600080fd5b82516001600160401b038082111561413657600080fd5b8185019150601f868184011261414b57600080fd5b6141536133e2565b8061010085018981111561416657600080fd5b855b818110156141b2578051868111156141805760008081fd5b87018581018c136141915760008081fd5b805160206141a28e83838601613cd3565b8752909501945050602001614168565b505080965050505050506141c98460208501614096565b90509250929050565b85815284602082015260a0604082015260006141f160a0830186613178565b606083019490945250608001529392505050565b805163ffffffff8116811461307c57600080fd5b8051801515811461307c57600080fd5b80516001600160401b038116811461307c57600080fd5b600061010080838503121561425457600080fd5b604051908101906001600160401b038211818310171561427657614276613319565b8160405261428384614205565b815261429160208501614219565b6020820152604084015191506142a68261305c565b8160408201526142b860608501614205565b60608201526142c960808501613d23565b60808201526142da60a08501614229565b60a08201526142eb60c08501614229565b60c082015260e084015160e0820152809250505092915050565b60006020828403121561431757600080fd5b61055182614219565b80820281158282048414176120f4576120f4613f51565b634e487b7160e01b600052601260045260246000fd5b60008261435c5761435c614337565b500490565b60006040828403121561437357600080fd5b82601f83011261438257600080fd5b604051604081018181106001600160401b03821117156143a4576143a4613319565b80604052508060408401858111156143bb57600080fd5b845b818110156141015780516143d08161344f565b8352602092830192016143bd565b600060e082840312156143f057600080fd5b82601f8301126143ff57600080fd5b6144076133c0565b8060e084018581111561441957600080fd5b845b818110156134b957805161442e8161344f565b84526020938401930161441b565b602081016009831061409057614090613fde565b818103818111156120f4576120f4613f51565b600061ffff80831681810361447a5761447a613f51565b6001019392505050565b60ff82811682821603908111156120f4576120f4613f51565b600060ff821660ff81036144b3576144b3613f51565b60010192915050565b85815284602082015260a0604082015260006144db60a0830186613178565b60ff94909416606083015250608001529392505050565b60008261450157614501614337565b50069056fea164736f6c6343000811000a

Block Transaction Gas Used Reward
view all blocks collator

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.