Contract 0x678914c1108c004dbbc8ec5497e58f4dc77bcbc0 2

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x65d1e71acf26cf21746b91e547774a4440fe25b3503408fa293f2b217c764a58Batchjump193679872021-09-22 1:31:1627 secs ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.00539165
0xeb7fb168254348ab529f7336c50d6f66589041d49301aef0fd77d2cf4f25aef5Batchjump193679802021-09-22 1:31:0241 secs ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.00342237
0x76e94eec44c3fb8f70e9edfdad2948e1e4fd178179b080c27b4228e969ebc0f7Batchjump193679782021-09-22 1:30:5845 secs ago0x53c027c67186105a615dbaf24161254a2b3d02f4 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.01315811
0x5cb89c73be8ef6132cf5640278d3308e5a23d93533bda10be6812c8bf1ba614eBatchjump193679712021-09-22 1:30:4459 secs ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.00561986
0xbe58a74dfd10652553b39e11d56af48a91bc56aeb8c205780c0c8c2a5698957eBatchjump193679622021-09-22 1:30:261 min ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.00342237
0x6706442cd582e22439123334880a5e617c00935e1e46b72a5cc2dca43733b891Batchjump193679602021-09-22 1:30:221 min ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.007905414
0x7a9ad3ffcc81f9f1c3a53b6a6a15b2ee6a4c0cf1ad5eb7ec294d307648241db1Batchjump193679462021-09-22 1:29:541 min ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.007905414
0xd5dcc1172a3b009e1ecf97ee508347f87c064c675770a90c8c96e86aeb1393f8Batchjump193679232021-09-22 1:29:042 mins ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.00342294
0xb20f183014f48afc0535e8c4354003e852b4109b31650eba53f151a9ad84b1e7Batchjump193679032021-09-22 1:28:243 mins ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.02089813
0x91ffaf7c484881287d6bbba95615e8067d8c517b4ae9ef7c2ac29f9c721f928eBatchjump193678922021-09-22 1:28:023 mins ago0x0218b87112d03c6c587ed213140d992557f1f631 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.014574196
0x6bba72c0d963f69a01bd3d516540a62b508f619d13152770da846250efcc2be3Batchjump193678802021-09-22 1:27:384 mins ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.01897114
0x57e8955e9b38f7734276bc824ec8d8f0429b48fbaf53176d1a44af9c1408d49fBatchjump193678762021-09-22 1:27:304 mins ago0x0218b87112d03c6c587ed213140d992557f1f631 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.014547372
0x65a4eedcfeef9b37fec82ce64089f7ad7017d6052beb0513a65ed92d4eaf7921Batchjump193678762021-09-22 1:27:304 mins ago0x0218b87112d03c6c587ed213140d992557f1f631 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.014561785
0x2569f2add1a8e690f297150eb8d1a177c866be3c4e4cbff702e43624325ad161Batchjump193678732021-09-22 1:27:244 mins ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.02102896
0x69a1b7227dbd2422a8099b72a058d663376743657759648e30ac534573cd767dBatchjump193678732021-09-22 1:27:244 mins ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.02102953
0xfb826fa5f0ca65bd57d6ea2861da3d420c35719457279df978e04f36de6b4c62Batchjump193678552021-09-22 1:26:125 mins ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.05691855
0x3a88f5fcfff2471aeaebcea5e10cea05c9533de4c79b5a8a3148605ec0446518Batchjump193678502021-09-22 1:25:525 mins ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.04209452
0xfe2391ac5d1bcc2888704d545184baf4be94a4443d02f205d674457c4d1720d9Batchjump193678502021-09-22 1:25:525 mins ago0x8c8334f34b3e74970a10aada4d42896b61392415 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.0107851
0x21d0cf762b5793d30d211e5024350821e92f5069790feb1724dec3be1cd9b74bBatchjump193678452021-09-22 1:25:326 mins ago0xf7dabcfe0a2a42a5b39dc29372e63ff168815de1 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.02093515
0x814e9d8c8d56e6f9bd114573e4fcccbf7c9449f4b4f79339618a387d36f775b1Batchjump193678432021-09-22 1:25:246 mins ago0x8c8334f34b3e74970a10aada4d42896b61392415 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.03368406
0x8413e60d29031f8b49d942573a6c85fa4afad1ef2da2de3e3bf77f91790c6c7cBatchjump193678402021-09-22 1:25:126 mins ago0x8c8334f34b3e74970a10aada4d42896b61392415 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.01517938
0xc5b3e222a8f1eed3c099b4c5776ca76959b3a8093e7a94ffa10ffde6c5bb3b9dBatchjump193678372021-09-22 1:25:006 mins ago0x6be7b13539bbf6d3ef62c157443e008f43a3c4c2 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.03511358
0x2e91919e27ff9ed0ed2985044bc9c12e6a690045c4db5db6599a48e1d445a09bBatchjump193678352021-09-22 1:24:526 mins ago0x8c8334f34b3e74970a10aada4d42896b61392415 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.03372182
0xaf89c84ec578ac209b12038d7da024d0c0a2f4ac9ee921d3b9be2f0b62216a3cBatchjump193678322021-09-22 1:24:407 mins ago0x8c8334f34b3e74970a10aada4d42896b61392415 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.03533366
0x2c4ff8919eff85ceb71301cffbad26307bc8ada925abca7c291ad65eab126e2bBatchjump193678262021-09-22 1:24:167 mins ago0x8c8334f34b3e74970a10aada4d42896b61392415 IN  0x678914c1108c004dbbc8ec5497e58f4dc77bcbc00 MATIC0.02351408
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading
This contract contains unverified libraries: PositionsV2

Contract Source Code Verified (Exact Match)

Contract Name:
JumpManagerV4

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 23 : JumpManagerV4.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "./Modulable.sol";
import "./MinerStoreV2.sol";
import "./MustManager.sol";
import "./solarsystem/SolarSystemStore.sol";

interface IJumpManagerV4 {
    event Jumped(
        uint256 indexed minerId,
        uint256 indexed targetId,
        uint256 fee,
        uint256 price,
        uint256 solarSystemID,
        uint32 newDistance,
        int128 newAngle,
        uint256 updateTime
    );

    event PullPriceChanged(uint256 indexed minerId, uint256 price);

    function jump(
        uint256 minerId,
        uint256 targetId,
        uint256 amount,
        uint256 solarSystemID
    ) external;

    function batchjump(
        uint256 minerId,
        uint256[] memory targetIds,
        uint256[] memory amounts,
        uint256 solarSystemID
    ) external;

    function changePullingPrice(
        uint256 minerId,
        uint256 price,
        uint256 solarSystemID
    ) external;

    function updateSolarSystemStore(address newStore) external;

    function updateGateway(address newGateway) external;

    function updateMustManager(address newMustManager) external;

    function updateFeeReceiver(address newFeeReceiver) external;

    function updateDefaultPullingPercentageFee(uint256 newFee) external;

    function updateDefaultPullingMinFee(uint256 newFee) external;

    function pause() external;

    function unpause() external;
}

