Contract 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e 2

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x42089241316052b55fd36bb2dfa044457bb09b9cf764dbcbe2c999351c466e5dSafe Transfer Fr...438435342022-12-05 15:34:212 mins ago0x16abfcc4a99922355a8939cfdce4f1879fb3f3da IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00005337
0xf7497a0300717533e22315ea249dbd0c301099708b2021852b05da557316dc76Safe Transfer Fr...438427602022-12-05 15:31:026 mins ago0x16abfcc4a99922355a8939cfdce4f1879fb3f3da IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00004755
0xc91f500560577e2cd255fdbc0d086af3c21f070983166c06f5887fbd467690a9Set Approval For...437781732022-12-05 10:48:234 hrs 48 mins ago0x1b9630589574c452b6a7827d040881b91588c04e IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002281
0x89d57f1153c711d313e02599cc5628a9f1b25e4a9ce1284930c29c62f5a18957Set Approval For...437458802022-12-05 7:54:017 hrs 43 mins ago0x0e204e46a52f1c701e54efd525062a4da96f2b59 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002048
0x642c7635328ede668fa50dd6dc7a5bf63b03bb760755589322ce6e1c0292ce7dSafe Transfer Fr...437426972022-12-05 7:36:018 hrs 1 min ago0x61de30cf9a0230aa3aa571ce6385e6f939c85d90 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002956
0x1de324b41558eb6c79829622817981e09669ba5114ca89e3f7d84728af4ac619Safe Transfer Fr...437397032022-12-05 7:18:008 hrs 19 mins ago0x2116e08647739670136075dcb31d5b311923b3ef IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.0000274
0x3fd4a7b0ad6cdf8c71451cd53f27beda1f0a30da16416e7ed3472f5588abf241Safe Transfer Fr...437395652022-12-05 7:17:088 hrs 20 mins ago0x2116e08647739670136075dcb31d5b311923b3ef IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002844
0x30c489a17681589ad177e9da85b042eddd567617144a446c02305892c22a86e6Safe Transfer Fr...437352762022-12-05 6:52:258 hrs 44 mins ago0x2116e08647739670136075dcb31d5b311923b3ef IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002905
0x35a16b23b78075f886e9580b0e6de78e5f58cb48ef0cadf89f47fe942a425172Safe Transfer Fr...437350422022-12-05 6:51:078 hrs 46 mins ago0x2116e08647739670136075dcb31d5b311923b3ef IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002905
0xcf9aa36491695e29bc57d59c79f6959c2780c489fde97625027c673727086adeSet Approval For...436693432022-12-04 23:36:0616 hrs 1 min ago0x13ee72f78114018ab032e59f4ea2943816e1867b IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00001954
0xf1b64ae6435ede3bccb4915e5e2847ddecf9965b8722e5458629870e002a8331Set Approval For...436638742022-12-04 22:51:3316 hrs 45 mins ago0x5458a306b6088d5c641e0dae2a234fcd6c592075 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00001999
0xa4952d98bb80c92f4a23f914ad7ad90ff4f7883f39dd2fee3d781baab596c892Set Approval For...436266452022-12-04 19:19:3920 hrs 17 mins ago0x366e9a0428599925ff23568d5b66a1353e704615 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002057
0x240cda753b1d7dca5e6a87ec3f23c798afb04a1dcc4ad2c83981548fee56ee87Set Approval For...436159342022-12-04 18:30:0421 hrs 7 mins ago0xe0d432e1e450f312182924dbf2ef72b7738e6813 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002146
0x550416fe30d2064fe5d2593159df731486e5cbe06a27fb769c3cdaf810788499Set Approval For...433525732022-12-03 20:12:461 day 19 hrs ago0x9d8825c26e48b1071c3a7a5eb41d66aa87e951ba IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.0000196
0xea2d63eaf4f38594c9aad09b844efbf69bfb33dafd7e7bb49148842c7893ac7fSet Approval For...433134212022-12-03 16:55:161 day 22 hrs ago0x25e0caed0174f9c26dca200a6b6ddeef2eb448ac IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00001789
0xbaed84405174ec3b0ecd548cf0f0575111df5922cb5484706517f3d26262ff0aSet Approval For...432824142022-12-03 14:37:362 days 59 mins ago0xd0d472bbe7afd16cde245f5f600b857c2cc64576 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002211
0xb45bc7eb2322ade86e0cf014e7fa0fb8467152f53fc1331330f6768a6d213fa7Set Approval For...432044392022-12-03 8:41:122 days 6 hrs ago0xc8cdef7a03cbc43619c5d669041b60da9138e70a IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00001814
0xa066c3b2469461d531e40f28089c9db1695c9a89377651ff290aaab932cbcc55Safe Transfer Fr...431803042022-12-03 6:46:522 days 8 hrs ago0xa007a78e260c563e2b9a07930169e8c47dfd27b9 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002999
0x5ea3071c52b3295132a7b437014d8960c816262e7b51b38b1e9560555aee1c23Safe Transfer Fr...431791882022-12-03 6:41:142 days 8 hrs ago0xa007a78e260c563e2b9a07930169e8c47dfd27b9 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002999
0x0785c2c39d77f2e6395c162923b4aa08af187da6b24eebd74b0f3f9f30304780Set Approval For...430547242022-12-02 18:26:532 days 21 hrs ago0x542a19c328650051733ddae1794addaf8670b8c3 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002442
0x03a3c3fa3639bb27ae6a2d59e368dbcd0d5d44eb854a8f5a4ff22e64baa81234Safe Transfer Fr...429135272022-12-02 7:24:143 days 8 hrs ago0xfcd7dc740b59c543eb79c7d8035e94638155ffa6 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002625
0xcba2993396b307fc2ef4bdf6d9dcd77c1df68a587dca86d5993299d9faf6eef7Set Approval For...427542352022-12-01 16:32:533 days 23 hrs ago0xce4572c5de83733805a051b4eee288ddb743fb42 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002261
0x8c5fa9cfee26fc8f49cc5eadbec8377c89fa31e969fa36309febfac94e92eac4Safe Transfer Fr...427198112022-12-01 13:56:344 days 1 hr ago0x63fad05c967a32ee9c8eab6507259494d9c3d5ca IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002722
0xa91605074a43c240fbd13e45b38c0c0e0d010129a3fd1729f4603de5c45fa4c4Set Approval For...422057222022-11-29 16:29:095 days 23 hrs ago0x8ee4e6a46cf432f127aee1475bcb083b3ec2c639 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00002291
0x3c2e59797d71459161603307f1425582cd2654284026127dbe574320da575e37Set Approval For...421608172022-11-29 13:10:456 days 2 hrs ago0xb2eca6156c7625a9d2b9bbac8c6ec9ae4afc3556 IN  0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH0.00001839
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x42089241316052b55fd36bb2dfa044457bb09b9cf764dbcbe2c999351c466e5d438435342022-12-05 15:34:212 mins ago 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e 0x1a8b020f621a43abb0ee600b3a38b5b40b7506560 ETH
0xf7497a0300717533e22315ea249dbd0c301099708b2021852b05da557316dc76438427602022-12-05 15:31:026 mins ago 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e 0x1a8b020f621a43abb0ee600b3a38b5b40b7506560 ETH
0x85b29b0eab15385ed1a4ba600e04292a6d98edc2a565f8be80119f80af721227438406872022-12-05 15:21:5215 mins ago 0x09986b4e255b3c548041a30a2ee312fe176731c2 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x85b29b0eab15385ed1a4ba600e04292a6d98edc2a565f8be80119f80af721227438406872022-12-05 15:21:5215 mins ago 0x09986b4e255b3c548041a30a2ee312fe176731c2 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x132774eed8ecc614a102151fd9d34d81ba7e8be5 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x132774eed8ecc614a102151fd9d34d81ba7e8be5 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e 0x132774eed8ecc614a102151fd9d34d81ba7e8be50 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0xfeb459043d69757fb7b0ccf8ffa7cca752b0666f 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0xfeb459043d69757fb7b0ccf8ffa7cca752b0666f 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x132774eed8ecc614a102151fd9d34d81ba7e8be5 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x132774eed8ecc614a102151fd9d34d81ba7e8be5 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e 0x132774eed8ecc614a102151fd9d34d81ba7e8be50 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0xfeb459043d69757fb7b0ccf8ffa7cca752b0666f 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0xfeb459043d69757fb7b0ccf8ffa7cca752b0666f 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x132774eed8ecc614a102151fd9d34d81ba7e8be5 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x132774eed8ecc614a102151fd9d34d81ba7e8be5 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e 0x132774eed8ecc614a102151fd9d34d81ba7e8be50 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0xfeb459043d69757fb7b0ccf8ffa7cca752b0666f 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0xfeb459043d69757fb7b0ccf8ffa7cca752b0666f 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x132774eed8ecc614a102151fd9d34d81ba7e8be5 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x132774eed8ecc614a102151fd9d34d81ba7e8be5 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e 0x132774eed8ecc614a102151fd9d34d81ba7e8be50 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0xfeb459043d69757fb7b0ccf8ffa7cca752b0666f 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0xfeb459043d69757fb7b0ccf8ffa7cca752b0666f 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
0x0cca8d6ae5e295c8c5ba78e202015f8eb6e77699d04cf1e68e3c969d6985fe7a438377622022-12-05 15:09:1628 mins ago 0x132774eed8ecc614a102151fd9d34d81ba7e8be5 0x9b7723244b62b49b57092aa8003fe8f49e0fd91e0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Sharks

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 20 : Sharks.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/utils/Strings.sol";