contract JumpManagerV4 is IJumpManagerV4, Ownable, Pausable {
    using PositionsV2 for *;

    ISolarSystemStore public solarSystemStore;

    IERC721 public gateway;
    address public feeReceiver;
    MustManager public mustManager;

    uint256 public defaultPullingMinFee = 300000000000000;
    uint256 public defaultPullingPercentageFee = 5;

    mapping(uint256 => uint256) public pullingMinFees;
    mapping(uint256 => uint256) public pullingPercentageFees;

    modifier validMiner(uint256 minerId, uint256 solarSystemID) {
        IMinerStoreV2 minerStore =
            IMinerStoreV2(solarSystemStore.minerStoreFor(solarSystemID));

        require(minerStore.contains(minerId), "JumpManager: unknown miner");
        require(
            msg.sender == gateway.ownerOf(minerId) ||
                gateway.getApproved(minerId) == msg.sender ||
                gateway.isApprovedForAll(gateway.ownerOf(minerId), msg.sender),
            "JumpManager: require owner or approved"
        );
        _;
    }

    constructor(
        address newMustManager,
        address newSystemSolarStore,
        address newGateway
    ) public {
        updateMustManager(newMustManager);
        updateSolarSystemStore(newSystemSolarStore);
        updateGateway(newGateway);
        feeReceiver = msg.sender;
    }

    function updateSolarSystemStore(address newStore)
        public
        override
        onlyOwner
    {
        solarSystemStore = ISolarSystemStore(newStore);
    }

    function updateMustManager(address newMustManager)
        public
        override
        onlyOwner
    {
        mustManager = MustManager(newMustManager);
    }

    function updateGateway(address newGateway) public override onlyOwner {
        gateway = IERC721(newGateway);
    }

    function updateFeeReceiver(address newFeeReceiver)
        public
        override
        onlyOwner
    {
        feeReceiver = newFeeReceiver;
    }

    function updateDefaultPullingPercentageFee(uint256 newFee)
        public
        override
        onlyOwner
    {
        defaultPullingPercentageFee = newFee;
    }

    function updateDefaultPullingMinFee(uint256 newFee) public override onlyOwner {
        defaultPullingMinFee = newFee;
    }

    function updateSolarSystemPullingMinFee(uint256 solarSystemID, uint256 newFee)
        public
        onlyOwner
    {
        pullingMinFees[solarSystemID] = newFee;
    }

    function updateSolarSystemPullingPercentageFee(uint256 solarSystemID, uint256 newPercentage)
        public
        onlyOwner
    {
        pullingPercentageFees[solarSystemID] = newPercentage;
    }

    function getPullingPercentageFee(uint256 solarSystemID) public view returns(uint256) {
      uint256 overriden = pullingPercentageFees[solarSystemID];
      if (overriden != 0) {
        return overriden;
      }
      return defaultPullingPercentageFee;
    }

    function getPullingMinFee(uint256 solarSystemID) public view returns(uint256) {
      uint256 overriden = pullingMinFees[solarSystemID];
      if (overriden != 0) {
        return overriden;
      }
      return defaultPullingMinFee;
    }

    function jump(
        uint256 minerId,
        uint256 targetId,
        uint256 amount,
        uint256 solarSystemID
    ) external override validMiner(minerId, solarSystemID) {
        _jump(minerId, targetId, amount, solarSystemID);
    }

    function batchjump(
        uint256 minerId,
        uint256[] memory targetIds,
        uint256[] memory amounts,
        uint256 solarSystemID
    ) external override validMiner(minerId, solarSystemID) {
        require(targetIds.length == amounts.length, "JumpManager: mismatch targets and amounts");
        require(targetIds.length <= 10, "JumpManager: limited to 10");

        for(uint256 i = 0; i < targetIds.length; i++) {
            _jump(minerId, targetIds[i], amounts[i], solarSystemID);
        }
    }



    function changePullingPrice(
        uint256 minerId,
        uint256 price,
        uint256 solarSystemID
    ) external override validMiner(minerId, solarSystemID) {
        IMinerStoreV2 minerStore =
            IMinerStoreV2(solarSystemStore.minerStoreFor(solarSystemID));

        uint256 pullingMinFee = getPullingMinFee(solarSystemID);
        require(price >= pullingMinFee, "JumpManager: pulling price too low");
        minerStore.updatePullingPrice(minerId, price);
        PullPriceChanged(minerId, price);
    }

    function pause() external override onlyOwner {
        _pause();
    }

    function unpause() external override onlyOwner {
        _unpause();
    }

    function _beforeAction() internal view {
        require(!paused(), "JumpManager: paused");
    }

    function _jump(uint256 minerId, uint256 targetId, uint256 amount, uint256 solarSystemID) internal {
        _beforeAction();

        IMinerStoreV2 minerStore =
            IMinerStoreV2(solarSystemStore.minerStoreFor(solarSystemID));
        require(minerStore.contains(targetId), "JumpManager: unknow target");

        uint256 pullingPercentageFee = getPullingPercentageFee(solarSystemID);
        uint256 pullingMinFee = getPullingMinFee(solarSystemID);
        uint256 fee = (amount * pullingPercentageFee) / 100;
        if (fee < pullingMinFee) {
            fee = pullingMinFee;
        }

        {
          uint256 pullingPrice = minerStore.pullingPrice(targetId);
          if (pullingPrice < pullingMinFee) {
            pullingPrice = pullingMinFee;
          }
          require(
              amount == pullingPrice,
              "JumpManager: jump amount different than required price"
          );
        }

        PositionsV2.Orbit memory minerOrbit = minerStore.orbit(minerId);

        PositionsV2.Polar memory newPolar =
            PositionsV2.polarMiddle(
                minerOrbit,
                minerStore.orbit(targetId),
                block.timestamp
            );

        minerOrbit.last = newPolar;
        minerOrbit.lastUpdate = block.timestamp;
        minerStore.updateOrbit(minerId, minerOrbit);

        mustManager.transferFrom(
            msg.sender,
            gateway.ownerOf(targetId),
            amount - fee
        );
        mustManager.transferFrom(msg.sender, feeReceiver, fee);
        Jumped(
            minerId,
            targetId,
            fee,
            amount - fee,
            solarSystemID,
            newPolar.distance,
            newPolar.angle,
            block.timestamp
        );
    }
}

File 2 of 23 : MinerStoreV2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "./PositionsV2.sol";
import "./Modulable.sol";

interface IMinerStoreV2 {
    function add(
        uint256 minerId,
        PositionsV2.Orbit memory orbit,
        uint256 pullingPrice
    ) external;

    function remove(uint256 minerId) external;

    function updateOrbit(uint256 minerId, PositionsV2.Orbit memory newOrbit)
        external;

    function updatePullingPrice(uint256 minerId, uint256 newPullingPrice)
        external;

    function updateLastAction(uint256 minerId, uint256 time) external;

    function length() external view returns (uint256);

    function idAt(uint256 index) external view returns (uint256);

    function ids() external view returns (uint256[] memory);

    function contains(uint256 minerId) external view returns (bool);

    function orbit(uint256 minerId)
        external
        view
        returns (PositionsV2.Orbit memory);

    function pullingPrice(uint256 minerId) external view returns (uint256);

    function lastAction(uint256 minerId) external view returns (uint256);
}

contract MinerStoreV2 is IMinerStoreV2, Modulable {
    using PositionsV2 for *;
    using EnumerableSet for EnumerableSet.UintSet;

    EnumerableSet.UintSet internal _minerIds;
    mapping(uint256 => PositionsV2.Orbit) internal orbits;
    mapping(uint256 => uint256) internal pullingPrices;
    mapping(uint256 => uint256) internal lastActions;

    constructor() public {}

    function add(
        uint256 minerId,
        PositionsV2.Orbit memory orbit,
        uint256 pullingPrice
    ) external override onlyModule {
        require(_minerIds.add(minerId), "Store: already exist");
        orbits[minerId] = orbit;
        pullingPrices[minerId] = pullingPrice;
        lastActions[minerId] = 0;
    }

    function remove(uint256 minerId) external override onlyModule {
        require(_minerIds.remove(minerId), "Store: unknow");
    }

    function updateOrbit(uint256 minerId, PositionsV2.Orbit memory newOrbit)
        external
        override
        onlyModule
    {
        orbits[minerId] = newOrbit;
    }

    function updatePullingPrice(uint256 minerId, uint256 newPullingPrice)
        external
        override
        onlyModule
    {
        pullingPrices[minerId] = newPullingPrice;
    }

    function updateLastAction(uint256 minerId, uint256 time)
        external
        override
        onlyModule
    {
        lastActions[minerId] = time;
    }

    function length() external view override returns (uint256) {
        return _minerIds.length();
    }

    function idAt(uint256 index) external view override returns (uint256) {
        return _minerIds.at(index);
    }

    function ids() external view override returns (uint256[] memory) {
        uint256[] memory result = new uint256[](_minerIds.length());
        for (uint256 i = 0; i < _minerIds.length(); i++) {
            result[i] = _minerIds.at(i);
        }
        return result;
    }

    function contains(uint256 minerId) external view override returns (bool) {
        return _minerIds.contains(minerId);
    }

    function orbit(uint256 minerId)
        external
        view
        override
        returns (PositionsV2.Orbit memory)
    {
        return orbits[minerId];
    }

    function pullingPrice(uint256 minerId)
        external
        view
        override
        returns (uint256)
    {
        return pullingPrices[minerId];
    }

    function lastAction(uint256 minerId)
        external
        view
        override
        returns (uint256)
    {
        return lastActions[minerId];
    }
}

File 3 of 23 : Modulable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";


contract Modulable is Ownable {
    using EnumerableSet for EnumerableSet.AddressSet;

    EnumerableSet.AddressSet private _modules;

    modifier onlyModule() {
        require(
            _modules.contains(msg.sender),
            "Manager: caller is not a module"
        );
        _;
    }

    constructor() public {}

    function updateModule(address newModule) onlyOwner external {
        _updateModule(newModule);
    }

    function updateModules(address[] memory newModules) onlyOwner external {
        for(uint256 i = 0; i < newModules.length; i++) {
            _updateModule(newModules[i]);
        }
    }

    function isModule(address module) public view returns (bool) {
        return _modules.contains(module);
    }

    function modules() external view returns (address[] memory) {
        address[] memory result = new address[](_modules.length());
        for (uint256 i = 0; i < _modules.length(); i++) {
            result[i] = _modules.at(i);
        }
        return result;
    }

    function _updateModule(address newModule) private {
        if(_modules.contains(newModule)) {
            _modules.remove(newModule);
        } else {
            _modules.add(newModule);
        }
    }
}

File 4 of 23 : MustManager.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.10;
pragma experimental ABIEncoderV2;

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

contract MustManager is Modulable {
    IERC20 public must;

    constructor(address newMust) public {
        must = IERC20(newMust);
    }

    function transferFrom(address from, address to, uint256 amount) onlyModule external {
        must.transferFrom(from, to, amount);
    }
}

File 5 of 23 : PositionsV2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.10;

pragma experimental ABIEncoderV2;

import "./RealMath.sol";