import "./SharksAccessControl.sol";
import "./SharksTransferControl.sol";
import "./SharksSizeControl.sol";


contract Sharks is ERC721, ERC721Enumerable, SharksAccessControl {
    using Counters for Counters.Counter;
    Counters.Counter private tokenIdTracker;

    string public baseURI;

    uint256 public immutable MAX_SUPPLY;
    uint256 public immutable INITIAL_XP;

    uint256 public totalSharksSize;

    SharksTransferControl public sharksTransferControl;
    SharksSizeControl public sharksSizeControl;

    mapping(uint256 => uint256) public xp;
    mapping(uint256 => uint256) public rarity;

    event Minted(address indexed to, uint256 indexed tokenId);
    event Revealed(uint256 indexed tokenId, uint256 rarity);
    event XpIncreased(uint256 indexed tokenId, uint256 xpIncrease, uint256 totalXp);

    event BaseURIChanged(string baseURI);
    event SharksSizeControlChanged(address sharksSizeControl);
    event SharksTransferControlChanged(address sharksTransferControl);

    constructor(uint256 maxSupply_) ERC721("Smol Sharks", "SMOLSHARKS") {
        MAX_SUPPLY = maxSupply_;
        INITIAL_XP = 1;
    }


    // internal
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    function _beforeTokenTransfer(address from_, address to_, uint256 tokenId_)
        internal
        override(ERC721, ERC721Enumerable)
    {
        require(sharkCanBeTransferred(tokenId_) == true, "SharksTransferControl: transfer not allowed");

        super._beforeTokenTransfer(from_, to_, tokenId_);
    }

    // onlyOwner

    function setSharksSizeControl(address sharksSizeControl_)
        public
        onlyOwner
    {
        sharksSizeControl = SharksSizeControl(sharksSizeControl_);
        emit SharksSizeControlChanged(sharksSizeControl_);
    }

    function setSharksTransferControl(address sharksTransferControl_)
        public
        onlyOwner
    {
        sharksTransferControl = SharksTransferControl(sharksTransferControl_);
        emit SharksTransferControlChanged(sharksTransferControl_);
    }

    function setBaseURI(string memory baseURI_)
        public
        onlyOwner
    {
        baseURI = baseURI_;
        emit BaseURIChanged(baseURI);
    }


    // onlyMinter

    function mint(
        address to_,
        uint256 mintsCount_
    )
        public
        onlyMinter
    {
        uint256 _actualMintsCount = Math.min(mintsCount_, MAX_SUPPLY - tokenIdTracker.current());

        require(_actualMintsCount > 0, "MAX_SUPPLY reached");

        for (uint256 i = 0; i < _actualMintsCount; i++) {
            tokenIdTracker.increment();

            uint256 _tokenId = tokenIdTracker.current();

            require(_tokenId <= MAX_SUPPLY, "MAX_SUPPLY reached"); // sanity check, should not ever trigger

            _safeMint(to_, _tokenId);
            emit Minted(to_, _tokenId);
        }
    }

    // onlyRevealer

    function reveal(
        uint256 tokenId_,
        uint256 rarity_
    )
        public
        onlyRevealer
    {
        _requireMinted(tokenId_);
        require(rarity[tokenId_] == 0, "already revealed");

        rarity[tokenId_] = rarity_;
        emit Revealed(tokenId_, rarity_);
        _increaseXp(tokenId_, INITIAL_XP);
    }



    // onlyXpManager

    function increaseXp(uint tokenId_, uint xp_)
        public
        onlyXpManager
    {
        _requireMinted(tokenId_);
        _increaseXp(tokenId_, xp_);
    }

    function _increaseXp(uint tokenId_, uint xp_)
        internal
    {
        totalSharksSize += xp_;
        xp[tokenId_] += xp_;
        emit XpIncreased(tokenId_, xp_, xp[tokenId_]);
    }


    // Views

    function sharkCanBeTransferred(uint256 tokenId_)
        public
        view
        returns (bool)
    {
        if (address(sharksTransferControl) != address(0)) {
            return (sharksTransferControl.sharkCanBeTransferred(tokenId_) == true);
        } else {
            return true;
        }
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721, ERC721Enumerable, AccessControl)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }

    function _baseURI() internal view override returns (string memory) {
        return baseURI;
    }

    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override
        returns (string memory)
    {
        _requireMinted(tokenId);

        require(bytes(_baseURI()).length > 0, "baseURI not set");

        string memory tokenFilename = rarity[tokenId] > 0 ? Strings.toString(tokenId) : "0";

        return string(abi.encodePacked(_baseURI(), tokenFilename, ".json"));
    }

    function size(uint256 tokenId_)
        public
        view
        returns (uint256)
    {
        _requireMinted(tokenId_);

        if(address(sharksSizeControl) != address(0)) {
            return sharksSizeControl.sharkSize(tokenId_);
        } else {
            return 0;
        }
    }
}