library PositionsV2 {
    using RealMath for *;

    struct Orbit {
        Cartesian center;
        Polar last;
        int32 rotationSpeed;
        uint256 lastUpdate;
    }

    struct Polar {
        uint32 distance;
        int128 angle;
    }

    struct Cartesian {
        int256 x;
        int256 y;
    }

    /**@dev
     * half circle, to save on divides.
     */
    int128 constant REAL_HALF_CIRCLE = 197912092999680;

    /**@dev
     * circle, to save on divides.
     */
    int128 constant REAL_CIRCLE = 395824185999360;

    function toReal(int88 nb) public pure returns(int128) {
        return nb.toReal();
    }

    function realRadianToDegree(int128 realRadian)
        public
        pure
        returns (int128)
    {
        return realRadian.mul(REAL_HALF_CIRCLE).div(RealMath.REAL_PI);
    }

    function realDegreeToRadian(int128 realDegree)
        public
        pure
        returns (int128)
    {
        return realDegree.mul(RealMath.REAL_PI).div(REAL_HALF_CIRCLE);
    }

    function currentAngleDegreeReal(Orbit memory orbit, uint256 time)
        public
        pure
        returns (int128)
    {
        if (orbit.last.distance == 0) {
            return orbit.last.angle;
        }

        int128 speedReal = orbit.rotationSpeed.toReal();
        int128 distanceReal = orbit.last.distance.toReal();

        int128 radiansAngularSpeedInReal = speedReal.div(distanceReal);

        int128 timeDiffReal = int88(time - orbit.lastUpdate).toReal();

        int128 angleToAddRadianReal =
            radiansAngularSpeedInReal.mul(timeDiffReal);

        int128 angleToAddDegree = realRadianToDegree(angleToAddRadianReal);

        return ((angleToAddDegree + orbit.last.angle) % 360.toReal());
    }

    function cartesianCoordinate(Orbit memory orbit, uint256 time)
        public
        pure
        returns (Cartesian memory)
    {
        int128 currentAngleReal = currentAngleDegreeReal(orbit, time);

        int128 currentAngleRadians = realDegreeToRadian(currentAngleReal);

        int128 angleCos = currentAngleRadians.cos();
        int128 angleSin = currentAngleRadians.sin();

        int128 distanceReal = orbit.last.distance.toReal();

        int256 x =
            distanceReal.mul(angleCos).round().fromReal() + orbit.center.x;
        int256 y =
            distanceReal.mul(angleSin).round().fromReal() + orbit.center.y;

        return Cartesian({x: x, y: y});
    }

    function distance(Cartesian memory a, Cartesian memory b)
        public
        pure
        returns (int88)
    {
        int256 xDiff = b.x - a.x;
        int256 yDiff = b.y - a.y;

        int256 xDiffSquare = xDiff * xDiff;
        int256 yDiffSquare = yDiff * yDiff;

        int256 sum = xDiffSquare + yDiffSquare;
        int128 sumReal = int88(sum).toReal();

        return RealMath.sqrt(sumReal).fromReal();
    }

    function collision(
        Cartesian memory positionA,
        Cartesian memory positionB,
        uint8 area
    ) public pure returns (bool result) {
        return distance(positionA, positionB) <= area;
    }

    function polarMiddle(
        Orbit memory orbit1,
        Orbit memory orbit2,
        uint256 time
    ) public pure returns (Polar memory) {
        int128 r1 = int88(orbit1.last.distance).toReal();
        int128 r2 = int88(orbit2.last.distance).toReal();

        int128 a1 = currentAngleDegreeReal(orbit1, time);
        int128 a2 = currentAngleDegreeReal(orbit2, time);

        (int128 x, int128 y) = realCartesianMiddleFromPolar(r1, a1, r2, a2);

        int128 r =
            RealMath.sqrt(x.pow(RealMath.REAL_TWO) + y.pow(RealMath.REAL_TWO));
        int128 angleRad = RealMath.atan2(y, x);

        int128 angle = realRadianToDegree(angleRad);

        if (angle < 0) {
            angle = REAL_CIRCLE + angle;
        }

        return
            Polar({
                distance: uint32(r.round().fromReal()),
                angle: angle
            });
    }

    function realCartesianMiddleFromPolar(
        int128 r1,
        int128 ad1,
        int128 r2,
        int128 ad2
    ) public pure returns (int128, int128) {
        int128 a1 = realDegreeToRadian(ad1);
        int128 a2 = realDegreeToRadian(ad2);

        int128 x =
            (r1.mul(RealMath.cos(a1)) + r2.mul(RealMath.cos(a2))).div(
                RealMath.REAL_TWO
            );
        int128 y =
            (r1.mul(RealMath.sin(a1)) + r2.mul(RealMath.sin(a2))).div(
                RealMath.REAL_TWO
            );

        return (x, y);
    }
}

File 6 of 23 : RealMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.10;

/**
 * RealMath: fixed-point math library, based on fractional and integer parts.
 * Using int128 as real88x40, which isn't in Solidity yet.
 * 40 fractional bits gets us down to 1E-12 precision, while still letting us
 * go up to galaxy scale counting in meters.
 * Internally uses the wider int256 for some math.
 *
 * Note that for addition, subtraction, and mod (%), you should just use the
 * built-in Solidity operators. Functions for these operations are not provided.
 *
 * Note that the fancy functions like sqrt, atan2, etc. aren't as accurate as
 * they should be. They are (hopefully) Good Enough for doing orbital mechanics
 * on block timescales in a game context, but they may not be good enough for
 * other applications.
 */

library RealMath {

    /**@dev
     * How many total bits are there?
     */
    int256 constant REAL_BITS = 128;

    /**@dev
     * How many fractional bits are there?
     */
    int256 constant REAL_FBITS = 40;

    /**@dev
     * How many integer bits are there?
     */
    int256 constant REAL_IBITS = REAL_BITS - REAL_FBITS;

    /**@dev
     * What's the first non-fractional bit
     */
    int128 constant REAL_ONE = int128(1) << int128(REAL_FBITS);

    /**@dev
     * What's the last fractional bit?
     */
    int128 constant REAL_HALF = REAL_ONE >> int128(1);

    /**@dev
     * What's two? Two is pretty useful.
     */
    int128 constant REAL_TWO = REAL_ONE << int128(1);

    /**@dev
     * And our logarithms are based on ln(2).
     */
    int128 constant REAL_LN_TWO = 762123384786;

    /**@dev
     * It is also useful to have Pi around.
     */
    int128 constant REAL_PI = 3454217652358;

    /**@dev
     * And half Pi, to save on divides.
     * TODO: That might not be how the compiler handles constants.
     */
    int128 constant REAL_HALF_PI = 1727108826179;

    /**@dev
     * And two pi, which happens to be odd in its most accurate representation.
     */
    int128 constant REAL_TWO_PI = 6908435304715;

    /**@dev
     * What's the sign bit?
     */
    int128 constant SIGN_MASK = int128(1) << int128(127);


    /**
     * Convert an integer to a real. Preserves sign.
     */
    function toReal(int88 ipart) public pure returns (int128) {
        return int128(ipart) * REAL_ONE;
    }

    /**
     * Convert a real to an integer. Preserves sign.
     */
    function fromReal(int128 real_value) public pure returns (int88) {
        return int88(real_value / REAL_ONE);
    }

    /**
     * Round a real to the nearest integral real value.
     */
    function round(int128 real_value) public pure returns (int128) {
        // First, truncate.
        int88 ipart = fromReal(real_value);
        if ((fractionalBits(real_value) & (uint40(1) << uint40(REAL_FBITS - 1))) > 0) {
            // High fractional bit is set. Round up.
            if (real_value < int128(0)) {
                // Rounding up for a negative number is rounding down.
                ipart -= 1;
            } else {
                ipart += 1;
            }
        }
        return toReal(ipart);
    }

    /**
     * Get the absolute value of a real. Just the same as abs on a normal int128.
     */
    function abs(int128 real_value) public pure returns (int128) {
        if (real_value > 0) {
            return real_value;
        } else {
            return -real_value;
        }
    }

    /**
     * Returns the fractional bits of a real. Ignores the sign of the real.
     */
    function fractionalBits(int128 real_value) public pure returns (uint40) {
        return uint40(abs(real_value) % REAL_ONE);
    }

    /**
     * Get the fractional part of a real, as a real. Ignores sign (so fpart(-0.5) is 0.5).
     */
    function fpart(int128 real_value) public pure returns (int128) {
        // This gets the fractional part but strips the sign
        return abs(real_value) % REAL_ONE;
    }

    /**
     * Get the fractional part of a real, as a real. Respects sign (so fpartSigned(-0.5) is -0.5).
     */
    function fpartSigned(int128 real_value) public pure returns (int128) {
        // This gets the fractional part but strips the sign
        int128 fractional = fpart(real_value);
        if (real_value < 0) {
            // Add the negative sign back in.
            return -fractional;
        } else {
            return fractional;
        }
    }

    /**
     * Get the integer part of a fixed point value.
     */
    function ipart(int128 real_value) public pure returns (int128) {
        // Subtract out the fractional part to get the real part.
        return real_value - fpartSigned(real_value);
    }

    /**
     * Multiply one real by another. Truncates overflows.
     */
    function mul(int128 real_a, int128 real_b) public pure returns (int128) {
        // When multiplying fixed point in x.y and z.w formats we get (x+z).(y+w) format.
        // So we just have to clip off the extra REAL_FBITS fractional bits.
        return int128((int256(real_a) * int256(real_b)) >> REAL_FBITS);
    }

    /**
     * Divide one real by another real. Truncates overflows.
     */
    function div(int128 real_numerator, int128 real_denominator) public pure returns (int128) {
        // We use the reverse of the multiplication trick: convert numerator from
        // x.y to (x+z).(y+w) fixed point, then divide by denom in z.w fixed point.
        return int128((int256(real_numerator) * REAL_ONE) / int256(real_denominator));
    }

    /**
     * Create a real from a rational fraction.
     */
    function fraction(int88 numerator, int88 denominator) public pure returns (int128) {
        return div(toReal(numerator), toReal(denominator));
    }

    // Now we have some fancy math things (like pow and trig stuff). This isn't
    // in the RealMath that was deployed with the original Macroverse
    // deployment, so it needs to be linked into your contract statically.

    /**
     * Raise a number to a positive integer power in O(log power) time.
     * See <https://stackoverflow.com/a/101613>
     */
    function ipow(int128 real_base, int88 exponent) public pure returns (int128) {
        if (exponent < 0) {
            // Negative powers are not allowed here.
            revert();
        }

        // Start with the 0th power
        int128 real_result = REAL_ONE;
        while (exponent != 0) {
            // While there are still bits set
            if ((exponent & 0x1) == 0x1) {
                // If the low bit is set, multiply in the (many-times-squared) base
                real_result = mul(real_result, real_base);
            }
            // Shift off the low bit
            exponent = exponent >> 1;
            // Do the squaring
            real_base = mul(real_base, real_base);
        }

        // Return the final result.
        return real_result;
    }

    /**
     * Zero all but the highest set bit of a number.
     * See <https://stackoverflow.com/a/53184>
     */
    function hibit(uint256 val) internal pure returns (uint256) {
        // Set all the bits below the highest set bit
        val |= (val >>  1);
        val |= (val >>  2);
        val |= (val >>  4);
        val |= (val >>  8);
        val |= (val >> 16);
        val |= (val >> 32);
        val |= (val >> 64);
        val |= (val >> 128);
        return val ^ (val >> 1);
    }

    /**
     * Given a number with one bit set, finds the index of that bit.
     */
    function findbit(uint256 val) internal pure returns (uint8 index) {
        index = 0;
        // We and the value with alternating bit patters of various pitches to find it.

        if (val & 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA != 0) {
            // Picth 1
            index |= 1;
        }
        if (val & 0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC != 0) {
            // Pitch 2
            index |= 2;
        }
        if (val & 0xF0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 != 0) {
            // Pitch 4
            index |= 4;
        }
        if (val & 0xFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 != 0) {
            // Pitch 8
            index |= 8;
        }
        if (val & 0xFFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000 != 0) {
            // Pitch 16
            index |= 16;
        }
        if (val & 0xFFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000 != 0) {
            // Pitch 32
            index |= 32;
        }
        if (val & 0xFFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF0000000000000000 != 0) {
            // Pitch 64
            index |= 64;
        }
        if (val & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 != 0) {
            // Pitch 128
            index |= 128;
        }
    }

    /**
     * Shift real_arg left or right until it is between 1 and 2. Return the
     * rescaled value, and the number of bits of right shift applied. Shift may be negative.
     *
     * Expresses real_arg as real_scaled * 2^shift, setting shift to put real_arg between [1 and 2).
     *
     * Rejects 0 or negative arguments.
     */
    function rescale(int128 real_arg) internal pure returns (int128 real_scaled, int88 shift) {
        if (real_arg <= 0) {
            // Not in domain!
            revert();
        }

        // Find the high bit
        int88 high_bit = findbit(hibit(uint256(real_arg)));

        // We'll shift so the high bit is the lowest non-fractional bit.
        shift = high_bit - int88(REAL_FBITS);

        if (shift < 0) {
            // Shift left
            real_scaled = real_arg << int128(-shift);
        } else if (shift >= 0) {
            // Shift right
            real_scaled = real_arg >> int128(shift);
        }
    }

    /**
     * Calculate the natural log of a number. Rescales the input value and uses
     * the algorithm outlined at <https://math.stackexchange.com/a/977836> and
     * the ipow implementation.
     *
     * Lets you artificially limit the number of iterations.
     *
     * Note that it is potentially possible to get an un-converged value; lack
     * of convergence does not throw.
     */
    function lnLimited(int128 real_arg, int max_iterations) public pure returns (int128) {
        if (real_arg <= 0) {
            // Outside of acceptable domain
            revert();
        }

        if (real_arg == REAL_ONE) {
            // Handle this case specially because people will want exactly 0 and
            // not ~2^-39 ish.
            return 0;
        }

        // We know it's positive, so rescale it to be between [1 and 2)
        int128 real_rescaled;
        int88 shift;
        (real_rescaled, shift) = rescale(real_arg);

        // Compute the argument to iterate on
        int128 real_series_arg = div(real_rescaled - REAL_ONE, real_rescaled + REAL_ONE);

        // We will accumulate the result here
        int128 real_series_result = 0;

        for (int88 n = 0; n < max_iterations; n++) {
            // Compute term n of the series
            int128 real_term = div(ipow(real_series_arg, 2 * n + 1), toReal(2 * n + 1));
            // And add it in
            real_series_result += real_term;
            if (real_term == 0) {
                // We must have converged. Next term is too small to represent.
                break;
            }
            // If we somehow never converge I guess we will run out of gas
        }

        // Double it to account for the factor of 2 outside the sum
        real_series_result = mul(real_series_result, REAL_TWO);

        // Now compute and return the overall result
        return mul(toReal(shift), REAL_LN_TWO) + real_series_result;

    }

    /**
     * Calculate a natural logarithm with a sensible maximum iteration count to
     * wait until convergence. Note that it is potentially possible to get an
     * un-converged value; lack of convergence does not throw.
     */
    function ln(int128 real_arg) public pure returns (int128) {
        return lnLimited(real_arg, 100);
    }

    /**
     * Calculate e^x. Uses the series given at
     * <http://pages.mtu.edu/~shene/COURSES/cs201/NOTES/chap04/exp.html>.
     *
     * Lets you artificially limit the number of iterations.
     *
     * Note that it is potentially possible to get an un-converged value; lack
     * of convergence does not throw.
     */
    function expLimited(int128 real_arg, int max_iterations) public pure returns (int128) {
        // We will accumulate the result here
        int128 real_result = 0;

        // We use this to save work computing terms
        int128 real_term = REAL_ONE;

        for (int88 n = 0; n < max_iterations; n++) {
            // Add in the term
            real_result += real_term;

            // Compute the next term
            real_term = mul(real_term, div(real_arg, toReal(n + 1)));

            if (real_term == 0) {
                // We must have converged. Next term is too small to represent.
                break;
            }
            // If we somehow never converge I guess we will run out of gas
        }

        // Return the result
        return real_result;

    }

    /**
     * Calculate e^x with a sensible maximum iteration count to wait until
     * convergence. Note that it is potentially possible to get an un-converged
     * value; lack of convergence does not throw.
     */
    function exp(int128 real_arg) public pure returns (int128) {
        return expLimited(real_arg, 100);
    }

    /**
     * Raise any number to any power, except for negative bases to fractional powers.
     */
    function pow(int128 real_base, int128 real_exponent) public pure returns (int128) {
        if (real_exponent == 0) {
            // Anything to the 0 is 1
            return REAL_ONE;
        }

        if (real_base == 0) {
            if (real_exponent < 0) {
                // Outside of domain!
                revert();
            }
            // Otherwise it's 0
            return 0;
        }

        if (fpart(real_exponent) == 0) {
            // Anything (even a negative base) is super easy to do to an integer power.

            if (real_exponent > 0) {
                // Positive integer power is easy
                return ipow(real_base, fromReal(real_exponent));
            } else {
                // Negative integer power is harder
                return div(REAL_ONE, ipow(real_base, fromReal(-real_exponent)));
            }
        }

        if (real_base < 0) {
            // It's a negative base to a non-integer power.
            // In general pow(-x^y) is undefined, unless y is an int or some
            // weird rational-number-based relationship holds.
            revert();
        }

        // If it's not a special case, actually do it.
        return exp(mul(real_exponent, ln(real_base)));
    }

    /**
     * Compute the square root of a number.
     */
    function sqrt(int128 real_arg) public pure returns (int128) {
        return pow(real_arg, REAL_HALF);
    }

    /**
     * Compute the sin of a number to a certain number of Taylor series terms.
     */
    function sinLimited(int128 real_arg, int88 max_iterations) public pure returns (int128) {
        // First bring the number into 0 to 2 pi
        // TODO: This will introduce an error for very large numbers, because the error in our Pi will compound.
        // But for actual reasonable angle values we should be fine.
        real_arg = real_arg % REAL_TWO_PI;

        int128 accumulator = REAL_ONE;

        // We sum from large to small iteration so that we can have higher powers in later terms
        for (int88 iteration = max_iterations - 1; iteration >= 0; iteration--) {
            accumulator = REAL_ONE - mul(div(mul(real_arg, real_arg), toReal((2 * iteration + 2) * (2 * iteration + 3))), accumulator);
            // We can't stop early; we need to make it to the first term.
        }

        return mul(real_arg, accumulator);
    }

    /**
     * Calculate sin(x) with a sensible maximum iteration count to wait until
     * convergence.
     */
    function sin(int128 real_arg) public pure returns (int128) {
        return sinLimited(real_arg, 15);
    }

    /**
     * Calculate cos(x).
     */
    function cos(int128 real_arg) public pure returns (int128) {
        return sin(real_arg + REAL_HALF_PI);
    }

    /**
     * Calculate tan(x). May overflow for large results. May throw if tan(x)
     * would be infinite, or return an approximation, or overflow.
     */
    function tan(int128 real_arg) public pure returns (int128) {
        return div(sin(real_arg), cos(real_arg));
    }

    /**
     * Calculate atan(x) for x in [-1, 1].
     * Uses the Chebyshev polynomial approach presented at
     * https://www.mathworks.com/help/fixedpoint/examples/calculate-fixed-point-arctangent.html
     * Uses polynomials received by personal communication.
     * 0.999974x-0.332568x^3+0.193235x^5-0.115729x^7+0.0519505x^9-0.0114658x^11
     */
    function atanSmall(int128 real_arg) public pure returns (int128) {
        int128 real_arg_squared = mul(real_arg, real_arg);
        return mul(mul(mul(mul(mul(mul(
            - 12606780422,  real_arg_squared) // x^11
            + 57120178819,  real_arg_squared) // x^9
            - 127245381171, real_arg_squared) // x^7
            + 212464129393, real_arg_squared) // x^5
            - 365662383026, real_arg_squared) // x^3
            + 1099483040474, real_arg);       // x^1
    }

    /**
     * Compute the nice two-component arctangent of y/x.
     */
    function atan2(int128 real_y, int128 real_x) public pure returns (int128) {
        int128 atan_result;

        // Do the angle correction shown at
        // https://www.mathworks.com/help/fixedpoint/examples/calculate-fixed-point-arctangent.html

        // We will re-use these absolute values
        int128 real_abs_x = abs(real_x);
        int128 real_abs_y = abs(real_y);

        if (real_abs_x > real_abs_y) {
            // We are in the (0, pi/4] region
            // abs(y)/abs(x) will be in 0 to 1.
            atan_result = atanSmall(div(real_abs_y, real_abs_x));
        } else {
            // We are in the (pi/4, pi/2) region
            // abs(x) / abs(y) will be in 0 to 1; we swap the arguments
            atan_result = REAL_HALF_PI - atanSmall(div(real_abs_x, real_abs_y));
        }

        // Now we correct the result for other regions
        if (real_x < 0) {
            if (real_y < 0) {
                atan_result -= REAL_PI;
            } else {
                atan_result = REAL_PI - atan_result;
            }
        } else {
            if (real_y < 0) {
                atan_result = -atan_result;
            }
        }

        return atan_result;
    }
}