File 2 of 20 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

File 3 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 4 of 20 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant alphabet = "0123456789abcdef";

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

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = alphabet[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

}

File 6 of 20 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }
}

File 7 of 20 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 8 of 20 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        // 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");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

File 9 of 20 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

File 10 of 20 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

File 11 of 20 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC721Enumerable).interfaceId
            || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @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 override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

File 12 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.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 13 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping (uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping (address => uint256) private _balances;

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

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

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC721).interfaceId
            || interfaceId == type(IERC721Metadata).interfaceId
            || super.supportsInterface(interfaceId);
    }

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

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

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

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

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0
            ? string(abi.encodePacked(baseURI, tokenId.toString()))
            : '';
    }

    /**
     * @dev Base URI for computing {tokenURI}. Empty by default, can be overriden
     * in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.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 virtual 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 virtual 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 virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

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

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `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);

        _balances[to] += 1;
        _owners[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 = ERC721.ownerOf(tokenId);

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

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

        _balances[owner] -= 1;
        delete _owners[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(ERC721.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);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @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()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    // solhint-disable-next-line no-inline-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @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 20 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        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 16 of 20 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    function hasRole(bytes32 role, address account) external view returns (bool);
    function getRoleAdmin(bytes32 role) external view returns (bytes32);
    function grantRole(bytes32 role, address account) external;
    function revokeRole(bytes32 role, address account) external;
    function renounceRole(bytes32 role, address account) external;
}

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping (address => bool) members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId
            || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if(!hasRole(role, account)) {
            revert(string(abi.encodePacked(
                "AccessControl: account ",
                Strings.toHexString(uint160(account), 20),
                " is missing role ",
                Strings.toHexString(uint256(role), 32)
            )));
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, getRoleAdmin(role), adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 17 of 20 : SharksTransferControl.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.9;
import "./SharksStaking.sol";

contract SharksTransferControl {
    SharksStaking public sharksStaking;

    constructor(address sharksStakingAddress_) {
        sharksStaking = SharksStaking(sharksStakingAddress_);
    }

    function sharkCanBeTransferred(uint tokenId_) public view returns (bool) {
        return sharksStaking.sharkCanBeTransferred(tokenId_);
    }
}

File 18 of 20 : SharksStaking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "./Sharks.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";

contract SharksStaking is Ownable {
    Sharks public sharks;

    uint256 public constant DAY = 1 days;
    uint256 public xpPerDay;
    uint256 public maxStakeDaysCount;
    mapping(uint256 => uint256) public stakedUntil;

    event Staked(uint256 indexed tokenId, uint256 until);
    event Restaked(uint256 indexed tokenId, uint256 until);
    event Unstaked(uint256 indexed tokenId);
    event XpPerDayChanged(uint256 xpPerDay);
    event MaxStakeDaysCountChanged(uint256 maxStakeDaysCount);

    modifier onlySharkOwner(uint256 tokenId_) {
        require(sharks.ownerOf(tokenId_) == msg.sender, "You do not own this shark");
        _;
    }

    constructor(address sharksAddress_) {
        sharks = Sharks(sharksAddress_);
        xpPerDay = 192; // sharks cruise at 8km/h
        maxStakeDaysCount = 365;
    }

    function stake(uint256 tokenId_, uint256 daysCount_) external onlySharkOwner(tokenId_) {
        require(daysCount_ > 0, "must stake in the future");
        require(daysCount_ <= maxStakeDaysCount, "cannot stake for more than maxStakeDaysCount");

        if (stakedUntil[tokenId_] == 0) {
            sharks.increaseXp(tokenId_, daysCount_ * xpPerDay);
            stakedUntil[tokenId_] = block.timestamp + daysCount_ * DAY;
            emit Staked(tokenId_, stakedUntil[tokenId_]);
        } else {
            // Rounded towards 0, meaning 23:59 counts as 0 days.
            uint256 _stakedUntilInDays = (stakedUntil[tokenId_] - block.timestamp) / DAY;

            // Since we're restaking, maxStakeDaysCount should be 365-1=364
            uint256 _actualMaxStakeDaysCount = maxStakeDaysCount - _stakedUntilInDays - 1;

            uint256 _actualDaysCount = Math.min(daysCount_, _actualMaxStakeDaysCount);

            sharks.increaseXp(tokenId_, _actualDaysCount * xpPerDay);
            stakedUntil[tokenId_] += _actualDaysCount * DAY;
            emit Restaked(tokenId_, stakedUntil[tokenId_]);
        }
    }

    function unstake(uint256 tokenId_) external onlySharkOwner(tokenId_) {
        require(block.timestamp >= stakedUntil[tokenId_], "cannot unstake yet");

        stakedUntil[tokenId_] = 0;

        emit Unstaked(tokenId_);
    }

    function setXpPerDay(uint256 xpPerDay_) external onlyOwner {
        xpPerDay = xpPerDay_;
        emit XpPerDayChanged(xpPerDay);
    }

    function setMaxStakeDaysCount(uint256 maxStakeDaysCount_) external onlyOwner {
        maxStakeDaysCount = maxStakeDaysCount_;
        emit MaxStakeDaysCountChanged(maxStakeDaysCount);
    }

    function sharkCanBeTransferred(uint tokenId_) public view returns (bool) {
        if (stakedUntil[tokenId_] == 0) {
            return true;
        } else {
            return false;
        }
    }

}

File 19 of 20 : SharksSizeControl.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.9;
import "./Sharks.sol";

contract SharksSizeControl {
    Sharks public sharks;

    constructor(address sharksAddress_) {
        sharks = Sharks(sharksAddress_);
    }

    function sharkSize(uint tokenId_) public view returns (uint256) {
        return sharks.xp(tokenId_) * sharks.rarity(tokenId_);
    }
}

File 20 of 20 : SharksAccessControl.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.9;

import "@openzeppelin/contracts/access/AccessControl.sol";

abstract contract SharksAccessControl is AccessControl {
    bytes32 public constant OWNER_ROLE = keccak256("OWNER_ROLE");
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant REVEALER_ROLE = keccak256("REVEALER_ROLE");
    bytes32 public constant XP_MANAGER_ROLE = keccak256("XP_MANAGER_ROLE");

    modifier onlyOwner() {
        require(hasRole(OWNER_ROLE, _msgSender()), "SharksAccessControl: no OWNER_ROLE");
        _;
    }

    modifier onlyMinter() {
        require(isMinter(_msgSender()), "SharksAccessControl: no MINTER_ROLE");
        _;
    }

    modifier onlyRevealer() {
        require(isRevealer(_msgSender()), "SharksAccessControl: no REVEALER_ROLE");
        _;
    }

    modifier onlyXpManager() {
        require(isXpManager(_msgSender()), "SharksAccessControl: no XP_MANAGER_ROLE");
        _;
    }


    constructor() {
        _setRoleAdmin(OWNER_ROLE, OWNER_ROLE);
        _setRoleAdmin(MINTER_ROLE, OWNER_ROLE);
        _setRoleAdmin(REVEALER_ROLE, OWNER_ROLE);
        _setRoleAdmin(XP_MANAGER_ROLE, OWNER_ROLE);

        _setupRole(OWNER_ROLE, _msgSender());
    }

    function grantOwner(address _owner) external onlyOwner {
        grantRole(OWNER_ROLE, _owner);
    }

    function grantXpManager(address _xpManager) external onlyOwner {
        grantRole(XP_MANAGER_ROLE, _xpManager);
    }

    function grantMinter(address _minter) external onlyOwner {
        grantRole(MINTER_ROLE, _minter);
    }
    function grantRevealer(address _revealer) external onlyOwner {
        grantRole(REVEALER_ROLE, _revealer);
    }

    function revokeOwner(address _owner) external onlyOwner {
        revokeRole(OWNER_ROLE, _owner);
    }

    function revokeXpManager(address _xpManager) external onlyOwner {
        revokeRole(XP_MANAGER_ROLE, _xpManager);
    }

    function revokeMinter(address _minter) external onlyOwner {
        revokeRole(MINTER_ROLE, _minter);
    }

    function revokeRevealer(address _revealer) external onlyOwner {
        revokeRole(REVEALER_ROLE, _revealer);
    }

    function isOwner(address _owner) public view returns (bool) {
        return hasRole(OWNER_ROLE, _owner);
    }

    function isXpManager(address _xpManager) public view returns (bool) {
        return hasRole(XP_MANAGER_ROLE, _xpManager);
    }

    function isRevealer(address _revealer) public view returns (bool) {
        return hasRole(REVEALER_ROLE, _revealer);
    }

    function isMinter(address _minter) public view returns (bool) {
        return hasRole(MINTER_ROLE, _minter);
    }

}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "evmVersion": "london",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"maxSupply_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"baseURI","type":"string"}],"name":"BaseURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rarity","type":"uint256"}],"name":"Revealed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sharksSizeControl","type":"address"}],"name":"SharksSizeControlChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sharksTransferControl","type":"address"}],"name":"SharksTransferControlChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"xpIncrease","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalXp","type":"uint256"}],"name":"XpIncreased","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INITIAL_XP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OWNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REVEALER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"XP_MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"grantMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"grantOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_revealer","type":"address"}],"name":"grantRevealer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_xpManager","type":"address"}],"name":"grantXpManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"xp_","type":"uint256"}],"name":"increaseXp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"isMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_revealer","type":"address"}],"name":"isRevealer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_xpManager","type":"address"}],"name":"isXpManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"mintsCount_","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rarity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"rarity_","type":"uint256"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"revokeMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"revokeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_revealer","type":"address"}],"name":"revokeRevealer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_xpManager","type":"address"}],"name":"revokeXpManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sharksSizeControl_","type":"address"}],"name":"setSharksSizeControl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sharksTransferControl_","type":"address"}],"name":"setSharksTransferControl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"sharkCanBeTransferred","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sharksSizeControl","outputs":[{"internalType":"contract SharksSizeControl","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sharksTransferControl","outputs":[{"internalType":"contract SharksTransferControl","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"size","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSharksSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"xp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b5060405162005fdd38038062005fdd833981810160405281019062000037919062000541565b6040518060400160405280600b81526020017f536d6f6c20536861726b730000000000000000000000000000000000000000008152506040518060400160405280600a81526020017f534d4f4c534841524b53000000000000000000000000000000000000000000008152508160009080519060200190620000bb92919062000451565b508060019080519060200190620000d492919062000451565b505050620001097fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e806200025860201b60201c565b6200015b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a67fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6200025860201b60201c565b620001ad7f7eedb2e31886aee6b48ad5b19b07b41f829d56c86a5c8a5cc10a185aeed929047fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6200025860201b60201c565b620001ff7f41c4b6457a1878387b597bb2a052bcee5631e58e437f46642248fb614daa0e417fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6200025860201b60201c565b620002407fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e62000234620002b660201b60201c565b620002be60201b60201c565b8060808181525050600160a0818152505050620005d8565b806200026a83620002d460201b60201c565b837fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff60405160405180910390a480600a6000848152602001908152602001600020600101819055505050565b600033905090565b620002d08282620002f460201b60201c565b5050565b6000600a6000838152602001908152602001600020600101549050919050565b620003068282620003e660201b60201c565b620003e2576001600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555062000387620002b660201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b8280546200045f90620005a2565b90600052602060002090601f016020900481019282620004835760008555620004cf565b82601f106200049e57805160ff1916838001178555620004cf565b82800160010185558215620004cf579182015b82811115620004ce578251825591602001919060010190620004b1565b5b509050620004de9190620004e2565b5090565b5b80821115620004fd576000816000905550600101620004e3565b5090565b600080fd5b6000819050919050565b6200051b8162000506565b81146200052757600080fd5b50565b6000815190506200053b8162000510565b92915050565b6000602082840312156200055a576200055962000501565b5b60006200056a848285016200052a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620005bb57607f821691505b60208210811415620005d257620005d162000573565b5b50919050565b60805160a0516159ca6200061360003960008181610da00152611b8601526000818161112f0152818161123501526112cd01526159ca6000f3fe608060405234801561001057600080fd5b50600436106103425760003560e01c806385edea13116101b8578063b88d4fde11610104578063d547741f116100a2578063de794cfa1161007c578063de794cfa14610a2b578063e58378bb14610a49578063e985e9c514610a67578063f3dbe7bc14610a9757610342565b8063d547741f146109d5578063da291b2e146109f1578063dc97805914610a0f57610342565b8063cfbd4885116100de578063cfbd488514610963578063d05d16491461097f578063d41a9bca1461099b578063d5391393146109b757610342565b8063b88d4fde146108fb578063c01d2d1d14610917578063c87b56dd1461093357610342565b806394b69ffa11610171578063a22cb4651161014b578063a22cb46514610861578063aa271e1a1461087d578063ab9ea1f8146108ad578063b324ceb0146108cb57610342565b806394b69ffa146107f557806395d89b4114610825578063a217fddf1461084357610342565b806385edea131461071157806385ff8c21146107415780638b58c5691461075d578063911a71f51461078d57806391d14854146107a95780639348cef7146107d957610342565b80632f54bf6e116102925780634f6ccce7116102305780636727939d1161020a5780636727939d146106895780636c0360eb146106a75780636d151101146106c557806370a08231146106e157610342565b80634f6ccce71461060d57806355f804b31461063d5780636352211e1461065957610342565b806336568abe1161026c57806336568abe1461059b57806340c10f19146105b757806342842e0e146105d35780634b3071d6146105ef57610342565b80632f54bf6e1461051d5780632f745c591461054d57806332cb6b0c1461057d57610342565b80631a8edefe116102ff578063248a9ca3116102d9578063248a9ca314610485578063261707fa146104b5578063274a9b95146104d15780632f2ff15d1461050157610342565b80631a8edefe1461041b57806321758ced1461043957806323b872dd1461046957610342565b806301ffc9a7146103475780630380abf81461037757806306fdde0314610393578063081812fc146103b1578063095ea7b3146103e157806318160ddd146103fd575b600080fd5b610361600480360381019061035c9190613d46565b610ab3565b60405161036e9190613d8e565b60405180910390f35b610391600480360381019061038c9190613e07565b610ac5565b005b61039b610b62565b6040516103a89190613ecd565b60405180910390f35b6103cb60048036038101906103c69190613f25565b610bf4565b6040516103d89190613f61565b60405180910390f35b6103fb60048036038101906103f69190613f7c565b610c79565b005b610405610d91565b6040516104129190613fcb565b60405180910390f35b610423610d9e565b6040516104309190613fcb565b60405180910390f35b610453600480360381019061044e9190613f25565b610dc2565b6040516104609190613d8e565b60405180910390f35b610483600480360381019061047e9190613fe6565b610edc565b005b61049f600480360381019061049a919061406f565b610f3c565b6040516104ac91906140ab565b60405180910390f35b6104cf60048036038101906104ca9190613e07565b610f5c565b005b6104eb60048036038101906104e69190613e07565b610ff9565b6040516104f89190613d8e565b60405180910390f35b61051b600480360381019061051691906140c6565b61102c565b005b61053760048036038101906105329190613e07565b611055565b6040516105449190613d8e565b60405180910390f35b61056760048036038101906105629190613f7c565b611088565b6040516105749190613fcb565b60405180910390f35b61058561112d565b6040516105929190613fcb565b60405180910390f35b6105b560048036038101906105b091906140c6565b611151565b005b6105d160048036038101906105cc9190613f7c565b6111d4565b005b6105ed60048036038101906105e89190613fe6565b611396565b005b6105f76113b6565b60405161060491906140ab565b60405180910390f35b61062760048036038101906106229190613f25565b6113da565b6040516106349190613fcb565b60405180910390f35b6106576004803603810190610652919061423b565b61144b565b005b610673600480360381019061066e9190613f25565b61150d565b6040516106809190613f61565b60405180910390f35b6106916115bf565b60405161069e9190613fcb565b60405180910390f35b6106af6115c5565b6040516106bc9190613ecd565b60405180910390f35b6106df60048036038101906106da9190613e07565b611653565b005b6106fb60048036038101906106f69190613e07565b6116f0565b6040516107089190613fcb565b60405180910390f35b61072b60048036038101906107269190613f25565b6117a8565b6040516107389190613fcb565b60405180910390f35b61075b60048036038101906107569190613e07565b6118c5565b005b61077760048036038101906107729190613f25565b611962565b6040516107849190613fcb565b60405180910390f35b6107a760048036038101906107a29190613e07565b61197a565b005b6107c360048036038101906107be91906140c6565b611a17565b6040516107d09190613d8e565b60405180910390f35b6107f360048036038101906107ee9190614284565b611a82565b005b61080f600480360381019061080a9190613f25565b611bae565b60405161081c9190613fcb565b60405180910390f35b61082d611bc6565b60405161083a9190613ecd565b60405180910390f35b61084b611c58565b60405161085891906140ab565b60405180910390f35b61087b600480360381019061087691906142f0565b611c5f565b005b61089760048036038101906108929190613e07565b611de0565b6040516108a49190613d8e565b60405180910390f35b6108b5611e13565b6040516108c291906140ab565b60405180910390f35b6108e560048036038101906108e09190613e07565b611e37565b6040516108f29190613d8e565b60405180910390f35b610915600480360381019061091091906143d1565b611e6a565b005b610931600480360381019061092c9190613e07565b611ecc565b005b61094d60048036038101906109489190613f25565b611fb7565b60405161095a9190613ecd565b60405180910390f35b61097d60048036038101906109789190613e07565b6120a1565b005b61099960048036038101906109949190613e07565b61213e565b005b6109b560048036038101906109b09190614284565b6121db565b005b6109bf612241565b6040516109cc91906140ab565b60405180910390f35b6109ef60048036038101906109ea91906140c6565b612265565b005b6109f961228e565b604051610a0691906144b3565b60405180910390f35b610a296004803603810190610a249190613e07565b6122b4565b005b610a33612351565b604051610a4091906144ef565b60405180910390f35b610a51612377565b604051610a5e91906140ab565b60405180910390f35b610a816004803603810190610a7c919061450a565b61239b565b604051610a8e9190613d8e565b60405180910390f35b610ab16004803603810190610aac9190613e07565b61242f565b005b6000610abe8261251a565b9050919050565b610af67fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e610af1612594565b611a17565b610b35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2c906145bc565b60405180910390fd5b610b5f7f41c4b6457a1878387b597bb2a052bcee5631e58e437f46642248fb614daa0e4182612265565b50565b606060008054610b719061460b565b80601f0160208091040260200160405190810160405280929190818152602001828054610b9d9061460b565b8015610bea5780601f10610bbf57610100808354040283529160200191610bea565b820191906000526020600020905b815481529060010190602001808311610bcd57829003601f168201915b5050505050905090565b6000610bff8261259c565b610c3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c35906146af565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610c848261150d565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cec90614741565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610d14612594565b73ffffffffffffffffffffffffffffffffffffffff161480610d435750610d4281610d3d612594565b61239b565b5b610d82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d79906147d3565b60405180910390fd5b610d8c8383612608565b505050565b6000600880549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008073ffffffffffffffffffffffffffffffffffffffff16600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ed25760011515600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166321758ced846040518263ffffffff1660e01b8152600401610e789190613fcb565b60206040518083038186803b158015610e9057600080fd5b505afa158015610ea4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec89190614808565b1515149050610ed7565b600190505b919050565b610eed610ee7612594565b826126c1565b610f2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f23906148a7565b60405180910390fd5b610f3783838361279f565b505050565b6000600a6000838152602001908152602001600020600101549050919050565b610f8d7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e610f88612594565b611a17565b610fcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc3906145bc565b60405180910390fd5b610ff67f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68261102c565b50565b60006110257f41c4b6457a1878387b597bb2a052bcee5631e58e437f46642248fb614daa0e4183611a17565b9050919050565b61103582610f3c565b61104681611041612594565b6129fb565b6110508383612a98565b505050565b60006110817fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e83611a17565b9050919050565b6000611093836116f0565b82106110d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cb90614939565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b611159612594565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146111c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bd906149cb565b60405180910390fd5b6111d08282612b79565b5050565b6111e46111df612594565b611de0565b611223576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121a90614a5d565b60405180910390fd5b600061126382611233600b612c5b565b7f000000000000000000000000000000000000000000000000000000000000000061125e9190614aac565b612c69565b9050600081116112a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129f90614b2c565b60405180910390fd5b60005b81811015611390576112bd600b612c82565b60006112c9600b612c5b565b90507f000000000000000000000000000000000000000000000000000000000000000081111561132e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132590614b2c565b60405180910390fd5b6113388582612c98565b808573ffffffffffffffffffffffffffffffffffffffff167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe60405160405180910390a350808061138890614b4c565b9150506112ab565b50505050565b6113b183838360405180602001604052806000815250611e6a565b505050565b7f41c4b6457a1878387b597bb2a052bcee5631e58e437f46642248fb614daa0e4181565b60006113e4610d91565b8210611425576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141c90614c07565b60405180910390fd5b6008828154811061143957611438614c27565b5b90600052602060002001549050919050565b61147c7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e611477612594565b611a17565b6114bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b2906145bc565b60405180910390fd5b80600c90805190602001906114d1929190613c37565b507f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf6600c6040516115029190614ceb565b60405180910390a150565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ad90614d7f565b60405180910390fd5b80915050919050565b600d5481565b600c80546115d29061460b565b80601f01602080910402602001604051908101604052809291908181526020018280546115fe9061460b565b801561164b5780601f106116205761010080835404028352916020019161164b565b820191906000526020600020905b81548152906001019060200180831161162e57829003601f168201915b505050505081565b6116847fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e61167f612594565b611a17565b6116c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ba906145bc565b60405180910390fd5b6116ed7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e82612265565b50565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175890614e11565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006117b382612cb6565b600073ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118bb57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166341351f1d836040518263ffffffff1660e01b81526004016118649190613fcb565b60206040518083038186803b15801561187c57600080fd5b505afa158015611890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b49190614e46565b90506118c0565b600090505b919050565b6118f67fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6118f1612594565b611a17565b611935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192c906145bc565b60405180910390fd5b61195f7f7eedb2e31886aee6b48ad5b19b07b41f829d56c86a5c8a5cc10a185aeed9290482612265565b50565b60116020528060005260406000206000915090505481565b6119ab7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6119a6612594565b611a17565b6119ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e1906145bc565b60405180910390fd5b611a147f41c4b6457a1878387b597bb2a052bcee5631e58e437f46642248fb614daa0e418261102c565b50565b6000600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611a92611a8d612594565b611e37565b611ad1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac890614ee5565b60405180910390fd5b611ada82612cb6565b6000601160008481526020019081526020016000205414611b30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2790614f51565b60405180910390fd5b806011600084815260200190815260200160002081905550817f9a5a126d5a9736641cc82adfebab5f62e9429e7963b9810cffdc9184c5fda2a782604051611b789190613fcb565b60405180910390a2611baa827f0000000000000000000000000000000000000000000000000000000000000000612d01565b5050565b60106020528060005260406000206000915090505481565b606060018054611bd59061460b565b80601f0160208091040260200160405190810160405280929190818152602001828054611c019061460b565b8015611c4e5780601f10611c2357610100808354040283529160200191611c4e565b820191906000526020600020905b815481529060010190602001808311611c3157829003601f168201915b5050505050905090565b6000801b81565b611c67612594565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611cd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ccc90614fbd565b60405180910390fd5b8060056000611ce2612594565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611d8f612594565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611dd49190613d8e565b60405180910390a35050565b6000611e0c7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a683611a17565b9050919050565b7f7eedb2e31886aee6b48ad5b19b07b41f829d56c86a5c8a5cc10a185aeed9290481565b6000611e637f7eedb2e31886aee6b48ad5b19b07b41f829d56c86a5c8a5cc10a185aeed9290483611a17565b9050919050565b611e7b611e75612594565b836126c1565b611eba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb1906148a7565b60405180910390fd5b611ec684848484612d95565b50505050565b611efd7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e611ef8612594565b611a17565b611f3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f33906145bc565b60405180910390fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f27feefcfdcad24178fd3d7c4084b5a79219550ef71a3aa7d47772ca1b252065f81604051611fac9190613f61565b60405180910390a150565b6060611fc282612cb6565b6000611fcc612df1565b511161200d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200490615029565b60405180910390fd5b600080601160008581526020019081526020016000205411612064576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525061206e565b61206d83612e83565b5b9050612078612df1565b8160405160200161208a9291906150d1565b604051602081830303815290604052915050919050565b6120d27fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6120cd612594565b611a17565b612111576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612108906145bc565b60405180910390fd5b61213b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a682612265565b50565b61216f7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e61216a612594565b611a17565b6121ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a5906145bc565b60405180910390fd5b6121d87f7eedb2e31886aee6b48ad5b19b07b41f829d56c86a5c8a5cc10a185aeed929048261102c565b50565b6121eb6121e6612594565b610ff9565b61222a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222190615172565b60405180910390fd5b61223382612cb6565b61223d8282612d01565b5050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b61226e82610f3c565b61227f8161227a612594565b6129fb565b6122898383612b79565b505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6122e57fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6122e0612594565b611a17565b612324576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231b906145bc565b60405180910390fd5b61234e7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e8261102c565b50565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e81565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6124607fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e61245b612594565b611a17565b61249f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612496906145bc565b60405180910390fd5b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fee2500c7c705b57fa75ba6b02d6d37ae3e76faa27be32032ce341b37ff40b6788160405161250f9190613f61565b60405180910390a150565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061258d575061258c82612fe4565b5b9050919050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661267b8361150d565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006126cc8261259c565b61270b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270290615204565b60405180910390fd5b60006127168361150d565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061278557508373ffffffffffffffffffffffffffffffffffffffff1661276d84610bf4565b73ffffffffffffffffffffffffffffffffffffffff16145b806127965750612795818561239b565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166127bf8261150d565b73ffffffffffffffffffffffffffffffffffffffff1614612815576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161280c90615296565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612885576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161287c90615328565b60405180910390fd5b61289083838361305e565b61289b600082612608565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546128eb9190614aac565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546129429190615348565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b612a058282611a17565b612a9457612a2a8173ffffffffffffffffffffffffffffffffffffffff1660146130bd565b612a388360001c60206130bd565b604051602001612a49929190615436565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a8b9190613ecd565b60405180910390fd5b5050565b612aa28282611a17565b612b75576001600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612b1a612594565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b612b838282611a17565b15612c57576000600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612bfc612594565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b600081600001549050919050565b6000818310612c785781612c7a565b825b905092915050565b6001816000016000828254019250508190555050565b612cb28282604051806020016040528060008152506132f9565b5050565b612cbf8161259c565b612cfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cf5906154bc565b60405180910390fd5b50565b80600d6000828254612d139190615348565b9250508190555080601060008481526020019081526020016000206000828254612d3d9190615348565b92505081905550817f2ae2ab636ce2e68139f0058f76bfd4e08a6acdf6e2239f08562a8ae4b3c50b51826010600086815260200190815260200160002054604051612d899291906154dc565b60405180910390a25050565b612da084848461279f565b612dac84848484613354565b612deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612de290615577565b60405180910390fd5b50505050565b6060600c8054612e009061460b565b80601f0160208091040260200160405190810160405280929190818152602001828054612e2c9061460b565b8015612e795780601f10612e4e57610100808354040283529160200191612e79565b820191906000526020600020905b815481529060010190602001808311612e5c57829003601f168201915b5050505050905090565b60606000821415612ecb576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612fdf565b600082905060005b60008214612efd578080612ee690614b4c565b915050600a82612ef691906155c6565b9150612ed3565b60008167ffffffffffffffff811115612f1957612f18614110565b5b6040519080825280601f01601f191660200182016040528015612f4b5781602001600182028036833780820191505090505b5090505b60008514612fd857600182612f649190614aac565b9150600a85612f7391906155f7565b6030612f7f9190615348565b60f81b818381518110612f9557612f94614c27565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612fd191906155c6565b9450612f4f565b8093505050505b919050565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806130575750613056826134eb565b5b9050919050565b6001151561306b82610dc2565b1515146130ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130a49061569a565b60405180910390fd5b6130b88383836135cd565b505050565b6060600060028360026130d091906156ba565b6130da9190615348565b67ffffffffffffffff8111156130f3576130f2614110565b5b6040519080825280601f01601f1916602001820160405280156131255781602001600182028036833780820191505090505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061315d5761315c614c27565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106131c1576131c0614c27565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261320191906156ba565b61320b9190615348565b90505b60018111156132ab577f3031323334353637383961626364656600000000000000000000000000000000600f86166010811061324d5761324c614c27565b5b1a60f81b82828151811061326457613263614c27565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c9450806132a490615714565b905061320e565b50600084146132ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132e69061578a565b60405180910390fd5b8091505092915050565b61330383836136e1565b6133106000848484613354565b61334f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161334690615577565b60405180910390fd5b505050565b60006133758473ffffffffffffffffffffffffffffffffffffffff166138af565b156134de578373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261339e612594565b8786866040518563ffffffff1660e01b81526004016133c094939291906157ff565b602060405180830381600087803b1580156133da57600080fd5b505af192505050801561340b57506040513d601f19601f820116820180604052508101906134089190615860565b60015b61348e573d806000811461343b576040519150601f19603f3d011682016040523d82523d6000602084013e613440565b606091505b50600081511415613486576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161347d90615577565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150506134e3565b600190505b949350505050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806135b657507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806135c657506135c5826138c2565b5b9050919050565b6135d883838361392c565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561361b5761361681613931565b61365a565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461365957613658838261397a565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561369d5761369881613ae7565b6136dc565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146136db576136da8282613bb8565b5b5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613751576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613748906158d9565b60405180910390fd5b61375a8161259c565b1561379a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161379190615945565b60405180910390fd5b6137a66000838361305e565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546137f69190615348565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080823b905060008111915050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b60006001613987846116f0565b6139919190614aac565b9050600060076000848152602001908152602001600020549050818114613a76576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600880549050613afb9190614aac565b9050600060096000848152602001908152602001600020549050600060088381548110613b2b57613b2a614c27565b5b906000526020600020015490508060088381548110613b4d57613b4c614c27565b5b906000526020600020018190555081600960008381526020019081526020016000208190555060096000858152602001908152602001600020600090556008805480613b9c57613b9b615965565b5b6001900381819060005260206000200160009055905550505050565b6000613bc3836116f0565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b828054613c439061460b565b90600052602060002090601f016020900481019282613c655760008555613cac565b82601f10613c7e57805160ff1916838001178555613cac565b82800160010185558215613cac579182015b82811115613cab578251825591602001919060010190613c90565b5b509050613cb99190613cbd565b5090565b5b80821115613cd6576000816000905550600101613cbe565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613d2381613cee565b8114613d2e57600080fd5b50565b600081359050613d4081613d1a565b92915050565b600060208284031215613d5c57613d5b613ce4565b5b6000613d6a84828501613d31565b91505092915050565b60008115159050919050565b613d8881613d73565b82525050565b6000602082019050613da36000830184613d7f565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613dd482613da9565b9050919050565b613de481613dc9565b8114613def57600080fd5b50565b600081359050613e0181613ddb565b92915050565b600060208284031215613e1d57613e1c613ce4565b5b6000613e2b84828501613df2565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613e6e578082015181840152602081019050613e53565b83811115613e7d576000848401525b50505050565b6000601f19601f8301169050919050565b6000613e9f82613e34565b613ea98185613e3f565b9350613eb9818560208601613e50565b613ec281613e83565b840191505092915050565b60006020820190508181036000830152613ee78184613e94565b905092915050565b6000819050919050565b613f0281613eef565b8114613f0d57600080fd5b50565b600081359050613f1f81613ef9565b92915050565b600060208284031215613f3b57613f3a613ce4565b5b6000613f4984828501613f10565b91505092915050565b613f5b81613dc9565b82525050565b6000602082019050613f766000830184613f52565b92915050565b60008060408385031215613f9357613f92613ce4565b5b6000613fa185828601613df2565b9250506020613fb285828601613f10565b9150509250929050565b613fc581613eef565b82525050565b6000602082019050613fe06000830184613fbc565b92915050565b600080600060608486031215613fff57613ffe613ce4565b5b600061400d86828701613df2565b935050602061401e86828701613df2565b925050604061402f86828701613f10565b9150509250925092565b6000819050919050565b61404c81614039565b811461405757600080fd5b50565b60008135905061406981614043565b92915050565b60006020828403121561408557614084613ce4565b5b60006140938482850161405a565b91505092915050565b6140a581614039565b82525050565b60006020820190506140c0600083018461409c565b92915050565b600080604083850312156140dd576140dc613ce4565b5b60006140eb8582860161405a565b92505060206140fc85828601613df2565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61414882613e83565b810181811067ffffffffffffffff8211171561416757614166614110565b5b80604052505050565b600061417a613cda565b9050614186828261413f565b919050565b600067ffffffffffffffff8211156141a6576141a5614110565b5b6141af82613e83565b9050602081019050919050565b82818337600083830152505050565b60006141de6141d98461418b565b614170565b9050828152602081018484840111156141fa576141f961410b565b5b6142058482856141bc565b509392505050565b600082601f83011261422257614221614106565b5b81356142328482602086016141cb565b91505092915050565b60006020828403121561425157614250613ce4565b5b600082013567ffffffffffffffff81111561426f5761426e613ce9565b5b61427b8482850161420d565b91505092915050565b6000806040838503121561429b5761429a613ce4565b5b60006142a985828601613f10565b92505060206142ba85828601613f10565b9150509250929050565b6142cd81613d73565b81146142d857600080fd5b50565b6000813590506142ea816142c4565b92915050565b6000806040838503121561430757614306613ce4565b5b600061431585828601613df2565b9250506020614326858286016142db565b9150509250929050565b600067ffffffffffffffff82111561434b5761434a614110565b5b61435482613e83565b9050602081019050919050565b600061437461436f84614330565b614170565b9050828152602081018484840111156143905761438f61410b565b5b61439b8482856141bc565b509392505050565b600082601f8301126143b8576143b7614106565b5b81356143c8848260208601614361565b91505092915050565b600080600080608085870312156143eb576143ea613ce4565b5b60006143f987828801613df2565b945050602061440a87828801613df2565b935050604061441b87828801613f10565b925050606085013567ffffffffffffffff81111561443c5761443b613ce9565b5b614448878288016143a3565b91505092959194509250565b6000819050919050565b600061447961447461446f84613da9565b614454565b613da9565b9050919050565b600061448b8261445e565b9050919050565b600061449d82614480565b9050919050565b6144ad81614492565b82525050565b60006020820190506144c860008301846144a4565b92915050565b60006144d982614480565b9050919050565b6144e9816144ce565b82525050565b600060208201905061450460008301846144e0565b92915050565b6000806040838503121561452157614520613ce4565b5b600061452f85828601613df2565b925050602061454085828601613df2565b9150509250929050565b7f536861726b73416363657373436f6e74726f6c3a206e6f204f574e45525f524f60008201527f4c45000000000000000000000000000000000000000000000000000000000000602082015250565b60006145a6602283613e3f565b91506145b18261454a565b604082019050919050565b600060208201905081810360008301526145d581614599565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061462357607f821691505b60208210811415614637576146366145dc565b5b50919050565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000614699602c83613e3f565b91506146a48261463d565b604082019050919050565b600060208201905081810360008301526146c88161468c565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061472b602183613e3f565b9150614736826146cf565b604082019050919050565b6000602082019050818103600083015261475a8161471e565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b60006147bd603883613e3f565b91506147c882614761565b604082019050919050565b600060208201905081810360008301526147ec816147b0565b9050919050565b600081519050614802816142c4565b92915050565b60006020828403121561481e5761481d613ce4565b5b600061482c848285016147f3565b91505092915050565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b6000614891603183613e3f565b915061489c82614835565b604082019050919050565b600060208201905081810360008301526148c081614884565b9050919050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b6000614923602b83613e3f565b915061492e826148c7565b604082019050919050565b6000602082019050818103600083015261495281614916565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b60006149b5602f83613e3f565b91506149c082614959565b604082019050919050565b600060208201905081810360008301526149e4816149a8565b9050919050565b7f536861726b73416363657373436f6e74726f6c3a206e6f204d494e5445525f5260008201527f4f4c450000000000000000000000000000000000000000000000000000000000602082015250565b6000614a47602383613e3f565b9150614a52826149eb565b604082019050919050565b60006020820190508181036000830152614a7681614a3a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614ab782613eef565b9150614ac283613eef565b925082821015614ad557614ad4614a7d565b5b828203905092915050565b7f4d41585f535550504c5920726561636865640000000000000000000000000000600082015250565b6000614b16601283613e3f565b9150614b2182614ae0565b602082019050919050565b60006020820190508181036000830152614b4581614b09565b9050919050565b6000614b5782613eef565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614b8a57614b89614a7d565b5b600182019050919050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b6000614bf1602c83613e3f565b9150614bfc82614b95565b604082019050919050565b60006020820190508181036000830152614c2081614be4565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008190508160005260206000209050919050565b60008154614c788161460b565b614c828186613e3f565b94506001821660008114614c9d5760018114614caf57614ce2565b60ff1983168652602086019350614ce2565b614cb885614c56565b60005b83811015614cda57815481890152600182019150602081019050614cbb565b808801955050505b50505092915050565b60006020820190508181036000830152614d058184614c6b565b905092915050565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b6000614d69602983613e3f565b9150614d7482614d0d565b604082019050919050565b60006020820190508181036000830152614d9881614d5c565b9050919050565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b6000614dfb602a83613e3f565b9150614e0682614d9f565b604082019050919050565b60006020820190508181036000830152614e2a81614dee565b9050919050565b600081519050614e4081613ef9565b92915050565b600060208284031215614e5c57614e5b613ce4565b5b6000614e6a84828501614e31565b91505092915050565b7f536861726b73416363657373436f6e74726f6c3a206e6f2052455645414c455260008201527f5f524f4c45000000000000000000000000000000000000000000000000000000602082015250565b6000614ecf602583613e3f565b9150614eda82614e73565b604082019050919050565b60006020820190508181036000830152614efe81614ec2565b9050919050565b7f616c72656164792072657665616c656400000000000000000000000000000000600082015250565b6000614f3b601083613e3f565b9150614f4682614f05565b602082019050919050565b60006020820190508181036000830152614f6a81614f2e565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b6000614fa7601983613e3f565b9150614fb282614f71565b602082019050919050565b60006020820190508181036000830152614fd681614f9a565b9050919050565b7f62617365555249206e6f74207365740000000000000000000000000000000000600082015250565b6000615013600f83613e3f565b915061501e82614fdd565b602082019050919050565b6000602082019050818103600083015261504281615006565b9050919050565b600081905092915050565b600061505f82613e34565b6150698185615049565b9350615079818560208601613e50565b80840191505092915050565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000600082015250565b60006150bb600583615049565b91506150c682615085565b600582019050919050565b60006150dd8285615054565b91506150e98284615054565b91506150f4826150ae565b91508190509392505050565b7f536861726b73416363657373436f6e74726f6c3a206e6f2058505f4d414e414760008201527f45525f524f4c4500000000000000000000000000000000000000000000000000602082015250565b600061515c602783613e3f565b915061516782615100565b604082019050919050565b6000602082019050818103600083015261518b8161514f565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b60006151ee602c83613e3f565b91506151f982615192565b604082019050919050565b6000602082019050818103600083015261521d816151e1565b9050919050565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b6000615280602983613e3f565b915061528b82615224565b604082019050919050565b600060208201905081810360008301526152af81615273565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615312602483613e3f565b915061531d826152b6565b604082019050919050565b6000602082019050818103600083015261534181615305565b9050919050565b600061535382613eef565b915061535e83613eef565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561539357615392614a7d565b5b828201905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b60006153d4601783615049565b91506153df8261539e565b601782019050919050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000615420601183615049565b915061542b826153ea565b601182019050919050565b6000615441826153c7565b915061544d8285615054565b915061545882615413565b91506154648284615054565b91508190509392505050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b60006154a6601883613e3f565b91506154b182615470565b602082019050919050565b600060208201905081810360008301526154d581615499565b9050919050565b60006040820190506154f16000830185613fbc565b6154fe6020830184613fbc565b9392505050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000615561603283613e3f565b915061556c82615505565b604082019050919050565b6000602082019050818103600083015261559081615554565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006155d182613eef565b91506155dc83613eef565b9250826155ec576155eb615597565b5b828204905092915050565b600061560282613eef565b915061560d83613eef565b92508261561d5761561c615597565b5b828206905092915050565b7f536861726b735472616e73666572436f6e74726f6c3a207472616e736665722060008201527f6e6f7420616c6c6f776564000000000000000000000000000000000000000000602082015250565b6000615684602b83613e3f565b915061568f82615628565b604082019050919050565b600060208201905081810360008301526156b381615677565b9050919050565b60006156c582613eef565b91506156d083613eef565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561570957615708614a7d565b5b828202905092915050565b600061571f82613eef565b9150600082141561573357615732614a7d565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000615774602083613e3f565b915061577f8261573e565b602082019050919050565b600060208201905081810360008301526157a381615767565b9050919050565b600081519050919050565b600082825260208201905092915050565b60006157d1826157aa565b6157db81856157b5565b93506157eb818560208601613e50565b6157f481613e83565b840191505092915050565b60006080820190506158146000830187613f52565b6158216020830186613f52565b61582e6040830185613fbc565b818103606083015261584081846157c6565b905095945050505050565b60008151905061585a81613d1a565b92915050565b60006020828403121561587657615875613ce4565b5b60006158848482850161584b565b91505092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006158c3602083613e3f565b91506158ce8261588d565b602082019050919050565b600060208201905081810360008301526158f2816158b6565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b600061592f601c83613e3f565b915061593a826158f9565b602082019050919050565b6000602082019050818103600083015261595e81615922565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220d7194272c88d492d232c02d8bf98459a779c88c0a3e89fc0ba5de55fc4113f7664736f6c634300080900330000000000000000000000000000000000000000000000000000000000002710

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

0000000000000000000000000000000000000000000000000000000000002710

-----Decoded View---------------
Arg [0] : maxSupply_ (uint256): 10000

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000002710


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