File 7 of 23 : SolarSystemStore.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;

import "../Modulable.sol";
import "../PositionsV2.sol";

import "@openzeppelin/contracts/utils/EnumerableSet.sol";

interface ISolarSystemStore {
    function add(
        uint256 solarSystemId,
        PositionsV2.Cartesian memory center,
        string memory name,
        address minerStore,
        address cometStore
    ) external;

    function remove(uint256 solarSystemId) external;

    function updateCenter(
        uint256 solarSystemId,
        PositionsV2.Cartesian memory newCenter
    ) external;

    function updateName(uint256 solarSystemId, string memory newName) external;

    function updateMinerStore(uint256 solarSystemId, address minerStore)
        external;

    function updateCometStore(uint256 solarSystemId, address cometStore)
        external;

    function length() external view returns (uint256);

    function idAt(uint256 index) external view returns (uint256);

    function ids() external view returns (uint256[] memory);

    function contains(uint256 solarSystemId) external view returns (bool);

    function centerFor(uint256 solarSystemId)
        external
        view
        returns (PositionsV2.Cartesian memory);

    function nameFor(uint256 solarSystemId)
        external
        view
        returns (string memory);

    function minerStoreFor(uint256 solarSystemId)
        external
        view
        returns (address);

    function cometStoreFor(uint256 solarSystemId)
        external
        view
        returns (address);
}

contract SolarSystemStore is ISolarSystemStore, Modulable {
    using PositionsV2 for *;
    using EnumerableSet for EnumerableSet.UintSet;

    EnumerableSet.UintSet internal _solarSystemIds;
    mapping(uint256 => PositionsV2.Cartesian) internal centers;
    mapping(uint256 => address) internal minerStores;
    mapping(uint256 => address) internal cometStores;
    mapping(uint256 => string) internal names;

    constructor() public {}

    function add(
        uint256 solarSystemId,
        PositionsV2.Cartesian memory center,
        string memory name,
        address minerStore,
        address cometStore
    ) external override onlyModule {
        require(_solarSystemIds.add(solarSystemId), "Store: already exist");
        centers[solarSystemId] = center;
        names[solarSystemId] = name;
        minerStores[solarSystemId] = minerStore;
        cometStores[solarSystemId] = cometStore;
    }

    function remove(uint256 solarSystemId) external override onlyModule {
        require(_solarSystemIds.remove(solarSystemId), "Store: unknown");
    }

    function updateCenter(
        uint256 solarSystemId,
        PositionsV2.Cartesian memory newCenter
    ) external override onlyModule {
        centers[solarSystemId] = newCenter;
    }

    function updateName(uint256 solarSystemId, string memory name)
        external
        override
        onlyModule
    {
        names[solarSystemId] = name;
    }

    function updateMinerStore(uint256 solarSystemId, address minerStore)
        external
        override
        onlyModule
    {
        minerStores[solarSystemId] = minerStore;
    }

    function updateCometStore(uint256 solarSystemId, address cometStore)
        external
        override
        onlyModule
    {
        cometStores[solarSystemId] = cometStore;
    }

    function length() external view override returns (uint256) {
        return _solarSystemIds.length();
    }

    function idAt(uint256 index) external view override returns (uint256) {
        return _solarSystemIds.at(index);
    }

    function ids() external view override returns (uint256[] memory) {
        uint256[] memory result = new uint256[](_solarSystemIds.length());
        for (uint256 i = 0; i < _solarSystemIds.length(); i++) {
            result[i] = _solarSystemIds.at(i);
        }
        return result;
    }

    function contains(uint256 solarSystemId)
        external
        view
        override
        returns (bool)
    {
        return _solarSystemIds.contains(solarSystemId);
    }

    function nameFor(uint256 solarSystemId)
        external
        view
        override
        returns (string memory)
    {
        return names[solarSystemId];
    }

    function centerFor(uint256 solarSystemId)
        external
        view
        override
        returns (PositionsV2.Cartesian memory)
    {
        return centers[solarSystemId];
    }

    function minerStoreFor(uint256 solarSystemId)
        external
        view
        override
        returns (address)
    {
        return minerStores[solarSystemId];
    }

    function cometStoreFor(uint256 solarSystemId)
        external
        view
        override
        returns (address)
    {
        return cometStores[solarSystemId];
    }
}

File 8 of 23 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 9 of 23 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../GSN/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.
 */
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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 10 of 23 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    constructor () internal {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

File 11 of 23 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

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

File 12 of 23 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

File 13 of 23 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

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

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

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

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

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

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

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

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

File 14 of 23 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../../GSN/Context.sol";
import "./IERC721.sol";
import "./IERC721Metadata.sol";
import "./IERC721Enumerable.sol";
import "./IERC721Receiver.sol";
import "../../introspection/ERC165.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
import "../../utils/EnumerableSet.sol";
import "../../utils/EnumerableMap.sol";
import "../../utils/Strings.sol";

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using SafeMath for uint256;
    using Address for address;
    using EnumerableSet for EnumerableSet.UintSet;
    using EnumerableMap for EnumerableMap.UintToAddressMap;
    using Strings for uint256;

    // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
    // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
    bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;

    // Mapping from holder address to their (enumerable) set of owned tokens
    mapping (address => EnumerableSet.UintSet) private _holderTokens;

    // Enumerable mapping from token ids to their owners
    EnumerableMap.UintToAddressMap private _tokenOwners;

    // Mapping from token ID to approved address
    mapping (uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping (address => mapping (address => bool)) private _operatorApprovals;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Optional mapping for token URIs
    mapping (uint256 => string) private _tokenURIs;

    // Base URI
    string private _baseURI;

    /*
     *     bytes4(keccak256('balanceOf(address)')) == 0x70a08231
     *     bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
     *     bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
     *     bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
     *
     *     => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
     *        0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
     */
    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;

    /*
     *     bytes4(keccak256('name()')) == 0x06fdde03
     *     bytes4(keccak256('symbol()')) == 0x95d89b41
     *     bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
     *
     *     => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
     */
    bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;

    /*
     *     bytes4(keccak256('totalSupply()')) == 0x18160ddd
     *     bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
     *     bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
     *
     *     => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
     */
    bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;

        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721);
        _registerInterface(_INTERFACE_ID_ERC721_METADATA);
        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");

        return _holderTokens[owner].length();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory _tokenURI = _tokenURIs[tokenId];

        // If there is no base URI, return the token URI.
        if (bytes(_baseURI).length == 0) {
            return _tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(_tokenURI).length > 0) {
            return string(abi.encodePacked(_baseURI, _tokenURI));
        }
        // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
        return string(abi.encodePacked(_baseURI, tokenId.toString()));
    }

    /**
    * @dev Returns the base URI set via {_setBaseURI}. This will be
    * automatically added as a prefix in {tokenURI} to each token's URI, or
    * to the token ID if no specific URI is set for that token ID.
    */
    function baseURI() public view returns (string memory) {
        return _baseURI;
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
        return _holderTokens[owner].at(index);
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
        return _tokenOwners.length();
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view override returns (uint256) {
        (uint256 tokenId, ) = _tokenOwners.at(index);
        return tokenId;
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return _tokenOwners.contains(tokenId);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     d*
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
        _mint(to, tokenId);
        require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        // Clear metadata (if any)
        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }

        _holderTokens[owner].remove(tokenId);

        _tokenOwners.remove(tokenId);

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal virtual {
        require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _holderTokens[from].remove(tokenId);
        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
        require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
        _tokenURIs[tokenId] = _tokenURI;
    }

    /**
     * @dev Internal function to set the base URI for all token IDs. It is
     * automatically added as a prefix to the value returned in {tokenURI},
     * or to the token ID if {tokenURI} is empty.
     */
    function _setBaseURI(string memory baseURI_) internal virtual {
        _baseURI = baseURI_;
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        private returns (bool)
    {
        if (!to.isContract()) {
            return true;
        }
        bytes memory returndata = to.functionCall(abi.encodeWithSelector(
            IERC721Receiver(to).onERC721Received.selector,
            _msgSender(),
            from,
            tokenId,
            _data
        ), "ERC721: transfer to non ERC721Receiver implementer");
        bytes4 retval = abi.decode(returndata, (bytes4));
        return (retval == _ERC721_RECEIVED);
    }

    function _approve(address to, uint256 tokenId) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}

File 15 of 23 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 16 of 23 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

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

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

File 17 of 23 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

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

File 18 of 23 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data)
    external returns (bytes4);
}

File 19 of 23 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

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

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 20 of 23 : EnumerableMap.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
 * supported.
 */
library EnumerableMap {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct MapEntry {
        bytes32 _key;
        bytes32 _value;
    }

    struct Map {
        // Storage of map keys and values
        MapEntry[] _entries;

        // Position of the entry defined by a key in the `entries` array, plus 1
        // because index 0 means a key is not in the map.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex == 0) { // Equivalent to !contains(map, key)
            map._entries.push(MapEntry({ _key: key, _value: value }));
            // The entry is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            map._indexes[key] = map._entries.length;
            return true;
        } else {
            map._entries[keyIndex - 1]._value = value;
            return false;
        }
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function _remove(Map storage map, bytes32 key) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex != 0) { // Equivalent to contains(map, key)
            // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
            // in the array, and then remove the last entry (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = keyIndex - 1;
            uint256 lastIndex = map._entries.length - 1;

            // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            MapEntry storage lastEntry = map._entries[lastIndex];

            // Move the last entry to the index where the entry to delete is
            map._entries[toDeleteIndex] = lastEntry;
            // Update the index for the moved entry
            map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved entry was stored
            map._entries.pop();

            // Delete the index for the deleted slot
            delete map._indexes[key];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function _contains(Map storage map, bytes32 key) private view returns (bool) {
        return map._indexes[key] != 0;
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function _length(Map storage map) private view returns (uint256) {
        return map._entries.length;
    }

   /**
    * @dev Returns the key-value pair stored at position `index` in the map. O(1).
    *
    * Note that there are no guarantees on the ordering of entries inside the
    * array, and it may change when more entries are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
        require(map._entries.length > index, "EnumerableMap: index out of bounds");

        MapEntry storage entry = map._entries[index];
        return (entry._key, entry._value);
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function _get(Map storage map, bytes32 key) private view returns (bytes32) {
        return _get(map, key, "EnumerableMap: nonexistent key");
    }

    /**
     * @dev Same as {_get}, with a custom error message when `key` is not in the map.
     */
    function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
        uint256 keyIndex = map._indexes[key];
        require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
        return map._entries[keyIndex - 1]._value; // All indexes are 1-based
    }

    // UintToAddressMap

    struct UintToAddressMap {
        Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
        return _set(map._inner, bytes32(key), bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
        return _remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
        return _contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToAddressMap storage map) internal view returns (uint256) {
        return _length(map._inner);
    }

   /**
    * @dev Returns the element stored at position `index` in the set. O(1).
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
        (bytes32 key, bytes32 value) = _at(map._inner, index);
        return (uint256(key), address(uint256(value)));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
        return address(uint256(_get(map._inner, bytes32(key))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     */
    function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
        return address(uint256(_get(map._inner, bytes32(key), errorMessage)));
    }
}

File 21 of 23 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
 * (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(value)));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint256(_at(set._inner, index)));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 22 of 23 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

import "../GSN/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!_paused, "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(_paused, "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 23 of 23 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

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

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

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {
    "/Users/fred/Documents/projets/cometh-game-contracts/contracts/PositionsV2.sol": {
      "PositionsV2": "0x5403F5dedFAA229603cE7d3421F372f57bcA05Bd"
    }
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"newMustManager","type":"address"},{"internalType":"address","name":"newSystemSolarStore","type":"address"},{"internalType":"address","name":"newGateway","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"minerId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"targetId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"solarSystemID","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"newDistance","type":"uint32"},{"indexed":false,"internalType":"int128","name":"newAngle","type":"int128"},{"indexed":false,"internalType":"uint256","name":"updateTime","type":"uint256"}],"name":"Jumped","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"minerId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"PullPriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"uint256","name":"minerId","type":"uint256"},{"internalType":"uint256[]","name":"targetIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"solarSystemID","type":"uint256"}],"name":"batchjump","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minerId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"solarSystemID","type":"uint256"}],"name":"changePullingPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultPullingMinFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultPullingPercentageFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gateway","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"solarSystemID","type":"uint256"}],"name":"getPullingMinFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"solarSystemID","type":"uint256"}],"name":"getPullingPercentageFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"minerId","type":"uint256"},{"internalType":"uint256","name":"targetId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"solarSystemID","type":"uint256"}],"name":"jump","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mustManager","outputs":[{"internalType":"contract MustManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pullingMinFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pullingPercentageFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"solarSystemStore","outputs":[{"internalType":"contract ISolarSystemStore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"updateDefaultPullingMinFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"updateDefaultPullingPercentageFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newFeeReceiver","type":"address"}],"name":"updateFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGateway","type":"address"}],"name":"updateGateway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newMustManager","type":"address"}],"name":"updateMustManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"solarSystemID","type":"uint256"},{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"updateSolarSystemPullingMinFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"solarSystemID","type":"uint256"},{"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"updateSolarSystemPullingPercentageFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newStore","type":"address"}],"name":"updateSolarSystemStore","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052660110d9316ec00060055560056006553480156200002157600080fd5b506040516200417638038062004176833981810160405281019062000047919062000459565b6000620000596200018e60201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35060008060146101000a81548160ff02191690831515021790555062000122836200019660201b60201c565b62000133826200027a60201b60201c565b62000144816200035e60201b60201c565b33600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505062000572565b600033905090565b620001a66200018e60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161462000236576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200022d90620004f1565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6200028a6200018e60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146200031a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200031190620004f1565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6200036e6200018e60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614620003fe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620003f590620004f1565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081519050620004538162000558565b92915050565b6000806000606084860312156200046f57600080fd5b60006200047f8682870162000442565b9350506020620004928682870162000442565b9250506040620004a58682870162000442565b9150509250925092565b6000620004be60208362000513565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b600060208201905081810360008301526200050c81620004af565b9050919050565b600082825260208201905092915050565b6000620005318262000538565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b620005638162000524565b81146200056f57600080fd5b50565b613bf480620005826000396000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c80639bd0c6c3116100f9578063c0346b2011610097578063d0d2150411610071578063d0d2150414610448578063d1ed4c3a14610464578063da32ab6614610480578063f2fde38b146104b0576101a9565b8063c0346b20146103f2578063c69bebe41461040e578063c8825c141461042a576101a9565b80639efc68c9116100d35780639efc68c91461036c578063a4b1580914610388578063a872308a146103b8578063b3f00674146103d4576101a9565b80639bd0c6c3146103165780639c6665d0146103345780639daa0ddb14610350576101a9565b80633f4ba83a1161016657806363a1991a1161014057806363a1991a146102c8578063715018a6146102e45780638456cb59146102ee5780638da5cb5b146102f8576101a9565b80633f4ba83a146102705780635abb30b41461027a5780635c975abb146102aa576101a9565b806310922762146101ae578063116191b6146101cc578063133a5084146101ea5780632722cde314610208578063333f10f21461022457806336ca3c2c14610240575b600080fd5b6101b66104cc565b6040516101c391906136dc565b60405180910390f35b6101d46104f2565b6040516101e191906136c1565b60405180910390f35b6101f2610518565b6040516101ff91906136f7565b60405180910390f35b610222600480360381019061021d9190612e3f565b61053e565b005b61023e60048036038101906102399190612ed2565b610aeb565b005b61025a60048036038101906102559190612ded565b610b9c565b60405161026791906138cb565b60405180910390f35b610278610bd2565b005b610294600480360381019061028f9190612ded565b610c71565b6040516102a191906138cb565b60405180910390f35b6102b2610c89565b6040516102bf91906136a6565b60405180910390f35b6102e260048036038101906102dd9190612ded565b610c9f565b005b6102ec610d3e565b005b6102f6610e91565b005b610300610f30565b60405161030d9190613610565b60405180910390f35b61031e610f59565b60405161032b91906138cb565b60405180910390f35b61034e60048036038101906103499190612f5d565b610f5f565b005b61036a60048036038101906103659190612d20565b611443565b005b61038660048036038101906103819190612d20565b61151c565b005b6103a2600480360381019061039d9190612ded565b6115f5565b6040516103af91906138cb565b60405180910390f35b6103d260048036038101906103cd9190612f0e565b61160d565b005b6103dc611c8a565b6040516103e99190613610565b60405180910390f35b61040c60048036038101906104079190612d20565b611cb0565b005b61042860048036038101906104239190612d20565b611d89565b005b610432611e62565b60405161043f91906138cb565b60405180910390f35b610462600480360381019061045d9190612ed2565b611e68565b005b61047e60048036038101906104799190612ded565b611f19565b005b61049a60048036038101906104959190612ded565b611fb8565b6040516104a791906138cb565b60405180910390f35b6104ca60048036038101906104c59190612d20565b611fee565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b83816000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d8321e9d836040518263ffffffff1660e01b815260040161059d91906138cb565b60206040518083038186803b1580156105b557600080fd5b505afa1580156105c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ed9190612d49565b90508073ffffffffffffffffffffffffffffffffffffffff1663c34052e0846040518263ffffffff1660e01b815260040161062891906138cb565b60206040518083038186803b15801561064057600080fd5b505afa158015610654573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106789190612d72565b6106b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ae90613832565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b815260040161071291906138cb565b60206040518083038186803b15801561072a57600080fd5b505afa15801561073e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107629190612d49565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061087057503373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663081812fc856040518263ffffffff1660e01b815260040161080891906138cb565b60206040518083038186803b15801561082057600080fd5b505afa158015610834573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108589190612d49565b73ffffffffffffffffffffffffffffffffffffffff16145b806109ce5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e985e9c5600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff1660e01b815260040161090f91906138cb565b60206040518083038186803b15801561092757600080fd5b505afa15801561093b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095f9190612d49565b336040518363ffffffff1660e01b815260040161097d92919061367d565b60206040518083038186803b15801561099557600080fd5b505afa1580156109a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cd9190612d72565b5b610a0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0490613812565b60405180910390fd5b8451865114610a51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4890613772565b60405180910390fd5b600a86511115610a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8d90613732565b60405180910390fd5b60005b8651811015610ae157610ad488888381518110610ab257fe5b6020026020010151888481518110610ac657fe5b6020026020010151886121b0565b8080600101915050610a99565b5050505050505050565b610af36128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7790613852565b60405180910390fd5b8060086000848152602001908152602001600020819055505050565b6000806008600084815260200190815260200160002054905060008114610bc65780915050610bcd565b6006549150505b919050565b610bda6128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5e90613852565b60405180910390fd5b610c6f6128c2565b565b60076020528060005260406000206000915090505481565b60008060149054906101000a900460ff16905090565b610ca76128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2b90613852565b60405180910390fd5b8060068190555050565b610d466128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dca90613852565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e996128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1d90613852565b60405180910390fd5b610f2e61296b565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60055481565b83816000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d8321e9d836040518263ffffffff1660e01b8152600401610fbe91906138cb565b60206040518083038186803b158015610fd657600080fd5b505afa158015610fea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100e9190612d49565b90508073ffffffffffffffffffffffffffffffffffffffff1663c34052e0846040518263ffffffff1660e01b815260040161104991906138cb565b60206040518083038186803b15801561106157600080fd5b505afa158015611075573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110999190612d72565b6110d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cf90613832565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b815260040161113391906138cb565b60206040518083038186803b15801561114b57600080fd5b505afa15801561115f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111839190612d49565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061129157503373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663081812fc856040518263ffffffff1660e01b815260040161122991906138cb565b60206040518083038186803b15801561124157600080fd5b505afa158015611255573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112799190612d49565b73ffffffffffffffffffffffffffffffffffffffff16145b806113ef5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e985e9c5600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff1660e01b815260040161133091906138cb565b60206040518083038186803b15801561134857600080fd5b505afa15801561135c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113809190612d49565b336040518363ffffffff1660e01b815260040161139e92919061367d565b60206040518083038186803b1580156113b657600080fd5b505afa1580156113ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ee9190612d72565b5b61142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590613812565b60405180910390fd5b61143a878787876121b0565b50505050505050565b61144b6128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cf90613852565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6115246128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a890613852565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60086020528060005260406000206000915090505481565b82816000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d8321e9d836040518263ffffffff1660e01b815260040161166c91906138cb565b60206040518083038186803b15801561168457600080fd5b505afa158015611698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bc9190612d49565b90508073ffffffffffffffffffffffffffffffffffffffff1663c34052e0846040518263ffffffff1660e01b81526004016116f791906138cb565b60206040518083038186803b15801561170f57600080fd5b505afa158015611723573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117479190612d72565b611786576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177d90613832565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b81526004016117e191906138cb565b60206040518083038186803b1580156117f957600080fd5b505afa15801561180d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118319190612d49565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061193f57503373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663081812fc856040518263ffffffff1660e01b81526004016118d791906138cb565b60206040518083038186803b1580156118ef57600080fd5b505afa158015611903573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119279190612d49565b73ffffffffffffffffffffffffffffffffffffffff16145b80611a9d5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e985e9c5600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff1660e01b81526004016119de91906138cb565b60206040518083038186803b1580156119f657600080fd5b505afa158015611a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2e9190612d49565b336040518363ffffffff1660e01b8152600401611a4c92919061367d565b60206040518083038186803b158015611a6457600080fd5b505afa158015611a78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9c9190612d72565b5b611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad390613812565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d8321e9d866040518263ffffffff1660e01b8152600401611b3991906138cb565b60206040518083038186803b158015611b5157600080fd5b505afa158015611b65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b899190612d49565b90506000611b9686611fb8565b905080871015611bdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd290613872565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16637cf66d5489896040518363ffffffff1660e01b8152600401611c1692919061390f565b600060405180830381600087803b158015611c3057600080fd5b505af1158015611c44573d6000803e3d6000fd5b50505050877f7419f7846de72078c3386fb6428191bad0a45adf769463f2e1f47de8b1d50fd388604051611c7891906138cb565b60405180910390a25050505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611cb86128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3c90613852565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611d916128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611e1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1590613852565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b611e706128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611efd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef490613852565b60405180910390fd5b8060076000848152602001908152602001600020819055505050565b611f216128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611fae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fa590613852565b60405180910390fd5b8060058190555050565b6000806007600084815260200190815260200160002054905060008114611fe25780915050611fe9565b6005549150505b919050565b611ff66128ba565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612083576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207a90613852565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ea90613752565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6121b8612a16565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d8321e9d836040518263ffffffff1660e01b815260040161221591906138cb565b60206040518083038186803b15801561222d57600080fd5b505afa158015612241573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122659190612d49565b90508073ffffffffffffffffffffffffffffffffffffffff1663c34052e0856040518263ffffffff1660e01b81526004016122a091906138cb565b60206040518083038186803b1580156122b857600080fd5b505afa1580156122cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f09190612d72565b61232f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612326906137f2565b60405180910390fd5b600061233a83610b9c565b9050600061234784611fb8565b9050600060648387028161235757fe5b04905081811015612366578190505b60008473ffffffffffffffffffffffffffffffffffffffff1663eee5801c896040518263ffffffff1660e01b81526004016123a191906138cb565b60206040518083038186803b1580156123b957600080fd5b505afa1580156123cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f19190612e16565b9050828110156123ff578290505b808714612441576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612438906137b2565b60405180910390fd5b5061244a612a60565b8473ffffffffffffffffffffffffffffffffffffffff1663f32117ac8a6040518263ffffffff1660e01b815260040161248391906138cb565b60c06040518083038186803b15801561249b57600080fd5b505afa1580156124af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d39190612d9b565b90506124dd612a97565b735403f5dedfaa229603ce7d3421f372f57bca05bd63adc1541d838873ffffffffffffffffffffffffffffffffffffffff1663f32117ac8d6040518263ffffffff1660e01b815260040161253191906138cb565b60c06040518083038186803b15801561254957600080fd5b505afa15801561255d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125819190612d9b565b426040518463ffffffff1660e01b81526004016125a093929190613892565b604080518083038186803b1580156125b757600080fd5b505af41580156125cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125ef9190612dc4565b9050808260200181905250428260600181815250508573ffffffffffffffffffffffffffffffffffffffff1663f55ac2a48b846040518363ffffffff1660e01b815260040161263f9291906138e6565b600060405180830381600087803b15801561265957600080fd5b505af115801561266d573d6000803e3d6000fd5b50505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e8d6040518263ffffffff1660e01b815260040161270b91906138cb565b60206040518083038186803b15801561272357600080fd5b505afa158015612737573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061275b9190612d49565b868c036040518463ffffffff1660e01b815260040161277c93929190613646565b600060405180830381600087803b15801561279657600080fd5b505af11580156127aa573d6000803e3d6000fd5b50505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518463ffffffff1660e01b815260040161282f93929190613646565b600060405180830381600087803b15801561284957600080fd5b505af115801561285d573d6000803e3d6000fd5b50505050888a7f58a1dd579a5a3fffc17bff584401dea8953ad719fda0bcc4f9556573a7ef2ffc85868c038b86600001518760200151426040516128a696959493929190613938565b60405180910390a350505050505050505050565b600033905090565b600060149054906101000a900460ff16612911576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161290890613712565b60405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6129546128ba565b604051612961919061362b565b60405180910390a1565b600060149054906101000a900460ff16156129bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129b2906137d2565b60405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586129ff6128ba565b604051612a0c919061362b565b60405180910390a1565b612a1e610c89565b15612a5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a5590613792565b60405180910390fd5b565b6040518060800160405280612a73612aba565b8152602001612a80612a97565b8152602001600060030b8152602001600081525090565b6040518060400160405280600063ffffffff1681526020016000600f0b81525090565b604051806040016040528060008152602001600081525090565b600081359050612ae381613b1d565b92915050565b600081519050612af881613b1d565b92915050565b600082601f830112612b0f57600080fd5b8135612b22612b1d826139c6565b613999565b91508181835260208401935060208101905083856020840282011115612b4757600080fd5b60005b83811015612b775781612b5d8882612ce1565b845260208401935060208301925050600181019050612b4a565b5050505092915050565b600081519050612b9081613b34565b92915050565b600081519050612ba581613b4b565b92915050565b600081519050612bba81613b62565b92915050565b600081519050612bcf81613b79565b92915050565b600060408284031215612be757600080fd5b612bf16040613999565b90506000612c0184828501612bab565b6000830152506020612c1584828501612bab565b60208301525092915050565b600060c08284031215612c3357600080fd5b612c3d6080613999565b90506000612c4d84828501612bd5565b6000830152506040612c6184828501612c95565b6020830152506080612c7584828501612bc0565b60408301525060a0612c8984828501612cf6565b60608301525092915050565b600060408284031215612ca757600080fd5b612cb16040613999565b90506000612cc184828501612d0b565b6000830152506020612cd584828501612b96565b60208301525092915050565b600081359050612cf081613b90565b92915050565b600081519050612d0581613b90565b92915050565b600081519050612d1a81613ba7565b92915050565b600060208284031215612d3257600080fd5b6000612d4084828501612ad4565b91505092915050565b600060208284031215612d5b57600080fd5b6000612d6984828501612ae9565b91505092915050565b600060208284031215612d8457600080fd5b6000612d9284828501612b81565b91505092915050565b600060c08284031215612dad57600080fd5b6000612dbb84828501612c21565b91505092915050565b600060408284031215612dd657600080fd5b6000612de484828501612c95565b91505092915050565b600060208284031215612dff57600080fd5b6000612e0d84828501612ce1565b91505092915050565b600060208284031215612e2857600080fd5b6000612e3684828501612cf6565b91505092915050565b60008060008060808587031215612e5557600080fd5b6000612e6387828801612ce1565b945050602085013567ffffffffffffffff811115612e8057600080fd5b612e8c87828801612afe565b935050604085013567ffffffffffffffff811115612ea957600080fd5b612eb587828801612afe565b9250506060612ec687828801612ce1565b91505092959194509250565b60008060408385031215612ee557600080fd5b6000612ef385828601612ce1565b9250506020612f0485828601612ce1565b9150509250929050565b600080600060608486031215612f2357600080fd5b6000612f3186828701612ce1565b9350506020612f4286828701612ce1565b9250506040612f5386828701612ce1565b9150509250925092565b60008060008060808587031215612f7357600080fd5b6000612f8187828801612ce1565b9450506020612f9287828801612ce1565b9350506040612fa387828801612ce1565b9250506060612fb487828801612ce1565b91505092959194509250565b612fc981613a7b565b82525050565b612fd8816139ff565b82525050565b612fe781613a11565b82525050565b612ff681613a8d565b82525050565b61300581613ab1565b82525050565b61301481613ad5565b82525050565b61302381613a1d565b82525050565b61303281613a1d565b82525050565b61304181613a1d565b82525050565b61305081613a2a565b82525050565b61305f81613a2a565b82525050565b61306e81613a34565b82525050565b61307d81613a34565b82525050565b60006130906014836139ee565b91507f5061757361626c653a206e6f74207061757365640000000000000000000000006000830152602082019050919050565b60006130d0601a836139ee565b91507f4a756d704d616e616765723a206c696d6974656420746f2031300000000000006000830152602082019050919050565b60006131106026836139ee565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006131766029836139ee565b91507f4a756d704d616e616765723a206d69736d61746368207461726765747320616e60008301527f6420616d6f756e747300000000000000000000000000000000000000000000006020830152604082019050919050565b60006131dc6013836139ee565b91507f4a756d704d616e616765723a20706175736564000000000000000000000000006000830152602082019050919050565b600061321c6036836139ee565b91507f4a756d704d616e616765723a206a756d7020616d6f756e74206469666665726560008301527f6e74207468616e207265717569726564207072696365000000000000000000006020830152604082019050919050565b60006132826010836139ee565b91507f5061757361626c653a20706175736564000000000000000000000000000000006000830152602082019050919050565b60006132c2601a836139ee565b91507f4a756d704d616e616765723a20756e6b6e6f77207461726765740000000000006000830152602082019050919050565b60006133026026836139ee565b91507f4a756d704d616e616765723a2072657175697265206f776e6572206f7220617060008301527f70726f76656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613368601a836139ee565b91507f4a756d704d616e616765723a20756e6b6e6f776e206d696e65720000000000006000830152602082019050919050565b60006133a86020836139ee565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006133e86022836139ee565b91507f4a756d704d616e616765723a2070756c6c696e6720707269636520746f6f206c60008301527f6f770000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6040820160008201516134576000850182613047565b50602082015161346a6020850182613047565b50505050565b6040820160008201516134866000850182613056565b5060208201516134996020850182613056565b50505050565b60c0820160008201516134b56000850182613441565b5060208201516134c86040850182613549565b5060408201516134db6080850182613065565b5060608201516134ee60a08501826135a7565b50505050565b60c08201600082015161350a6000850182613470565b50602082015161351d6040850182613578565b5060408201516135306080850182613074565b50606082015161354360a08501826135d4565b50505050565b60408201600082015161355f60008501826135e3565b506020820151613572602085018261301a565b50505050565b60408201600082015161358e6000850182613601565b5060208201516135a16020850182613038565b50505050565b6135b081613a61565b82525050565b6135bf81613a61565b82525050565b6135ce81613a61565b82525050565b6135dd81613a61565b82525050565b6135ec81613a6b565b82525050565b6135fb81613a6b565b82525050565b61360a81613a6b565b82525050565b60006020820190506136256000830184612fcf565b92915050565b60006020820190506136406000830184612fc0565b92915050565b600060608201905061365b6000830186612fc0565b6136686020830185612fcf565b61367560408301846135b6565b949350505050565b60006040820190506136926000830185612fcf565b61369f6020830184612fc0565b9392505050565b60006020820190506136bb6000830184612fde565b92915050565b60006020820190506136d66000830184612fed565b92915050565b60006020820190506136f16000830184612ffc565b92915050565b600060208201905061370c600083018461300b565b92915050565b6000602082019050818103600083015261372b81613083565b9050919050565b6000602082019050818103600083015261374b816130c3565b9050919050565b6000602082019050818103600083015261376b81613103565b9050919050565b6000602082019050818103600083015261378b81613169565b9050919050565b600060208201905081810360008301526137ab816131cf565b9050919050565b600060208201905081810360008301526137cb8161320f565b9050919050565b600060208201905081810360008301526137eb81613275565b9050919050565b6000602082019050818103600083015261380b816132b5565b9050919050565b6000602082019050818103600083015261382b816132f5565b9050919050565b6000602082019050818103600083015261384b8161335b565b9050919050565b6000602082019050818103600083015261386b8161339b565b9050919050565b6000602082019050818103600083015261388b816133db565b9050919050565b60006101a0820190506138a860008301866134f4565b6138b560c08301856134f4565b6138c36101808301846135c5565b949350505050565b60006020820190506138e060008301846135b6565b92915050565b600060e0820190506138fb60008301856135b6565b613908602083018461349f565b9392505050565b600060408201905061392460008301856135b6565b61393160208301846135b6565b9392505050565b600060c08201905061394d60008301896135b6565b61395a60208301886135b6565b61396760408301876135b6565b61397460608301866135f2565b6139816080830185613029565b61398e60a08301846135b6565b979650505050505050565b6000604051905081810181811067ffffffffffffffff821117156139bc57600080fd5b8060405250919050565b600067ffffffffffffffff8211156139dd57600080fd5b602082029050602081019050919050565b600082825260208201905092915050565b6000613a0a82613a41565b9050919050565b60008115159050919050565b600081600f0b9050919050565b6000819050919050565b60008160030b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b6000613a8682613af9565b9050919050565b6000613a9882613a9f565b9050919050565b6000613aaa82613a41565b9050919050565b6000613abc82613ac3565b9050919050565b6000613ace82613a41565b9050919050565b6000613ae082613ae7565b9050919050565b6000613af282613a41565b9050919050565b6000613b0482613b0b565b9050919050565b6000613b1682613a41565b9050919050565b613b26816139ff565b8114613b3157600080fd5b50565b613b3d81613a11565b8114613b4857600080fd5b50565b613b5481613a1d565b8114613b5f57600080fd5b50565b613b6b81613a2a565b8114613b7657600080fd5b50565b613b8281613a34565b8114613b8d57600080fd5b50565b613b9981613a61565b8114613ba457600080fd5b50565b613bb081613a6b565b8114613bbb57600080fd5b5056fea26469706673582212204ac6565af7a0b3781db8f5a60925c48593697f452aafa3cd57f0eb73307034c864736f6c634300060c00330000000000000000000000009000c901bc55cb44c9a2c84cf96e8e0bd317760d000000000000000000000000f492368ed2d3f73451c2b2f39c0d8ad6714dba30000000000000000000000000e07eafe9ffc1363b6c4c466837a08aced54f9df9

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000009000c901bc55cb44c9a2c84cf96e8e0bd317760d000000000000000000000000f492368ed2d3f73451c2b2f39c0d8ad6714dba30000000000000000000000000e07eafe9ffc1363b6c4c466837a08aced54f9df9

-----Decoded View---------------
Arg [0] : newMustManager (address): 0x9000c901bc55cb44c9a2c84cf96e8e0bd317760d
Arg [1] : newSystemSolarStore (address): 0xf492368ed2d3f73451c2b2f39c0d8ad6714dba30
Arg [2] : newGateway (address): 0xe07eafe9ffc1363b6c4c466837a08aced54f9df9

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000009000c901bc55cb44c9a2c84cf96e8e0bd317760d
Arg [1] : 000000000000000000000000f492368ed2d3f73451c2b2f39c0d8ad6714dba30
Arg [2] : 000000000000000000000000e07eafe9ffc1363b6c4c466837a08aced54f9df9


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