ETH Price: $3,328.84 (-3.93%)
Gas: 2 Gwei

Contract

0xb8f0BB7F5d2bB0d280cc0b60675675d31c105529
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Approve163046832022-12-31 12:15:47571 days ago1672488947IN
Enchanted Game: EGAME Token
0 ETH0.0004206814.55855246
Approve163046802022-12-31 12:15:11571 days ago1672488911IN
Enchanted Game: EGAME Token
0 ETH0.0004595115.90220169
Approve163046792022-12-31 12:14:59571 days ago1672488899IN
Enchanted Game: EGAME Token
0 ETH0.0004750516.44023026
Approve163046772022-12-31 12:14:35571 days ago1672488875IN
Enchanted Game: EGAME Token
0 ETH0.0007441315.24996123
Approve163046682022-12-31 12:12:47571 days ago1672488767IN
Enchanted Game: EGAME Token
0 ETH0.0009115718.68143519
Set Approval For...162204872022-12-19 18:18:35583 days ago1671473915IN
Enchanted Game: EGAME Token
0 ETH0.0007787916.85657668
Transfer Ownersh...162200892022-12-19 16:58:59583 days ago1671469139IN
Enchanted Game: EGAME Token
0 ETH0.0003595214.92967126
Safe Transfer Fr...161138202022-12-04 20:27:11598 days ago1670185631IN
Enchanted Game: EGAME Token
0 ETH0.0009644811.16010077
Safe Transfer Fr...160482912022-11-25 16:49:11607 days ago1669394951IN
Enchanted Game: EGAME Token
0 ETH0.0011361312.71204443
Safe Transfer Fr...160482902022-11-25 16:48:59607 days ago1669394939IN
Enchanted Game: EGAME Token
0 ETH0.0011486512.85206937
Safe Transfer Fr...159836422022-11-16 16:01:35616 days ago1668614495IN
Enchanted Game: EGAME Token
0 ETH0.0010909630.69423333
Safe Transfer Fr...159836302022-11-16 15:59:11616 days ago1668614351IN
Enchanted Game: EGAME Token
0 ETH0.0011160431.39976273
Safe Transfer Fr...159499172022-11-11 23:00:59621 days ago1668207659IN
Enchanted Game: EGAME Token
0 ETH0.002515928.1499889
Safe Transfer Fr...159499152022-11-11 23:00:35621 days ago1668207635IN
Enchanted Game: EGAME Token
0 ETH0.002508528.06718893
Set Approval For...150796822022-07-05 1:58:39750 days ago1656986319IN
Enchanted Game: EGAME Token
0 ETH0.0005402322.23113246
Set Approval For...149515712022-06-12 18:12:35773 days ago1655057555IN
Enchanted Game: EGAME Token
0 ETH0.0015286633.07869931
Withdraw149376622022-06-10 9:25:12775 days ago1654853112IN
Enchanted Game: EGAME Token
0 ETH0.0011518537.85122032
Set Approval For...149163042022-06-06 18:04:32779 days ago1654538672IN
Enchanted Game: EGAME Token
0 ETH0.0014618160.18427535
Set Paused148551522022-05-27 16:27:07789 days ago1653668827IN
Enchanted Game: EGAME Token
0 ETH0.0013618448.61488806
Set Approval For...148426022022-05-25 15:18:28791 days ago1653491908IN
Enchanted Game: EGAME Token
0 ETH0.0011547143.90392869
Set Approval For...148426022022-05-25 15:18:28791 days ago1653491908IN
Enchanted Game: EGAME Token
0 ETH0.001066943.90392869
Set Paused148425442022-05-25 15:04:09791 days ago1653491049IN
Enchanted Game: EGAME Token
0 ETH0.0016091257.501594
Set Paused148304802022-05-23 15:57:52793 days ago1653321472IN
Enchanted Game: EGAME Token
0 ETH0.0008418530.05216401
Transfer From147636072022-05-12 22:04:01804 days ago1652393041IN
Enchanted Game: EGAME Token
0 ETH0.0068128479.35570555
Swap Tokens144891432022-03-30 18:27:11847 days ago1648664831IN
Enchanted Game: EGAME Token
0 ETH0.0833815676.48737178
View all transactions

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
149376622022-06-10 9:25:12775 days ago1654853112
Enchanted Game: EGAME Token
1.346208 ETH
138580162021-12-22 23:43:21945 days ago1640216601
Enchanted Game: EGAME Token
71.643507 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Goat

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

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


pragma solidity ^0.8.0;

import "./interface/IGoat.sol";
import "./interface/IBarn.sol";
import "./interface/ITraits.sol";
import "./utils/Ownable.sol";
import "./utils/Pausable.sol";
import "./utils/ECDSA.sol";
import "./token/ERC721Enumerable.sol";
import "./EGG.sol";

contract Goat is IGoat, ERC721Enumerable, Ownable, Pausable {
    using ECDSA for bytes32;

    struct LastWrite {
        uint64 time;
        uint64 blockNum;
    }
    struct Whitelist {
        uint hasMinted;
    }
    
    event TortoiseStolen(address owner, uint256 tokenId, uint256 value);
    event GoatStolen(address owner, uint256 tokenId, uint256 value);

    uint256 public totalTortoiseMinted;
    uint256 public totalGoatMinted;
    uint256 public totalTortoiseStolen;
    uint256 public totalGoatStolen;

    // mint price
    uint256 public MINT_PRICE = .042069 ether;
    // max number of tokens that can be minted - 50000 in production
    uint256 public MAX_TOKENS;
    // number of tokens that can be claimed for free - 20% of MAX_TOKENS
    uint256 public PAID_TOKENS;
    // number of tokens have been minted so far
    uint16 public minted;

    // list of probabilities for each trait type
    // 0 - 9 are associated with Tortoise, 10 - 18 are associated with Goats
    uint8[][20] public rarities;
    // list of aliases for Walker's Alias algorithm
    // 0 - 9 are associated with Tortoise, 10 - 18 are associated with Goats
    uint8[][20] public aliases;

    // mapping from tokenId to a struct containing the token's traits
    mapping(uint256 => GoatTortoise) public tokenTraits;
    // mapping from hashed(tokenTrait) to the tokenId it's associated with
    // used to ensure there are no duplicates
    mapping(uint256 => uint256) public existingCombinations;
    // Tracks the last block and timestamp that a caller has written to state.
    // Disallow some access to functions if they occur while a change is being written.
    mapping(address => LastWrite) private lastWrite;
    // address => User
    mapping(address => Whitelist) public whitelist;
    // address => allowedToCallFunctions
    mapping(address => bool) private admins;

    // reference to the ProtectedIsland for choosing random Goat thieves
    IProtectedIsland public protectedIsland;
    // reference to $EGG for burning on mint
    EGG public egg;
    // reference to Traits
    ITraits public traits;

    // boolean => checks if the earlyAccessMintSale is open or closed 
    bool public earlyAccessMintSale = false;
    // boolean => checks if the publicMintSale is open or closed
    bool public publicMintSale = false;

    // bytes32 -> DomainSeparator
    bytes32 public DOMAIN_SEPARATOR;
    // bytes32 -> PRESALE_TYPEHASH
    bytes32 public constant PRESALE_TYPEHASH = keccak256("EarlyAccess(address buyer,uint256 maxCount)");
    
    // address -> whitelist signer 
    address public whitelistSigner;
    // address -> old goat contract to interact with 
    IERC721 public oldGoatContract;

    /** 
    * instantiates contract and rarity tables
    */
    constructor(address _egg, address _traits, uint256 _maxTokens, address _whitelistSigner, IERC721 _oldGoatContract) ERC721("Enchanted Game", 'EGAME') { 
        egg = EGG(_egg);
        traits = ITraits(_traits);
        MAX_TOKENS = _maxTokens;
        PAID_TOKENS = _maxTokens / 5;
        whitelistSigner = _whitelistSigner;
        oldGoatContract = _oldGoatContract;

        // I know this looks weird but it saves users gas by making lookup O(1)
        // A.J. Walker's Alias Algorithm
        // Goat
        // Fur
        rarities[0] = [128, 77, 77, 128, 153, 128, 128, 128, 128, 128, 230, 255, 230, 230, 255, 77, 153, 153, 204, 128];
        aliases[0] = [14, 0, 10, 10, 10, 10, 11, 11, 11, 11, 14, 11, 14, 14, 14, 12, 12, 13, 13, 13];
        // Skin
        rarities[1] = [255];
        aliases[1] = [0];
        // Ears
        rarities[2] =  [216, 230, 230, 207, 172, 46, 255, 172, 92];
        aliases[2] = [6, 0, 0, 0, 0, 0, 6, 0, 6];
        // Eyes
        rarities[3] = [255, 128, 255, 191, 255, 128, 191, 255, 128, 128];
        aliases[3] = [0, 0, 2, 0, 4, 0, 0, 7, 0, 7];
        // shell
        rarities[4] = [255];
        aliases[4] = [0];
        // face
        rarities[5] = [255];
        aliases[5] = [0];
        // neck
        rarities[6] = [179, 217, 140, 204, 77, 191, 128, 255, 115, 153];
        aliases[6] = [7, 0, 0, 7, 0, 3, 3, 7, 3, 3];
        // feet
        rarities[7] = [255, 255, 255, 255, 191, 255, 128, 128, 64, 64];
        aliases[7] = [0, 1, 2, 3, 5, 5, 0, 4, 4, 5];
        // fertilityIndex
        rarities[8] = [102, 204, 153, 255];
        aliases[8] = [2, 3, 3, 3];
        // Accessory
        rarities[9] = [255];
        aliases[9] = [0];

        // Tortoise
        // Fur
        rarities[10] = [255];
        aliases[10] = [0];
        // Skin
        rarities[11] =  [227, 227, 255, 255, 255, 170, 170, 227, 255, 227, 227, 227, 198, 198, 198, 227, 255, 198, 198, 142];
        aliases[11] =  [8, 0, 2, 3, 4, 0, 12, 0, 8, 0, 0, 0, 15, 0, 0, 16, 16, 0, 0, 6];
        // Ears
        rarities[12] =  [255];
        aliases[12] = [0];
        // Eyes
        rarities[13] = [255];
        aliases[13] = [0];
        // shell
        rarities[14] = [255, 113, 57, 255, 142, 227, 227, 113, 57, 28, 227, 142, 170, 255, 113, 113, 170, 255, 142, 227];
        aliases[14] = [0, 12, 13, 3, 16, 17, 0, 1, 1, 2, 3, 3, 17, 13, 3, 4, 17, 17, 5, 12];
        // face
        rarities[15] = [99, 241, 71, 71, 255, 170, 142, 142, 255, 255];
        aliases[15] = [9, 9, 0, 1, 4, 4, 4, 4, 8, 9];
        // neck
        rarities[16] = [255];
        aliases[16] = [0];
        // feet
        rarities[17] = [227, 170, 255, 142, 142, 198, 227, 255, 142, 142];
        aliases[17] = [2, 5, 2, 0, 0, 6, 7, 7, 0, 1];
        // fertilityIndex
        rarities[18] = [57, 170, 142, 255];
        aliases[18] = [2, 3, 3, 3];
        // Accessory
        rarities[19] = [198, 227, 255, 227, 255, 255, 227, 255, 255, 198];
        aliases[19] = [1, 4, 2, 5, 4, 5, 2, 7, 8, 3];
        
        // Early Access stuff
        uint256 chainId;
        assembly {
            chainId := chainid()
        }

        DOMAIN_SEPARATOR = keccak256(
            abi.encode(
                keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                keccak256(bytes("ECC")),
                keccak256(bytes("1")),
                chainId,
                address(this)
            )
        );
    }

    /** CRITICAL TO SETUP / MODIFIERS */

    modifier disallowIfStateIsChanging() {
        // frens can always call whenever they want :)
        require(admins[_msgSender()] || lastWrite[tx.origin].blockNum < block.number, "hmmmm what doing?");
        _;
    }

    /** 
    * Mint
    */
    function _mint(uint256 amount, bool stake) internal {
        require(tx.origin == _msgSender(), "Only EOA");
        require(minted + amount <= MAX_TOKENS, "All tokens minted");
        require(amount > 0 && amount <= 10, "Invalid mint amount");
        if (minted < PAID_TOKENS) {
            require(minted + amount <= PAID_TOKENS, "All tokens on-sale already sold");
            require(amount * MINT_PRICE == msg.value, "Invalid payment amount");
        } else {
            require(msg.value == 0);
        }

        uint256 totalEggCost = 0;

        uint16[] memory tokenIds = stake ? new uint16[](amount) : new uint16[](0);
        uint256 seed;
        for (uint i = 0; i < amount; i++) {
            minted++;
            seed = random(minted, lastWrite[tx.origin].time, lastWrite[tx.origin].blockNum);
            generate(minted, seed, lastWrite[tx.origin]);
            address recipient = selectRecipient(seed);
            if (!stake || recipient != _msgSender()) {
                _safeMint(recipient, minted);
                // check if the recipient is the sender
                if (recipient != _msgSender()) {
                    // token is stolen!
                    if (tokenTraits[minted].isTortoise) {
                        totalTortoiseStolen += 1;
                        emit TortoiseStolen(_msgSender(), minted, block.timestamp);
                    } else {
                        totalGoatStolen += 1;
                        emit GoatStolen(_msgSender(), minted, block.timestamp);
                    }
                }
            } else {
                _safeMint(address(protectedIsland), minted);
                tokenIds[i] = minted;
            }
            // check token traits for tortoise or goat and increase mint amount
            totalEggCost += mintCost(minted);
        }
        
        if (totalEggCost > 0) egg.burn(_msgSender(), totalEggCost);
        if (stake) protectedIsland.addManyToProtectedIslandAndPack(_msgSender(), tokenIds);

        // update lastWrite for sender
        updateOriginAccess();
    }

    /** 
    * mint a token - 90% Tortoise, 10% Goats
    * The first 20% are free to claim, the remaining cost $EGG
    */
    function publicMint(uint256 _amount, bool _stake) external payable whenNotPaused {
        require(publicMintSale, "Public sale is not active");
        _mint(_amount, _stake);
    }

    /** 
    * mint a token - 90% Tortoise, 10% Goats
    * The first 20% are free to claim, the remaining cost $EGG
    */
    function earlyAccessMint(uint256 _amount, uint256 maxCount, bytes memory signature, bool _stake) external payable whenNotPaused {
        require(earlyAccessMintSale, "Early access is not active");

        // Verify EIP-712 signature
        bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode(PRESALE_TYPEHASH, msg.sender, maxCount))));
        address recoveredAddress = digest.recover(signature);
        // Is the signature the same as the whitelist signer if yes? your able to mint.
        require(recoveredAddress != address(0) && recoveredAddress == address(whitelistSigner), "Invalid signature");
        require((whitelist[msg.sender].hasMinted + _amount) <= maxCount, "Early Access max count exceeded");
        whitelist[msg.sender].hasMinted += _amount;
        
        _mint(_amount, _stake);
    }

 
    function swapTokens(uint[] memory _tokenIds) external whenNotPaused {
        uint256 amount = _tokenIds.length;
        uint256 oldBalance = oldGoatContract.balanceOf(_msgSender());
        require(tx.origin == _msgSender(), "Only EOA");
        require(minted + amount <= MAX_TOKENS, "All tokens minted");
        // Does the user have enough balance to make the swap work.
        require(oldBalance > 0, "You don't own any of the old tokens");
        // Does the user approved for all.
        require(oldGoatContract.isApprovedForAll(_msgSender(), address(this)), 'Not approved for all');
        uint256 seed;
        for (uint i = 0; i < amount; i++) {
            // Does the user own the given tokens?
            require(oldGoatContract.ownerOf(_tokenIds[i]) == _msgSender(), "hmmm not your tokens?");
            oldGoatContract.safeTransferFrom(_msgSender(), address(0xdead), _tokenIds[i]);
            
            minted++;
            seed = random(minted, lastWrite[tx.origin].time, lastWrite[tx.origin].blockNum);
            generate(minted, seed, lastWrite[tx.origin]);
            _safeMint(_msgSender(), minted);
        }
        
        // update lastWrite for sender
        updateOriginAccess();
    }

    /** 
    * the first 20% are paid in ETH
    * the next 20% are 20000 $EGG
    * the next 40% are 40000 $EGG
    * the final 20% are 80000 $EGG
    * @param tokenId the ID to check the cost of to mint
    * @return the cost of the given token ID
    */
    function mintCost(uint256 tokenId) public view returns (uint256) {
        if (tokenId <= PAID_TOKENS) return 0;
        if (tokenId <= MAX_TOKENS * 2 / 5) return 20000 ether;
        if (tokenId <= MAX_TOKENS * 4 / 5) return 40000 ether;
        return 80000 ether;
    }

    /** 
    * Updates `lastWrite`
    */
    function updateOriginAccess() internal {
        lastWrite[tx.origin].blockNum = uint64(block.number);
        lastWrite[tx.origin].time = uint64(block.number);
    }

    function transferFrom(
    address from,
    address to,
    uint256 tokenId
    ) public virtual override {
        // Hardcode the ProtectedIsland's approval so that users don't have to waste gas approving
        if (_msgSender() != address(protectedIsland))
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _transfer(from, to, tokenId);
    }

    /** INTERNAL */

    /**
    * generates traits for a specific token, checking to make sure it's unique
    * @param tokenId the id of the token to generate traits for
    * @param seed a pseudorandom 256 bit number to derive traits from
    * @return t - a struct of traits for the given token ID
    */
    function generate(uint256 tokenId, uint256 seed, LastWrite memory lw) internal returns (GoatTortoise memory t) {
        t = selectTraits(seed);
        if (existingCombinations[structToHash(t)] == 0) {
            tokenTraits[tokenId] = t;
            existingCombinations[structToHash(t)] = tokenId;
            if (t.isTortoise) {
                totalTortoiseMinted += 1;
            } else {
                totalGoatMinted += 1;
            }
            return t;
        }
        return generate(tokenId, random(seed, lw.time, lw.blockNum), lw);
    }

    /**
    * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup
    * ensuring O(1) instead of O(n) reduces mint cost by more than 50%
    * probability & alias tables are generated off-chain beforehand
    * @param seed portion of the 256 bit seed to remove trait correlation
    * @param traitType the trait type to select a trait for 
    * @return the ID of the randomly selected trait
    */
    function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) {
        uint8 trait = uint8(seed) % uint8(rarities[traitType].length);
        if (seed >> 8 < rarities[traitType][trait]) return trait;
        return aliases[traitType][trait];
    }

    /**
    * the first 20% (ETH purchases) go to the minter
    * the remaining 80% have a 10% chance to be given to a random staked Goat
    * @param seed a random value to select a recipient from
    * @return the address of the recipient (either the minter or the Goat thief's owner)
    */
    function selectRecipient(uint256 seed) internal view returns (address) {
        if (minted <= PAID_TOKENS || ((seed >> 245) % 10) != 0) return _msgSender(); // top 10 bits haven't been used
        address thief = protectedIsland.randomGoatOwner(seed >> 144); // 144 bits reserved for trait selection
        if (thief == address(0x0)) return _msgSender();
        return thief;
    }

    /**
    * selects the species and all of its traits based on the seed value
    * @param seed a pseudorandom 256 bit number to derive traits from
    * @return t -  a struct of randomly selected traits
    */
    function selectTraits(uint256 seed) internal view returns (GoatTortoise memory t) {    
        t.isTortoise = (seed & 0xFFFF) % 10 != 0;
        uint8 shift = t.isTortoise ? 10 : 0;

        seed >>= 16;
        t.fur = selectTrait(uint16(seed & 0xFFFF), 0 + shift);
        seed >>= 16;
        t.skin = selectTrait(uint16(seed & 0xFFFF), 1 + shift);
        seed >>= 16;
        t.ears = selectTrait(uint16(seed & 0xFFFF), 2 + shift);
        seed >>= 16;
        t.eyes = selectTrait(uint16(seed & 0xFFFF), 3 + shift);
        seed >>= 16;
        t.shell = selectTrait(uint16(seed & 0xFFFF), 4 + shift);
        seed >>= 16;
        t.face = selectTrait(uint16(seed & 0xFFFF), 5 + shift);
        seed >>= 16;
        t.neck = selectTrait(uint16(seed & 0xFFFF), 6 + shift);
        seed >>= 16;
        t.feet = selectTrait(uint16(seed & 0xFFFF), 7 + shift);
        seed >>= 16;
        t.fertilityIndex = selectTrait(uint16(seed & 0xFFFF), 8 + shift);
        seed >>= 16;
        t.accessory = selectTrait(uint16(seed & 0xFFFF), 9 + shift);
    }

    /**
    * converts a struct to a 256 bit hash to check for uniqueness
    * @param s the struct to pack into a hash
    * @return the 256 bit hash of the struct
    */
    function structToHash(GoatTortoise memory s) internal pure returns (uint256) {
        return uint256(bytes32(
            abi.encodePacked(
                s.isTortoise,
                s.fur,
                s.skin,
                s.ears,
                s.eyes,
                s.shell,
                s.face,
                s.neck,
                s.feet,
                s.accessory,
                s.fertilityIndex
            )
        ));
    }

    /**
    * generates a pseudorandom number for picking traits. Uses point in time randomization to prevent abuse.
    */
    function random(uint256 seed, uint64 timestamp, uint64 blockNumber) internal view returns (uint256) {
        return uint256(keccak256(abi.encodePacked(
            tx.origin,
            blockhash(blockNumber > 1 ? blockNumber - 2 : blockNumber),// Different block than WnDGame to ensure if needing to re-randomize that it goes down a different path
            timestamp,
            seed
        )));
    }

    function getTokenTraits(uint256 tokenId) external view override returns (GoatTortoise memory) {
        return tokenTraits[tokenId];
    }

    function getPaidTokens() external view override returns (uint256) {
        return PAID_TOKENS;
    }

    /// @notice Returns a list of all Goat IDs assigned to an address.
    /// @param _owner The owner whose Goats we are interested in.
    /// @dev This method MUST NEVER be called by smart contract code. First, it's fairly
    ///  expensive (it walks the entire Owner's array looking for Goat(s) & Tortoise(s) belonging to owner),
    ///  but it also returns a dynamic array, which is only supported for web3 calls, and
    ///  not contract-to-contract calls.
    function tokensOfOwner(address _owner) external view returns(uint256[] memory ownerTokens) {
        require(admins[_msgSender()] || lastWrite[_owner].blockNum < block.number, "hmmmm what doing?");
        
        uint256 tokenCount = balanceOf(_owner);

        if (tokenCount == 0) {
            // Return an empty array
            return new uint256[](0);
        } else {
            uint256[] memory result = new uint256[](tokenCount);
            uint256 totalSupply = totalSupply();
            uint256 resultIndex = 0;

            // We count on the fact that all goats have IDs starting at 1 and increasing
            // sequentially up to the totalGoats count.
            uint256 tokenId;
            for (tokenId = 1; tokenId <= totalSupply; tokenId++) {
                if (ownerOf(tokenId) == _owner) {
                    result[resultIndex] = tokenId;
                    resultIndex++;
                }
            }

            return result;
        }
    }

    /**
    * allows owner to withdraw funds from minting
    */
    function withdraw() external onlyOwner {
        payable(owner()).transfer(address(this).balance);
    }

    /**
    * called after deployment so that the contract can get random Goat thieves
    * @param _protectedIsland the address of the ProtectedIsland
    */
    function setProtectedIsland(address _protectedIsland) external onlyOwner {
        protectedIsland = IProtectedIsland(_protectedIsland);
    }

    /**
    * @param _oldGoatContract the address of the old goat contract
    */
    function setOldGoatContract(IERC721 _oldGoatContract) external onlyOwner {
        oldGoatContract = _oldGoatContract;
    }

    /**
    * updates the number of tokens for sale
    */
    function setPaidTokens(uint256 _paidTokens) external onlyOwner {
        PAID_TOKENS = _paidTokens;
    }

    /**
    * Updates the mint price
    */
    function setMintPrice(uint256 _mintPriceInWei) external onlyOwner {
        MINT_PRICE = _mintPriceInWei;
    }

    /**
    * Updates the max tokens;
    */
    function setMaxTokens(uint256 _maxTokens) external onlyOwner {
        MAX_TOKENS = _maxTokens;
    }
    
    /**
    * updates the sales of the earlyAccess and the public sale
    */
    function setSales(bool _earlyAccessMintSale, bool _publicMintSale) external onlyOwner {
        earlyAccessMintSale = _earlyAccessMintSale;
        publicMintSale = _publicMintSale;
    }

    /**
    * updates the sales of the earlyAccess and the public sale
    */
    function setWhitelistSigner(address _whitelistSigner) external onlyOwner {
        whitelistSigner = _whitelistSigner;
    }

    /**
    * enables owner to pause / unpause minting
    */
    function setPaused(bool _paused) external onlyOwner {
        if (_paused) _pause();
        else _unpause();
    }

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
        return traits.tokenURI(tokenId);
    }

    /** OVERRIDES FOR SAFETY */

    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override(ERC721Enumerable) disallowIfStateIsChanging returns (uint256) {
        // Y U checking on this address in the same block it's being modified... hmmmm
        require(admins[_msgSender()] || lastWrite[owner].blockNum < block.number, "hmmmm what doing?");
        return super.tokenOfOwnerByIndex(owner, index);
    }

    function balanceOf(address owner) public view virtual override(ERC721) disallowIfStateIsChanging returns (uint256) {
        // Y U checking on this address in the same block it's being modified... hmmmm
        require(admins[_msgSender()] || lastWrite[owner].blockNum < block.number, "hmmmm what doing?");
        return super.balanceOf(owner);
    }

    function ownerOf(uint256 tokenId) public view virtual override(ERC721) disallowIfStateIsChanging returns (address) {
        address addr = super.ownerOf(tokenId);
        // Y U checking on this address in the same block it's being modified... hmmmm
        require(admins[_msgSender()] || lastWrite[addr].blockNum < block.number, "hmmmm what doing?");
        return addr;
    }
}

File 2 of 22 : IGoat.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

interface IGoat {

  // struct to store each token's traits
  struct GoatTortoise {
    bool isTortoise;
    uint8 fur;
    uint8 skin;
    uint8 ears;
    uint8 eyes;
    uint8 shell;
    uint8 face;
    uint8 neck;
    uint8 feet;
    uint8 accessory;
    uint8 fertilityIndex;
  }

  function getPaidTokens() external view returns (uint256);
  function getTokenTraits(uint256 tokenId) external view returns (GoatTortoise memory);
}

File 3 of 22 : IBarn.sol
// SPDX-License-Identifier: MIT LICENSE 

pragma solidity ^0.8.0;

interface IProtectedIsland {
  function addManyToProtectedIslandAndPack(address account, uint16[] calldata tokenIds) external;
  function randomGoatOwner(uint256 seed) external view returns (address);
}

File 4 of 22 : ITraits.sol
// SPDX-License-Identifier: MIT LICENSE 

pragma solidity ^0.8.0;

interface ITraits {
  function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 5 of 22 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./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() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

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

pragma solidity ^0.8.0;

import "./Context.sol";

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

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

    bool private _paused;

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

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

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

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

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

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

File 7 of 22 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.0 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../utils/Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 8 of 22 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../interface/IERC721Enumerable.sol";
import "./ERC721.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 9 of 22 : EGG.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./token/ERC20.sol";
import "./utils/Ownable.sol";

contract EGG is ERC20, Ownable {

  // a mapping from an address to whether or not it can mint / burn
  mapping(address => bool) controllers;
  
  constructor() ERC20("EGG", "EGG") { }

  /**
   * mints $EGG to a recipient
   * @param to the recipient of the $EGG
   * @param amount the amount of $EGG to mint
   */
  function mint(address to, uint256 amount) external {
    require(controllers[msg.sender], "Only controllers can mint");
    _mint(to, amount);
  }

  /**
   * burns $EGG from a holder
   * @param from the holder of the $EGG
   * @param amount the amount of $EGG to burn
   */
  function burn(address from, uint256 amount) external {
    require(controllers[msg.sender], "Only controllers can burn");
    _burn(from, amount);
  }

  /**
   * enables an address to mint / burn
   * @param controller the address to enable
   */
  function addController(address controller) external onlyOwner {
    controllers[controller] = true;
  }

  /**
   * disables an address from minting / burning
   * @param controller the address to disbale
   */
  function removeController(address controller) external onlyOwner {
    controllers[controller] = false;
  }
}

File 10 of 22 : 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) {
        return msg.data;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 12 of 22 : 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 13 of 22 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../interface/IERC721.sol";
import "../interface/IERC721Receiver.sol";
import "../interface/IERC721Metadata.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "./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}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. 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.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    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` and `to` are never both zero.
     *
     * 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 14 of 22 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./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 15 of 22 : 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 16 of 22 : 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 17 of 22 : 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 18 of 22 : 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;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 19 of 22 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../interface/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 20 of 22 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../interface/IERC20.sol";
import "../interface/IERC20Metadata.sol";
import "../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

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

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 21 of 22 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_egg","type":"address"},{"internalType":"address","name":"_traits","type":"address"},{"internalType":"uint256","name":"_maxTokens","type":"uint256"},{"internalType":"address","name":"_whitelistSigner","type":"address"},{"internalType":"contract IERC721","name":"_oldGoatContract","type":"address"}],"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":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"GoatStolen","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TortoiseStolen","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAID_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRESALE_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"aliases","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"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":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"maxCount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bool","name":"_stake","type":"bool"}],"name":"earlyAccessMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"earlyAccessMintSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"egg","outputs":[{"internalType":"contract EGG","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"existingCombinations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPaidTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenTraits","outputs":[{"components":[{"internalType":"bool","name":"isTortoise","type":"bool"},{"internalType":"uint8","name":"fur","type":"uint8"},{"internalType":"uint8","name":"skin","type":"uint8"},{"internalType":"uint8","name":"ears","type":"uint8"},{"internalType":"uint8","name":"eyes","type":"uint8"},{"internalType":"uint8","name":"shell","type":"uint8"},{"internalType":"uint8","name":"face","type":"uint8"},{"internalType":"uint8","name":"neck","type":"uint8"},{"internalType":"uint8","name":"feet","type":"uint8"},{"internalType":"uint8","name":"accessory","type":"uint8"},{"internalType":"uint8","name":"fertilityIndex","type":"uint8"}],"internalType":"struct IGoat.GoatTortoise","name":"","type":"tuple"}],"stateMutability":"view","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":"uint256","name":"tokenId","type":"uint256"}],"name":"mintCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minted","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oldGoatContract","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protectedIsland","outputs":[{"internalType":"contract IProtectedIsland","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_stake","type":"bool"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"publicMintSale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"rarities","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"uint256","name":"_maxTokens","type":"uint256"}],"name":"setMaxTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintPriceInWei","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"_oldGoatContract","type":"address"}],"name":"setOldGoatContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_paidTokens","type":"uint256"}],"name":"setPaidTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_protectedIsland","type":"address"}],"name":"setProtectedIsland","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_earlyAccessMintSale","type":"bool"},{"internalType":"bool","name":"_publicMintSale","type":"bool"}],"name":"setSales","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_whitelistSigner","type":"address"}],"name":"setWhitelistSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"swapTokens","outputs":[],"stateMutability":"nonpayable","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":"","type":"uint256"}],"name":"tokenTraits","outputs":[{"internalType":"bool","name":"isTortoise","type":"bool"},{"internalType":"uint8","name":"fur","type":"uint8"},{"internalType":"uint8","name":"skin","type":"uint8"},{"internalType":"uint8","name":"ears","type":"uint8"},{"internalType":"uint8","name":"eyes","type":"uint8"},{"internalType":"uint8","name":"shell","type":"uint8"},{"internalType":"uint8","name":"face","type":"uint8"},{"internalType":"uint8","name":"neck","type":"uint8"},{"internalType":"uint8","name":"feet","type":"uint8"},{"internalType":"uint8","name":"accessory","type":"uint8"},{"internalType":"uint8","name":"fertilityIndex","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"ownerTokens","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalGoatMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalGoatStolen","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTortoiseMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTortoiseStolen","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"traits","outputs":[{"internalType":"contract ITraits","name":"","type":"address"}],"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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"uint256","name":"hasMinted","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405266957588590e5000600f556042805461ffff60a01b191690553480156200002a57600080fd5b5060405162005972380380620059728339810160408190526200004d916200106e565b604080518082018252600e81526d456e6368616e7465642047616d6560901b6020808301918252835180850190945260058452644547414d4560d81b908401528151919291620000a09160009162000f25565b508051620000b690600190602084019062000f25565b505050620000d3620000cd62000ecf60201b60201c565b62000ed3565b600a805460ff60a01b19169055604180546001600160a01b038088166001600160a01b0319928316179092556042805492871692909116919091179055601083905562000122600584620010e2565b601155604480546001600160a01b038481166001600160a01b031992831617909255604580549284169290911691909117905560408051610280810182526080808252604d6020830181905292820183905260608201819052609981830181905260a0830182905260c0830182905260e083018290526101008301829052610120830182905260e6610140840181905260ff610160850181905261018085018290526101a08501919091526101c08401526101e0830193909352610200820183905261022082019290925260cc6102408201526102608101919091526200020e90601390601462000fb4565b506040805161028081018252600e80825260006020830152600a928201839052606082018390526080820183905260a0820192909252600b60c0820181905260e0820181905261010082018190526101208201819052610140820183905261016082015261018081018290526101a081018290526101c0810191909152600c6101e08201819052610200820152600d61022082018190526102408201819052610260820152620002c390602790601462000fb4565b50604080516020810190915260ff8152620002e390601490600162000fb4565b506040805160208101909152600081526200030390602890600162000fb4565b50604080516101208101825260d8815260e6602082018190529181019190915260cf606082015260ac60808201819052602e60a083015260ff60c083015260e0820152605c6101008201526200035e90601590600962000fb4565b5060408051610120810182526006808252600060208301819052928201839052606082018390526080820183905260a0820183905260c0820181905260e0820192909252610100810191909152620003bb90602990600962000fb4565b50604080516101408101825260ff80825260806020830181905292820181905260bf6060830181905283830182905260a0830184905260c083015260e082015261010081018290526101208101919091526200041c90601690600a62000fb4565b506040805161014081018252600080825260208201819052600292820192909252606081018290526004608082015260a0810182905260c08101829052600760e082018190526101008201929092526101208101919091526200048490602a90600a62000fb4565b50604080516020810190915260ff8152620004a490601790600162000fb4565b50604080516020810190915260008152620004c490602b90600162000fb4565b50604080516020810190915260ff8152620004e490601890600162000fb4565b506040805160208101909152600081526200050490602c90600162000fb4565b50604080516101408101825260b3815260d96020820152608c9181019190915260cc6060820152604d60808083019190915260bf60a083015260c082015260ff60e0820152607361010082015260996101208201526200056990601990600a62000fb4565b5060408051610140810182526007808252600060208301819052928201839052606082018190526080820192909252600360a0820181905260c0820181905260e08201929092526101008101829052610120810191909152620005d190602d90600a62000fb4565b50604080516101408101825260ff808252602082018190528183018190526060820181905260bf60808084019190915260a083019190915260c0820181905260e082015261010081018290526101208101919091526200063690601a90600a62000fb4565b5060408051610140810182526000808252600160208301526002928201929092526003606082015260056080820181905260a0820181905260c0820192909252600460e082018190526101008201526101208101919091526200069e90602e90600a62000fb4565b50604080516080810182526066815260cc602082015260999181019190915260ff6060820152620006d490601b90600462000fb4565b50604080516080810182526002815260036020820181905291810182905260608101919091526200070a90602f90600462000fb4565b50604080516020810190915260ff81526200072a90601c90600162000fb4565b506040805160208101909152600081526200074a90603090600162000fb4565b50604080516020810190915260ff81526200076a90601d90600162000fb4565b506040805160208101909152600081526200078a90603190600162000fb4565b50604080516102808101825260e38082526020820181905260ff928201839052606082018390526080820183905260aa60a0830181905260c083015260e08201819052610100820183905261012082018190526101408201819052610160820181905260c661018083018190526101a083018190526101c083018190526101e08301919091526102008201929092526102208101829052610240810191909152608e6102608201526200084290601e90601462000fb4565b5060408051610280810182526008808252600060208301819052600293830193909352600360608301526004608083015260a08201839052600c60c083015260e08201839052610100820152610120810182905261014081018290526101608101829052600f6101808201526101a081018290526101c0810182905260106101e0820181905261020082015261022081018290526102408101919091526006610260820152620008f790603290601462000fb4565b50604080516020810190915260ff81526200091790601f90600162000fb4565b506040805160208101909152600081526200093790603390600162000fb4565b5060408051602080820190925260ff8152620009569190600162000fb4565b506040805160208101909152600081526200097690603490600162000fb4565b50604080516102808101825260ff808252607160208301819052603993830184905260608301829052608e6080840181905260e360a0850181905260c0850181905260e08501839052610100850195909552601c6101208501526101408401859052610160840181905260aa61018085018190526101a085018490526101c085018390526101e085019290925261020084019190915261022083019190915261024082015261026081019190915262000a3490602190601462000fb4565b5060408051610280810182526000808252600c60208301819052600d93830184905260036060840181905260106080850152601160a0850181905260c0850193909352600160e0850181905261010085015260026101208501526101408401819052610160840181905261018084018390526101a08401949094526101c083019390935260046101e08301526102008201819052610220820152600561024082015261026081019190915262000aef90603590601462000fb4565b5060408051610140810182526063815260f160208201526047918101829052606081019190915260ff6080820181905260aa60a0830152608e60c0830181905260e0830152610100820181905261012082015262000b5290602290600a62000fb4565b5060408051610140810182526009808252602082018190526000928201929092526001606082015260046080820181905260a0820181905260c0820181905260e0820152600861010082015261012081019190915262000bb790603690600a62000fb4565b50604080516020810190915260ff815262000bd790602390600162000fb4565b5060408051602081019091526000815262000bf790603790600162000fb4565b50604080516101408101825260e380825260aa602083015260ff928201839052608e606083018190526080830181905260c660a084015260c083019190915260e0820192909252610100810182905261012081019190915262000c5f90602490600a62000fb4565b5060408051610140810182526002808252600560208301529181019190915260006060820181905260808201819052600660a0830152600760c0830181905260e0830152610100820152600161012082015262000cc190603890600a62000fb4565b50604080516080810182526039815260aa6020820152608e9181019190915260ff606082015262000cf790602590600462000fb4565b506040805160808101825260028152600360208201819052918101829052606081019190915262000d2d90603990600462000fb4565b50604080516101408101825260c680825260e36020830181905260ff938301849052606083018190526080830184905260a0830184905260c083015260e0820183905261010082019290925261012081019190915262000d9290602690600a62000fb4565b506040805161014081018252600181526004602082018190526002928201839052600560608301819052608083019190915260a082015260c0810191909152600760e08201526008610100820152600361012082015262000df890603a90600a62000fb4565b5050604080518082018252600381526245434360e81b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527f66100b7d6ab143cd8cb9b49e9da10019e1ff6e4a8b8057320aa6bea0a69accfe818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c09091019092528151910120604355506200115b92505050565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b82805462000f339062001105565b90600052602060002090601f01602090048101928262000f57576000855562000fa2565b82601f1062000f7257805160ff191683800117855562000fa2565b8280016001018555821562000fa2579182015b8281111562000fa257825182559160200191906001019062000f85565b5062000fb092915062001057565b5090565b82805482825590600052602060002090601f0160209004810192821562000fa25791602002820160005b838211156200101e57835183826101000a81548160ff021916908360ff160217905550926020019260010160208160000104928301926001030262000fde565b80156200104d5782816101000a81549060ff02191690556001016020816000010492830192600103026200101e565b505062000fb09291505b5b8082111562000fb0576000815560010162001058565b600080600080600060a086880312156200108757600080fd5b8551620010948162001142565b6020870151909550620010a78162001142565b604087015160608801519195509350620010c18162001142565b6080870151909250620010d48162001142565b809150509295509295909350565b6000826200110057634e487b7160e01b600052601260045260246000fd5b500490565b600181811c908216806200111a57607f821691505b602082108114156200113c57634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b03811681146200115857600080fd5b50565b614807806200116b6000396000f3fe6080604052600436106103815760003560e01c80638b4f8564116101d1578063c06abfc711610102578063e1fc334f116100a0578063ef81b4d41161006f578063ef81b4d414610b56578063f2fde38b14610b76578063f47c84c514610b96578063f4a0a52814610bac57600080fd5b8063e1fc334f14610ab7578063e985e9c514610ad7578063e9e13d8414610b20578063ea5a2b3414610b4057600080fd5b8063d3381438116100dc578063d338143814610947578063d4ae752214610967578063da71aed81461099b578063e05c57bf146109bb57600080fd5b8063c06abfc7146108f1578063c084f54014610911578063c87b56dd1461092757600080fd5b8063a1b8f3741161016f578063b88d4fde11610149578063b88d4fde1461087b578063becf1f2a1461089b578063bee1d37f146108bb578063c002d23d146108db57600080fd5b8063a1b8f3741461081b578063a22cb46514610848578063a243d3b61461086857600080fd5b806395d89b41116101ab57806395d89b41146107a2578063969956e0146107b75780639b19251a146107cd5780639fde71d3146107fa57600080fd5b80638b4f8564146107415780638da5cb5b1461075757806394e568471461077557600080fd5b80633431a753116102b65780634f02c4201161025457806370a082311161022357806370a08231146106bf578063715018a6146106df5780637a07b5ef146106f45780638462151c1461071457600080fd5b80634f02c420146106325780634f6ccce7146106605780635c975abb146106805780636352211e1461069f57600080fd5b80633ccfd60b116102905780633ccfd60b146105d55780634018b1f8146105ea57806342842e0e146105ff578063477f584a1461061f57600080fd5b80633431a7531461057f5780633644e5151461059f57806336838391146105b557600080fd5b806316c38b3c1161032357806323b872dd116102fd57806323b872dd146104ed57806327de8f271461050d5780632f745c591461052d57806333df4b2c1461054d57600080fd5b806316c38b3c1461049857806318160ddd146104b8578063193fdf69146104d757600080fd5b8063081812fc1161035f578063081812fc146103ff578063095ea7b31461043757806311e776fe1461045757806312d009341461047757600080fd5b806301ffc9a71461038657806306fdde03146103bb57806307b60749146103dd575b600080fd5b34801561039257600080fd5b506103a66103a1366004613fc5565b610bcc565b60405190151581526020015b60405180910390f35b3480156103c757600080fd5b506103d0610bf7565b6040516103b29190614305565b3480156103e957600080fd5b506103fd6103f8366004613d48565b610c89565b005b34801561040b57600080fd5b5061041f61041a366004614075565b610cde565b6040516001600160a01b0390911681526020016103b2565b34801561044357600080fd5b506103fd610452366004613e95565b610d73565b34801561046357600080fd5b506103fd610472366004614075565b610e89565b34801561048357600080fd5b506042546103a690600160a01b900460ff1681565b3480156104a457600080fd5b506103fd6104b3366004613f6d565b610eb8565b3480156104c457600080fd5b506008545b6040519081526020016103b2565b3480156104e357600080fd5b506104c9600e5481565b3480156104f957600080fd5b506103fd610508366004613dbb565b610efb565b34801561051957600080fd5b506104c9610528366004614075565b610f47565b34801561053957600080fd5b506104c9610548366004613e95565b610fcf565b34801561055957600080fd5b5061056d6105683660046140cc565b61109b565b60405160ff90911681526020016103b2565b34801561058b57600080fd5b506103fd61059a366004614075565b6110e1565b3480156105ab57600080fd5b506104c960435481565b3480156105c157600080fd5b5061056d6105d03660046140cc565b611110565b3480156105e157600080fd5b506103fd611120565b3480156105f657600080fd5b506011546104c9565b34801561060b57600080fd5b506103fd61061a366004613dbb565b611183565b6103fd61062d3660046140ee565b61119e565b34801561063e57600080fd5b5060125461064d9061ffff1681565b60405161ffff90911681526020016103b2565b34801561066c57600080fd5b506104c961067b366004614075565b6113d0565b34801561068c57600080fd5b50600a54600160a01b900460ff166103a6565b3480156106ab57600080fd5b5061041f6106ba366004614075565b611463565b3480156106cb57600080fd5b506104c96106da366004613d48565b61152c565b3480156106eb57600080fd5b506103fd6115f0565b34801561070057600080fd5b506103fd61070f366004613fa7565b611626565b34801561072057600080fd5b5061073461072f366004613d48565b611684565b6040516103b291906142c1565b34801561074d57600080fd5b506104c9600c5481565b34801561076357600080fd5b50600a546001600160a01b031661041f565b34801561078157600080fd5b50610795610790366004614075565b6117e5565b6040516103b29190614445565b3480156107ae57600080fd5b506103d06118b1565b3480156107c357600080fd5b506104c9600b5481565b3480156107d957600080fd5b506104c96107e8366004613d48565b603e6020526000908152604090205481565b34801561080657600080fd5b506042546103a690600160a81b900460ff1681565b34801561082757600080fd5b506104c9610836366004614075565b603c6020526000908152604090205481565b34801561085457600080fd5b506103fd610863366004613e67565b6118c0565b6103fd6108763660046140a7565b611985565b34801561088757600080fd5b506103fd610896366004613dfc565b611a16565b3480156108a757600080fd5b5060455461041f906001600160a01b031681565b3480156108c757600080fd5b5060405461041f906001600160a01b031681565b3480156108e757600080fd5b506104c9600f5481565b3480156108fd57600080fd5b5060415461041f906001600160a01b031681565b34801561091d57600080fd5b506104c960115481565b34801561093357600080fd5b506103d0610942366004614075565b611a4e565b34801561095357600080fd5b506103fd610962366004613d48565b611b4d565b34801561097357600080fd5b506104c97f125e0edbb8302d72d12ce7ea3e79e536feb3425644748701c7480ffb4367a11b81565b3480156109a757600080fd5b506103fd6109b6366004613d48565b611b99565b3480156109c757600080fd5b50610a546109d6366004614075565b603b6020526000908152604090205460ff80821691610100810482169162010000820481169163010000008104821691640100000000820481169165010000000000810482169166010000000000008204811691600160381b8104821691600160401b8204811691600160481b8104821691600160501b909104168b565b604080519b15158c5260ff9a8b1660208d0152988a16988b019890985295881660608a0152938716608089015291861660a0880152851660c0870152841660e08601528316610100850152821661012084015216610140820152610160016103b2565b348015610ac357600080fd5b5060425461041f906001600160a01b031681565b348015610ae357600080fd5b506103a6610af2366004613d82565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610b2c57600080fd5b506103fd610b3b366004613ec1565b611be5565b348015610b4c57600080fd5b506104c9600d5481565b348015610b6257600080fd5b5060445461041f906001600160a01b031681565b348015610b8257600080fd5b506103fd610b91366004613d48565b6120ce565b348015610ba257600080fd5b506104c960105481565b348015610bb857600080fd5b506103fd610bc7366004614075565b612166565b60006001600160e01b0319821663780e9d6360e01b1480610bf15750610bf182612195565b92915050565b606060008054610c069061466c565b80601f0160208091040260200160405190810160405280929190818152602001828054610c329061466c565b8015610c7f5780601f10610c5457610100808354040283529160200191610c7f565b820191906000526020600020905b815481529060010190602001808311610c6257829003601f168201915b5050505050905090565b600a546001600160a01b03163314610cbc5760405162461bcd60e51b8152600401610cb3906143bf565b60405180910390fd5b604580546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260408120546001600160a01b0316610d575760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610cb3565b506000908152600460205260409020546001600160a01b031690565b6000610d7e826121e5565b9050806001600160a01b0316836001600160a01b03161415610dec5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610cb3565b336001600160a01b0382161480610e085750610e088133610af2565b610e7a5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610cb3565b610e84838361225c565b505050565b600a546001600160a01b03163314610eb35760405162461bcd60e51b8152600401610cb3906143bf565b601055565b600a546001600160a01b03163314610ee25760405162461bcd60e51b8152600401610cb3906143bf565b8015610ef357610ef06122ca565b50565b610ef061234c565b6040546001600160a01b0316336001600160a01b031614610f3c57610f2033826123d0565b610f3c5760405162461bcd60e51b8152600401610cb3906143f4565b610e848383836124c7565b60006011548211610f5a57506000919050565b60056010546002610f6b91906145be565b610f7591906145aa565b8211610f8c575069043c33c1937564800000919050565b60056010546004610f9d91906145be565b610fa791906145aa565b8211610fbe5750690878678326eac9000000919050565b506910f0cf064dd592000000919050565b336000908152603f602052604081205460ff168061100c5750326000908152603d602052604090205443600160401b9091046001600160401b0316105b6110285760405162461bcd60e51b8152600401610cb39061436a565b336000908152603f602052604090205460ff168061106e57506001600160a01b0383166000908152603d602052604090205443600160401b9091046001600160401b0316105b61108a5760405162461bcd60e51b8152600401610cb39061436a565b6110948383612672565b9392505050565b601382601481106110ab57600080fd5b0181815481106110ba57600080fd5b9060005260206000209060209182820401919006915091509054906101000a900460ff1681565b600a546001600160a01b0316331461110b5760405162461bcd60e51b8152600401610cb3906143bf565b601155565b602782601481106110ab57600080fd5b600a546001600160a01b0316331461114a5760405162461bcd60e51b8152600401610cb3906143bf565b600a546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610ef0573d6000803e3d6000fd5b610e8483838360405180602001604052806000815250611a16565b600a54600160a01b900460ff16156111c85760405162461bcd60e51b8152600401610cb390614395565b604254600160a01b900460ff166112215760405162461bcd60e51b815260206004820152601a60248201527f4561726c7920616363657373206973206e6f74206163746976650000000000006044820152606401610cb3565b604354604080517f125e0edbb8302d72d12ce7ea3e79e536feb3425644748701c7480ffb4367a11b602082015233918101919091526060810185905260009190608001604051602081830303815290604052805190602001206040516020016112a192919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181529190528051602090910120905060006112c78285612708565b90506001600160a01b038116158015906112ee57506044546001600160a01b038281169116145b61132e5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610cb3565b336000908152603e6020526040902054859061134b90889061456d565b11156113995760405162461bcd60e51b815260206004820152601f60248201527f4561726c7920416363657373206d617820636f756e74206578636565646564006044820152606401610cb3565b336000908152603e6020526040812080548892906113b890849061456d565b909155506113c890508684612724565b505050505050565b60006113db60085490565b821061143e5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610cb3565b600882815481106114515761145161476c565b90600052602060002001549050919050565b336000908152603f602052604081205460ff16806114a05750326000908152603d602052604090205443600160401b9091046001600160401b0316105b6114bc5760405162461bcd60e51b8152600401610cb39061436a565b60006114c7836121e5565b336000908152603f602052604090205490915060ff168061151057506001600160a01b0381166000908152603d602052604090205443600160401b9091046001600160401b0316105b610bf15760405162461bcd60e51b8152600401610cb39061436a565b336000908152603f602052604081205460ff16806115695750326000908152603d602052604090205443600160401b9091046001600160401b0316105b6115855760405162461bcd60e51b8152600401610cb39061436a565b336000908152603f602052604090205460ff16806115cb57506001600160a01b0382166000908152603d602052604090205443600160401b9091046001600160401b0316105b6115e75760405162461bcd60e51b8152600401610cb39061436a565b610bf182612ca0565b600a546001600160a01b0316331461161a5760405162461bcd60e51b8152600401610cb3906143bf565b6116246000612d27565b565b600a546001600160a01b031633146116505760405162461bcd60e51b8152600401610cb3906143bf565b6042805461ffff60a01b1916600160a01b9315159390930260ff60a81b191692909217600160a81b91151591909102179055565b336000908152603f602052604090205460609060ff16806116cd57506001600160a01b0382166000908152603d602052604090205443600160401b9091046001600160401b0316105b6116e95760405162461bcd60e51b8152600401610cb39061436a565b60006116f48361152c565b9050806117155760408051600080825260208201909252905b509392505050565b6000816001600160401b0381111561172f5761172f614782565b604051908082528060200260200182016040528015611758578160200160208202803683370190505b509050600061176660085490565b9050600060015b8281116117d457866001600160a01b031661178782611463565b6001600160a01b031614156117c257808483815181106117a9576117a961476c565b6020908102919091010152816117be816146c3565b9250505b806117cc816146c3565b91505061176d565b509195945050505050565b50919050565b6117ed613c96565b506000908152603b6020908152604091829020825161016081018452905460ff808216151583526101008083048216948401949094526201000082048116948301949094526301000000810484166060830152640100000000810484166080830152650100000000008104841660a083015266010000000000008104841660c0830152600160381b8104841660e0830152600160401b8104841692820192909252600160481b82048316610120820152600160501b90910490911661014082015290565b606060018054610c069061466c565b6001600160a01b0382163314156119195760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610cb3565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a54600160a01b900460ff16156119af5760405162461bcd60e51b8152600401610cb390614395565b604254600160a81b900460ff16611a085760405162461bcd60e51b815260206004820152601960248201527f5075626c69632073616c65206973206e6f7420616374697665000000000000006044820152606401610cb3565b611a128282612724565b5050565b611a2033836123d0565b611a3c5760405162461bcd60e51b8152600401610cb3906143f4565b611a4884848484612d79565b50505050565b6000818152600260205260409020546060906001600160a01b0316611acd5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610cb3565b60425460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd9060240160006040518083038186803b158015611b1157600080fd5b505afa158015611b25573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bf19190810190613fff565b600a546001600160a01b03163314611b775760405162461bcd60e51b8152600401610cb3906143bf565b604480546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b03163314611bc35760405162461bcd60e51b8152600401610cb3906143bf565b604080546001600160a01b0319166001600160a01b0392909216919091179055565b600a54600160a01b900460ff1615611c0f5760405162461bcd60e51b8152600401610cb390614395565b80516045546000906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b158015611c6557600080fd5b505afa158015611c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9d919061408e565b9050323314611cd95760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b6044820152606401610cb3565b601054601254611cee90849061ffff1661456d565b1115611d305760405162461bcd60e51b8152602060048201526011602482015270105b1b081d1bdad95b9cc81b5a5b9d1959607a1b6044820152606401610cb3565b60008111611d8c5760405162461bcd60e51b815260206004820152602360248201527f596f7520646f6e2774206f776e20616e79206f6620746865206f6c6420746f6b604482015262656e7360e81b6064820152608401610cb3565b6045546001600160a01b031663e985e9c5336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260440160206040518083038186803b158015611de357600080fd5b505afa158015611df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1b9190613f8a565b611e5e5760405162461bcd60e51b8152602060048201526014602482015273139bdd08185c1c1c9bdd995908199bdc88185b1b60621b6044820152606401610cb3565b6000805b838110156120c557604554855133916001600160a01b031690636352211e90889085908110611e9357611e9361476c565b60200260200101516040518263ffffffff1660e01b8152600401611eb991815260200190565b60206040518083038186803b158015611ed157600080fd5b505afa158015611ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f099190613d65565b6001600160a01b031614611f575760405162461bcd60e51b8152602060048201526015602482015274686d6d6d206e6f7420796f757220746f6b656e733f60581b6044820152606401610cb3565b6045546001600160a01b03166342842e0e3361dead888581518110611f7e57611f7e61476c565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015611fd857600080fd5b505af1158015611fec573d6000803e3d6000fd5b50506012805461ffff16925090506000612005836146a1565b82546101009290920a61ffff818102199093169183160217909155601254326000908152603d602052604090205461205493509116906001600160401b0380821691600160401b900416612dac565b601254326000908152603d60209081526040918290208251808401909352546001600160401b038082168452600160401b90910416908201529193506120a29161ffff909116908490612e3d565b506120b33360125461ffff16613077565b806120bd816146c3565b915050611e62565b50611a48613091565b600a546001600160a01b031633146120f85760405162461bcd60e51b8152600401610cb3906143bf565b6001600160a01b03811661215d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610cb3565b610ef081612d27565b600a546001600160a01b031633146121905760405162461bcd60e51b8152600401610cb3906143bf565b600f55565b60006001600160e01b031982166380ac58cd60e01b14806121c657506001600160e01b03198216635b5e139f60e01b145b80610bf157506301ffc9a760e01b6001600160e01b0319831614610bf1565b6000818152600260205260408120546001600160a01b031680610bf15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610cb3565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612291826121e5565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600a54600160a01b900460ff16156122f45760405162461bcd60e51b8152600401610cb390614395565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861232f3390565b6040516001600160a01b03909116815260200160405180910390a1565b600a54600160a01b900460ff1661239c5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610cb3565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361232f565b6000818152600260205260408120546001600160a01b03166124495760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610cb3565b6000612454836121e5565b9050806001600160a01b0316846001600160a01b0316148061248f5750836001600160a01b031661248484610cde565b6001600160a01b0316145b806124bf57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166124da826121e5565b6001600160a01b0316146125425760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610cb3565b6001600160a01b0382166125a45760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610cb3565b6125af8383836130db565b6125ba60008261225c565b6001600160a01b03831660009081526003602052604081208054600192906125e39084906145dd565b90915550506001600160a01b038216600090815260036020526040812080546001929061261190849061456d565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061267d83612ca0565b82106126df5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610cb3565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60008060006127178585613193565b9150915061170d81613203565b32331461275e5760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b6044820152606401610cb3565b60105460125461277390849061ffff1661456d565b11156127b55760405162461bcd60e51b8152602060048201526011602482015270105b1b081d1bdad95b9cc81b5a5b9d1959607a1b6044820152606401610cb3565b6000821180156127c65750600a8211155b6128085760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b6044820152606401610cb3565b60115460125461ffff1610156128d55760115460125461282d90849061ffff1661456d565b111561287b5760405162461bcd60e51b815260206004820152601f60248201527f416c6c20746f6b656e73206f6e2d73616c6520616c726561647920736f6c64006044820152606401610cb3565b34600f548361288a91906145be565b146128d05760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081c185e5b595b9d08185b5bdd5b9d60521b6044820152606401610cb3565b6128e0565b34156128e057600080fd5b600080826128fc5760408051600081526020810190915261293f565b836001600160401b0381111561291457612914614782565b60405190808252806020026020018201604052801561293d578160200160208202803683370190505b505b90506000805b85811015612bae576012805461ffff16906000612961836146a1565b82546101009290920a61ffff818102199093169183160217909155601254326000908152603d60205260409020546129b093509116906001600160401b0380821691600160401b900416612dac565b601254326000908152603d60209081526040918290208251808401909352546001600160401b038082168452600160401b90910416908201529193506129fe9161ffff909116908490612e3d565b506000612a0a836133be565b9050851580612a2257506001600160a01b0381163314155b15612b2c57601254612a3990829061ffff16613077565b6001600160a01b0381163314612b275760125461ffff166000908152603b602052604090205460ff1615612ac9576001600d6000828254612a7a919061456d565b90915550506012546040805133815261ffff90921660208301524282820152517f176aa3bfd1d48b2c9177a323a36242680de10daa71b1958d4cce6365cc8ddac29181900360600190a1612b7e565b6001600e6000828254612adc919061456d565b90915550506012546040805133815261ffff90921660208301524282820152517fe5362f114e5b6824f477915abea9bd6af2fc8b9e881889a96a6d5ccf29cac2439181900360600190a15b612b7e565b604054601254612b49916001600160a01b03169061ffff16613077565b601254845161ffff90911690859084908110612b6757612b6761476c565b602002602001019061ffff16908161ffff16815250505b601254612b8e9061ffff16610f47565b612b98908661456d565b9450508080612ba6906146c3565b915050612945565b508215612c28576041546001600160a01b0316639dc29fac336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101869052604401600060405180830381600087803b158015612c0f57600080fd5b505af1158015612c23573d6000803e3d6000fd5b505050505b8315612c91576040546001600160a01b0316633da0128e33846040518363ffffffff1660e01b8152600401612c5e929190614267565b600060405180830381600087803b158015612c7857600080fd5b505af1158015612c8c573d6000803e3d6000fd5b505050505b612c99613091565b5050505050565b60006001600160a01b038216612d0b5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610cb3565b506001600160a01b031660009081526003602052604090205490565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612d848484846124c7565b612d908484848461348b565b611a485760405162461bcd60e51b8152600401610cb390614318565b6000326001836001600160401b031611612dc65782612dd1565b612dd16002846145f4565b60405160609290921b6bffffffffffffffffffffffff191660208301526001600160401b031640603482015260c084901b6001600160c01b0319166054820152605c8101859052607c016040516020818303038152906040528051906020012060001c90509392505050565b612e45613c96565b612e4e83613598565b9050603c6000612e5d83613729565b8152602001908152602001600020546000141561305a5780603b600086815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff1602179055506101208201518160000160096101000a81548160ff021916908360ff16021790555061014082015181600001600a6101000a81548160ff021916908360ff16021790555090505083603c600061300684613729565b815260208101919091526040016000205580511561303c576001600b6000828254613031919061456d565b909155506130559050565b6001600c600082825461304f919061456d565b90915550505b611094565b6124bf846130718585600001518660200151612dac565b84612e3d565b611a1282826040518060200160405280600081525061378d565b326000908152603d6020526040902080546fffffffffffffffffffffffffffffffff1916600160401b436001600160401b031690810267ffffffffffffffff191691909117179055565b6001600160a01b0383166131365761313181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613159565b816001600160a01b0316836001600160a01b0316146131595761315983826137c0565b6001600160a01b03821661317057610e848161385d565b826001600160a01b0316826001600160a01b031614610e8457610e84828261390c565b6000808251604114156131ca5760208301516040840151606085015160001a6131be87828585613950565b945094505050506131fc565b8251604014156131f457602083015160408401516131e9868383613a3d565b9350935050506131fc565b506000905060025b9250929050565b600081600481111561321757613217614740565b14156132205750565b600181600481111561323457613234614740565b14156132825760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610cb3565b600281600481111561329657613296614740565b14156132e45760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610cb3565b60038160048111156132f8576132f8614740565b14156133515760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610cb3565b600481600481111561336557613365614740565b1415610ef05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610cb3565b60115460125460009161ffff9091161115806133e757506133e4600a60f584901c6146de565b15155b156133f25733610bf1565b604080549051600162955d2360e01b03198152609084901c60048201526000916001600160a01b03169063ff6aa2dd9060240160206040518083038186803b15801561343d57600080fd5b505afa158015613451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134759190613d65565b90506001600160a01b038116610bf15733611094565b60006001600160a01b0384163b1561358d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906134cf90339089908890889060040161422a565b602060405180830381600087803b1580156134e957600080fd5b505af1925050508015613519575060408051601f3d908101601f1916820190925261351691810190613fe2565b60015b613573573d808015613547576040519150601f19603f3d011682016040523d82523d6000602084013e61354c565b606091505b50805161356b5760405162461bcd60e51b8152600401610cb390614318565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506124bf565b506001949350505050565b6135a0613c96565b6135af600a61ffff84166146de565b15158082526000906135c25760006135c5565b600a5b60109390931c9290506135e661ffff84166135e1836000614585565b613a6c565b60ff16602083015260109290921c9161360861ffff84166135e1836001614585565b60ff16604083015260109290921c9161362a61ffff84166135e1836002614585565b60ff16606083015260109290921c9161364c61ffff84166135e1836003614585565b60ff16608083015260109290921c9161366e61ffff84166135e1836004614585565b60ff1660a083015260109290921c9161369061ffff84166135e1836005614585565b60ff1660c083015260109290921c916136b261ffff84166135e1836006614585565b60ff1660e083015260109290921c916136d461ffff84166135e1836007614585565b60ff1661010083015260109290921c916136f761ffff84166135e1836008614585565b60ff1661014083015260109290921c9161371a61ffff84166135e1836009614585565b60ff1661012083015250919050565b80516020808301516040808501516060860151608087015160a088015160c089015160e08a01516101008b01516101208c01516101408d0151985160009c6137759c909b9a910161418d565b604051602081830303815290604052610bf19061461c565b6137978383613b48565b6137a4600084848461348b565b610e845760405162461bcd60e51b8152600401610cb390614318565b600060016137cd84612ca0565b6137d791906145dd565b60008381526007602052604090205490915080821461382a576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061386f906001906145dd565b600083815260096020526040812054600880549394509092849081106138975761389761476c565b9060005260206000200154905080600883815481106138b8576138b861476c565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806138f0576138f0614756565b6001900381819060005260206000200160009055905550505050565b600061391783612ca0565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139875750600090506003613a34565b8460ff16601b1415801561399f57508460ff16601c14155b156139b05750600090506004613a34565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a04573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a2d57600060019250925050613a34565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01613a5e87828885613950565b935093505050935093915050565b60008060138360ff1660148110613a8557613a8561476c565b0154613a9190856146f2565b905060138360ff1660148110613aa957613aa961476c565b018160ff1681548110613abe57613abe61476c565b60009182526020918290209181049091015460ff601f9092166101000a90048116600886901c9091161015613af4579050610bf1565b60278360ff1660148110613b0a57613b0a61476c565b018160ff1681548110613b1f57613b1f61476c565b90600052602060002090602091828204019190069054906101000a900460ff1691505092915050565b6001600160a01b038216613b9e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610cb3565b6000818152600260205260409020546001600160a01b031615613c035760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610cb3565b613c0f600083836130db565b6001600160a01b0382166000908152600360205260408120805460019290613c3890849061456d565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915290565b600082601f830112613d0357600080fd5b8135613d16613d1182614546565b614516565b818152846020838601011115613d2b57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215613d5a57600080fd5b813561109481614798565b600060208284031215613d7757600080fd5b815161109481614798565b60008060408385031215613d9557600080fd5b8235613da081614798565b91506020830135613db081614798565b809150509250929050565b600080600060608486031215613dd057600080fd5b8335613ddb81614798565b92506020840135613deb81614798565b929592945050506040919091013590565b60008060008060808587031215613e1257600080fd5b8435613e1d81614798565b93506020850135613e2d81614798565b92506040850135915060608501356001600160401b03811115613e4f57600080fd5b613e5b87828801613cf2565b91505092959194509250565b60008060408385031215613e7a57600080fd5b8235613e8581614798565b91506020830135613db0816147ad565b60008060408385031215613ea857600080fd5b8235613eb381614798565b946020939093013593505050565b60006020808385031215613ed457600080fd5b82356001600160401b0380821115613eeb57600080fd5b818501915085601f830112613eff57600080fd5b813581811115613f1157613f11614782565b8060051b9150613f22848301614516565b8181528481019084860184860187018a1015613f3d57600080fd5b600095505b83861015613f60578035835260019590950194918601918601613f42565b5098975050505050505050565b600060208284031215613f7f57600080fd5b8135611094816147ad565b600060208284031215613f9c57600080fd5b8151611094816147ad565b60008060408385031215613fba57600080fd5b8235613e85816147ad565b600060208284031215613fd757600080fd5b8135611094816147bb565b600060208284031215613ff457600080fd5b8151611094816147bb565b60006020828403121561401157600080fd5b81516001600160401b0381111561402757600080fd5b8201601f8101841361403857600080fd5b8051614046613d1182614546565b81815285602083850101111561405b57600080fd5b61406c826020830160208601614640565b95945050505050565b60006020828403121561408757600080fd5b5035919050565b6000602082840312156140a057600080fd5b5051919050565b600080604083850312156140ba57600080fd5b823591506020830135613db0816147ad565b600080604083850312156140df57600080fd5b50508035926020909101359150565b6000806000806080858703121561410457600080fd5b843593506020850135925060408501356001600160401b0381111561412857600080fd5b61413487828801613cf2565b9250506060850135614145816147ad565b939692955090935050565b60008151808452614168816020860160208601614640565b601f01601f19169290920160200192915050565b60f81b6001600160f81b0319169052565b8b151560f81b8152600060ff60f81b808d60f81b166001840152808c60f81b166002840152808b60f81b166003840152808a60f81b166004840152506141d6600583018961417c565b6141e3600683018861417c565b6141f0600783018761417c565b6141fd600883018661417c565b61420a600983018561417c565b614217600a83018461417c565b50600b019b9a5050505050505050505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061425d90830184614150565b9695505050505050565b6001600160a01b038316815260406020808301829052835191830182905260009184820191906060850190845b818110156142b457845161ffff1683529383019391830191600101614294565b5090979650505050505050565b6020808252825182820181905260009190848201906040850190845b818110156142f9578351835292840192918401916001016142dd565b50909695505050505050565b6020815260006110946020830184614150565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b602080825260119082015270686d6d6d6d207768617420646f696e673f60781b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b81511515815261016081016020830151614464602084018260ff169052565b506040830151614479604084018260ff169052565b50606083015161448e606084018260ff169052565b5060808301516144a3608084018260ff169052565b5060a08301516144b860a084018260ff169052565b5060c08301516144cd60c084018260ff169052565b5060e08301516144e260e084018260ff169052565b506101008381015160ff90811691840191909152610120808501518216908401526101409384015116929091019190915290565b604051601f8201601f191681016001600160401b038111828210171561453e5761453e614782565b604052919050565b60006001600160401b0382111561455f5761455f614782565b50601f01601f191660200190565b6000821982111561458057614580614714565b500190565b600060ff821660ff84168060ff038211156145a2576145a2614714565b019392505050565b6000826145b9576145b961472a565b500490565b60008160001904831182151516156145d8576145d8614714565b500290565b6000828210156145ef576145ef614714565b500390565b60006001600160401b038381169083168181101561461457614614614714565b039392505050565b805160208083015191908110156117df5760001960209190910360031b1b16919050565b60005b8381101561465b578181015183820152602001614643565b83811115611a485750506000910152565b600181811c9082168061468057607f821691505b602082108114156117df57634e487b7160e01b600052602260045260246000fd5b600061ffff808316818114156146b9576146b9614714565b6001019392505050565b60006000198214156146d7576146d7614714565b5060010190565b6000826146ed576146ed61472a565b500690565b600060ff8316806147055761470561472a565b8060ff84160691505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610ef057600080fd5b8015158114610ef057600080fd5b6001600160e01b031981168114610ef057600080fdfea2646970667358221220b5cf38e368665487325386b3bd260d6b3bfd1bd3e3c5225a91013f2a460aa76a64736f6c6343000807003300000000000000000000000081d327cf395347dd6cc0c427bb9ea77ec120e304000000000000000000000000391f60b43619d39db931c645f863c12674a4da6e000000000000000000000000000000000000000000000000000000000000c350000000000000000000000000269b68fc83a90a83729047a9c925480152f707350000000000000000000000004958ce8ddf7131286dcf5298a357d981e18a5c9e

Deployed Bytecode

0x6080604052600436106103815760003560e01c80638b4f8564116101d1578063c06abfc711610102578063e1fc334f116100a0578063ef81b4d41161006f578063ef81b4d414610b56578063f2fde38b14610b76578063f47c84c514610b96578063f4a0a52814610bac57600080fd5b8063e1fc334f14610ab7578063e985e9c514610ad7578063e9e13d8414610b20578063ea5a2b3414610b4057600080fd5b8063d3381438116100dc578063d338143814610947578063d4ae752214610967578063da71aed81461099b578063e05c57bf146109bb57600080fd5b8063c06abfc7146108f1578063c084f54014610911578063c87b56dd1461092757600080fd5b8063a1b8f3741161016f578063b88d4fde11610149578063b88d4fde1461087b578063becf1f2a1461089b578063bee1d37f146108bb578063c002d23d146108db57600080fd5b8063a1b8f3741461081b578063a22cb46514610848578063a243d3b61461086857600080fd5b806395d89b41116101ab57806395d89b41146107a2578063969956e0146107b75780639b19251a146107cd5780639fde71d3146107fa57600080fd5b80638b4f8564146107415780638da5cb5b1461075757806394e568471461077557600080fd5b80633431a753116102b65780634f02c4201161025457806370a082311161022357806370a08231146106bf578063715018a6146106df5780637a07b5ef146106f45780638462151c1461071457600080fd5b80634f02c420146106325780634f6ccce7146106605780635c975abb146106805780636352211e1461069f57600080fd5b80633ccfd60b116102905780633ccfd60b146105d55780634018b1f8146105ea57806342842e0e146105ff578063477f584a1461061f57600080fd5b80633431a7531461057f5780633644e5151461059f57806336838391146105b557600080fd5b806316c38b3c1161032357806323b872dd116102fd57806323b872dd146104ed57806327de8f271461050d5780632f745c591461052d57806333df4b2c1461054d57600080fd5b806316c38b3c1461049857806318160ddd146104b8578063193fdf69146104d757600080fd5b8063081812fc1161035f578063081812fc146103ff578063095ea7b31461043757806311e776fe1461045757806312d009341461047757600080fd5b806301ffc9a71461038657806306fdde03146103bb57806307b60749146103dd575b600080fd5b34801561039257600080fd5b506103a66103a1366004613fc5565b610bcc565b60405190151581526020015b60405180910390f35b3480156103c757600080fd5b506103d0610bf7565b6040516103b29190614305565b3480156103e957600080fd5b506103fd6103f8366004613d48565b610c89565b005b34801561040b57600080fd5b5061041f61041a366004614075565b610cde565b6040516001600160a01b0390911681526020016103b2565b34801561044357600080fd5b506103fd610452366004613e95565b610d73565b34801561046357600080fd5b506103fd610472366004614075565b610e89565b34801561048357600080fd5b506042546103a690600160a01b900460ff1681565b3480156104a457600080fd5b506103fd6104b3366004613f6d565b610eb8565b3480156104c457600080fd5b506008545b6040519081526020016103b2565b3480156104e357600080fd5b506104c9600e5481565b3480156104f957600080fd5b506103fd610508366004613dbb565b610efb565b34801561051957600080fd5b506104c9610528366004614075565b610f47565b34801561053957600080fd5b506104c9610548366004613e95565b610fcf565b34801561055957600080fd5b5061056d6105683660046140cc565b61109b565b60405160ff90911681526020016103b2565b34801561058b57600080fd5b506103fd61059a366004614075565b6110e1565b3480156105ab57600080fd5b506104c960435481565b3480156105c157600080fd5b5061056d6105d03660046140cc565b611110565b3480156105e157600080fd5b506103fd611120565b3480156105f657600080fd5b506011546104c9565b34801561060b57600080fd5b506103fd61061a366004613dbb565b611183565b6103fd61062d3660046140ee565b61119e565b34801561063e57600080fd5b5060125461064d9061ffff1681565b60405161ffff90911681526020016103b2565b34801561066c57600080fd5b506104c961067b366004614075565b6113d0565b34801561068c57600080fd5b50600a54600160a01b900460ff166103a6565b3480156106ab57600080fd5b5061041f6106ba366004614075565b611463565b3480156106cb57600080fd5b506104c96106da366004613d48565b61152c565b3480156106eb57600080fd5b506103fd6115f0565b34801561070057600080fd5b506103fd61070f366004613fa7565b611626565b34801561072057600080fd5b5061073461072f366004613d48565b611684565b6040516103b291906142c1565b34801561074d57600080fd5b506104c9600c5481565b34801561076357600080fd5b50600a546001600160a01b031661041f565b34801561078157600080fd5b50610795610790366004614075565b6117e5565b6040516103b29190614445565b3480156107ae57600080fd5b506103d06118b1565b3480156107c357600080fd5b506104c9600b5481565b3480156107d957600080fd5b506104c96107e8366004613d48565b603e6020526000908152604090205481565b34801561080657600080fd5b506042546103a690600160a81b900460ff1681565b34801561082757600080fd5b506104c9610836366004614075565b603c6020526000908152604090205481565b34801561085457600080fd5b506103fd610863366004613e67565b6118c0565b6103fd6108763660046140a7565b611985565b34801561088757600080fd5b506103fd610896366004613dfc565b611a16565b3480156108a757600080fd5b5060455461041f906001600160a01b031681565b3480156108c757600080fd5b5060405461041f906001600160a01b031681565b3480156108e757600080fd5b506104c9600f5481565b3480156108fd57600080fd5b5060415461041f906001600160a01b031681565b34801561091d57600080fd5b506104c960115481565b34801561093357600080fd5b506103d0610942366004614075565b611a4e565b34801561095357600080fd5b506103fd610962366004613d48565b611b4d565b34801561097357600080fd5b506104c97f125e0edbb8302d72d12ce7ea3e79e536feb3425644748701c7480ffb4367a11b81565b3480156109a757600080fd5b506103fd6109b6366004613d48565b611b99565b3480156109c757600080fd5b50610a546109d6366004614075565b603b6020526000908152604090205460ff80821691610100810482169162010000820481169163010000008104821691640100000000820481169165010000000000810482169166010000000000008204811691600160381b8104821691600160401b8204811691600160481b8104821691600160501b909104168b565b604080519b15158c5260ff9a8b1660208d0152988a16988b019890985295881660608a0152938716608089015291861660a0880152851660c0870152841660e08601528316610100850152821661012084015216610140820152610160016103b2565b348015610ac357600080fd5b5060425461041f906001600160a01b031681565b348015610ae357600080fd5b506103a6610af2366004613d82565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610b2c57600080fd5b506103fd610b3b366004613ec1565b611be5565b348015610b4c57600080fd5b506104c9600d5481565b348015610b6257600080fd5b5060445461041f906001600160a01b031681565b348015610b8257600080fd5b506103fd610b91366004613d48565b6120ce565b348015610ba257600080fd5b506104c960105481565b348015610bb857600080fd5b506103fd610bc7366004614075565b612166565b60006001600160e01b0319821663780e9d6360e01b1480610bf15750610bf182612195565b92915050565b606060008054610c069061466c565b80601f0160208091040260200160405190810160405280929190818152602001828054610c329061466c565b8015610c7f5780601f10610c5457610100808354040283529160200191610c7f565b820191906000526020600020905b815481529060010190602001808311610c6257829003601f168201915b5050505050905090565b600a546001600160a01b03163314610cbc5760405162461bcd60e51b8152600401610cb3906143bf565b60405180910390fd5b604580546001600160a01b0319166001600160a01b0392909216919091179055565b6000818152600260205260408120546001600160a01b0316610d575760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610cb3565b506000908152600460205260409020546001600160a01b031690565b6000610d7e826121e5565b9050806001600160a01b0316836001600160a01b03161415610dec5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610cb3565b336001600160a01b0382161480610e085750610e088133610af2565b610e7a5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610cb3565b610e84838361225c565b505050565b600a546001600160a01b03163314610eb35760405162461bcd60e51b8152600401610cb3906143bf565b601055565b600a546001600160a01b03163314610ee25760405162461bcd60e51b8152600401610cb3906143bf565b8015610ef357610ef06122ca565b50565b610ef061234c565b6040546001600160a01b0316336001600160a01b031614610f3c57610f2033826123d0565b610f3c5760405162461bcd60e51b8152600401610cb3906143f4565b610e848383836124c7565b60006011548211610f5a57506000919050565b60056010546002610f6b91906145be565b610f7591906145aa565b8211610f8c575069043c33c1937564800000919050565b60056010546004610f9d91906145be565b610fa791906145aa565b8211610fbe5750690878678326eac9000000919050565b506910f0cf064dd592000000919050565b336000908152603f602052604081205460ff168061100c5750326000908152603d602052604090205443600160401b9091046001600160401b0316105b6110285760405162461bcd60e51b8152600401610cb39061436a565b336000908152603f602052604090205460ff168061106e57506001600160a01b0383166000908152603d602052604090205443600160401b9091046001600160401b0316105b61108a5760405162461bcd60e51b8152600401610cb39061436a565b6110948383612672565b9392505050565b601382601481106110ab57600080fd5b0181815481106110ba57600080fd5b9060005260206000209060209182820401919006915091509054906101000a900460ff1681565b600a546001600160a01b0316331461110b5760405162461bcd60e51b8152600401610cb3906143bf565b601155565b602782601481106110ab57600080fd5b600a546001600160a01b0316331461114a5760405162461bcd60e51b8152600401610cb3906143bf565b600a546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610ef0573d6000803e3d6000fd5b610e8483838360405180602001604052806000815250611a16565b600a54600160a01b900460ff16156111c85760405162461bcd60e51b8152600401610cb390614395565b604254600160a01b900460ff166112215760405162461bcd60e51b815260206004820152601a60248201527f4561726c7920616363657373206973206e6f74206163746976650000000000006044820152606401610cb3565b604354604080517f125e0edbb8302d72d12ce7ea3e79e536feb3425644748701c7480ffb4367a11b602082015233918101919091526060810185905260009190608001604051602081830303815290604052805190602001206040516020016112a192919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181529190528051602090910120905060006112c78285612708565b90506001600160a01b038116158015906112ee57506044546001600160a01b038281169116145b61132e5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610cb3565b336000908152603e6020526040902054859061134b90889061456d565b11156113995760405162461bcd60e51b815260206004820152601f60248201527f4561726c7920416363657373206d617820636f756e74206578636565646564006044820152606401610cb3565b336000908152603e6020526040812080548892906113b890849061456d565b909155506113c890508684612724565b505050505050565b60006113db60085490565b821061143e5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610cb3565b600882815481106114515761145161476c565b90600052602060002001549050919050565b336000908152603f602052604081205460ff16806114a05750326000908152603d602052604090205443600160401b9091046001600160401b0316105b6114bc5760405162461bcd60e51b8152600401610cb39061436a565b60006114c7836121e5565b336000908152603f602052604090205490915060ff168061151057506001600160a01b0381166000908152603d602052604090205443600160401b9091046001600160401b0316105b610bf15760405162461bcd60e51b8152600401610cb39061436a565b336000908152603f602052604081205460ff16806115695750326000908152603d602052604090205443600160401b9091046001600160401b0316105b6115855760405162461bcd60e51b8152600401610cb39061436a565b336000908152603f602052604090205460ff16806115cb57506001600160a01b0382166000908152603d602052604090205443600160401b9091046001600160401b0316105b6115e75760405162461bcd60e51b8152600401610cb39061436a565b610bf182612ca0565b600a546001600160a01b0316331461161a5760405162461bcd60e51b8152600401610cb3906143bf565b6116246000612d27565b565b600a546001600160a01b031633146116505760405162461bcd60e51b8152600401610cb3906143bf565b6042805461ffff60a01b1916600160a01b9315159390930260ff60a81b191692909217600160a81b91151591909102179055565b336000908152603f602052604090205460609060ff16806116cd57506001600160a01b0382166000908152603d602052604090205443600160401b9091046001600160401b0316105b6116e95760405162461bcd60e51b8152600401610cb39061436a565b60006116f48361152c565b9050806117155760408051600080825260208201909252905b509392505050565b6000816001600160401b0381111561172f5761172f614782565b604051908082528060200260200182016040528015611758578160200160208202803683370190505b509050600061176660085490565b9050600060015b8281116117d457866001600160a01b031661178782611463565b6001600160a01b031614156117c257808483815181106117a9576117a961476c565b6020908102919091010152816117be816146c3565b9250505b806117cc816146c3565b91505061176d565b509195945050505050565b50919050565b6117ed613c96565b506000908152603b6020908152604091829020825161016081018452905460ff808216151583526101008083048216948401949094526201000082048116948301949094526301000000810484166060830152640100000000810484166080830152650100000000008104841660a083015266010000000000008104841660c0830152600160381b8104841660e0830152600160401b8104841692820192909252600160481b82048316610120820152600160501b90910490911661014082015290565b606060018054610c069061466c565b6001600160a01b0382163314156119195760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610cb3565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a54600160a01b900460ff16156119af5760405162461bcd60e51b8152600401610cb390614395565b604254600160a81b900460ff16611a085760405162461bcd60e51b815260206004820152601960248201527f5075626c69632073616c65206973206e6f7420616374697665000000000000006044820152606401610cb3565b611a128282612724565b5050565b611a2033836123d0565b611a3c5760405162461bcd60e51b8152600401610cb3906143f4565b611a4884848484612d79565b50505050565b6000818152600260205260409020546060906001600160a01b0316611acd5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610cb3565b60425460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd9060240160006040518083038186803b158015611b1157600080fd5b505afa158015611b25573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bf19190810190613fff565b600a546001600160a01b03163314611b775760405162461bcd60e51b8152600401610cb3906143bf565b604480546001600160a01b0319166001600160a01b0392909216919091179055565b600a546001600160a01b03163314611bc35760405162461bcd60e51b8152600401610cb3906143bf565b604080546001600160a01b0319166001600160a01b0392909216919091179055565b600a54600160a01b900460ff1615611c0f5760405162461bcd60e51b8152600401610cb390614395565b80516045546000906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b158015611c6557600080fd5b505afa158015611c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9d919061408e565b9050323314611cd95760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b6044820152606401610cb3565b601054601254611cee90849061ffff1661456d565b1115611d305760405162461bcd60e51b8152602060048201526011602482015270105b1b081d1bdad95b9cc81b5a5b9d1959607a1b6044820152606401610cb3565b60008111611d8c5760405162461bcd60e51b815260206004820152602360248201527f596f7520646f6e2774206f776e20616e79206f6620746865206f6c6420746f6b604482015262656e7360e81b6064820152608401610cb3565b6045546001600160a01b031663e985e9c5336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260440160206040518083038186803b158015611de357600080fd5b505afa158015611df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1b9190613f8a565b611e5e5760405162461bcd60e51b8152602060048201526014602482015273139bdd08185c1c1c9bdd995908199bdc88185b1b60621b6044820152606401610cb3565b6000805b838110156120c557604554855133916001600160a01b031690636352211e90889085908110611e9357611e9361476c565b60200260200101516040518263ffffffff1660e01b8152600401611eb991815260200190565b60206040518083038186803b158015611ed157600080fd5b505afa158015611ee5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f099190613d65565b6001600160a01b031614611f575760405162461bcd60e51b8152602060048201526015602482015274686d6d6d206e6f7420796f757220746f6b656e733f60581b6044820152606401610cb3565b6045546001600160a01b03166342842e0e3361dead888581518110611f7e57611f7e61476c565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b158015611fd857600080fd5b505af1158015611fec573d6000803e3d6000fd5b50506012805461ffff16925090506000612005836146a1565b82546101009290920a61ffff818102199093169183160217909155601254326000908152603d602052604090205461205493509116906001600160401b0380821691600160401b900416612dac565b601254326000908152603d60209081526040918290208251808401909352546001600160401b038082168452600160401b90910416908201529193506120a29161ffff909116908490612e3d565b506120b33360125461ffff16613077565b806120bd816146c3565b915050611e62565b50611a48613091565b600a546001600160a01b031633146120f85760405162461bcd60e51b8152600401610cb3906143bf565b6001600160a01b03811661215d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610cb3565b610ef081612d27565b600a546001600160a01b031633146121905760405162461bcd60e51b8152600401610cb3906143bf565b600f55565b60006001600160e01b031982166380ac58cd60e01b14806121c657506001600160e01b03198216635b5e139f60e01b145b80610bf157506301ffc9a760e01b6001600160e01b0319831614610bf1565b6000818152600260205260408120546001600160a01b031680610bf15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610cb3565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612291826121e5565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600a54600160a01b900460ff16156122f45760405162461bcd60e51b8152600401610cb390614395565b600a805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861232f3390565b6040516001600160a01b03909116815260200160405180910390a1565b600a54600160a01b900460ff1661239c5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610cb3565b600a805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa3361232f565b6000818152600260205260408120546001600160a01b03166124495760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610cb3565b6000612454836121e5565b9050806001600160a01b0316846001600160a01b0316148061248f5750836001600160a01b031661248484610cde565b6001600160a01b0316145b806124bf57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166124da826121e5565b6001600160a01b0316146125425760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610cb3565b6001600160a01b0382166125a45760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610cb3565b6125af8383836130db565b6125ba60008261225c565b6001600160a01b03831660009081526003602052604081208054600192906125e39084906145dd565b90915550506001600160a01b038216600090815260036020526040812080546001929061261190849061456d565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061267d83612ca0565b82106126df5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610cb3565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60008060006127178585613193565b9150915061170d81613203565b32331461275e5760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b6044820152606401610cb3565b60105460125461277390849061ffff1661456d565b11156127b55760405162461bcd60e51b8152602060048201526011602482015270105b1b081d1bdad95b9cc81b5a5b9d1959607a1b6044820152606401610cb3565b6000821180156127c65750600a8211155b6128085760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b6044820152606401610cb3565b60115460125461ffff1610156128d55760115460125461282d90849061ffff1661456d565b111561287b5760405162461bcd60e51b815260206004820152601f60248201527f416c6c20746f6b656e73206f6e2d73616c6520616c726561647920736f6c64006044820152606401610cb3565b34600f548361288a91906145be565b146128d05760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081c185e5b595b9d08185b5bdd5b9d60521b6044820152606401610cb3565b6128e0565b34156128e057600080fd5b600080826128fc5760408051600081526020810190915261293f565b836001600160401b0381111561291457612914614782565b60405190808252806020026020018201604052801561293d578160200160208202803683370190505b505b90506000805b85811015612bae576012805461ffff16906000612961836146a1565b82546101009290920a61ffff818102199093169183160217909155601254326000908152603d60205260409020546129b093509116906001600160401b0380821691600160401b900416612dac565b601254326000908152603d60209081526040918290208251808401909352546001600160401b038082168452600160401b90910416908201529193506129fe9161ffff909116908490612e3d565b506000612a0a836133be565b9050851580612a2257506001600160a01b0381163314155b15612b2c57601254612a3990829061ffff16613077565b6001600160a01b0381163314612b275760125461ffff166000908152603b602052604090205460ff1615612ac9576001600d6000828254612a7a919061456d565b90915550506012546040805133815261ffff90921660208301524282820152517f176aa3bfd1d48b2c9177a323a36242680de10daa71b1958d4cce6365cc8ddac29181900360600190a1612b7e565b6001600e6000828254612adc919061456d565b90915550506012546040805133815261ffff90921660208301524282820152517fe5362f114e5b6824f477915abea9bd6af2fc8b9e881889a96a6d5ccf29cac2439181900360600190a15b612b7e565b604054601254612b49916001600160a01b03169061ffff16613077565b601254845161ffff90911690859084908110612b6757612b6761476c565b602002602001019061ffff16908161ffff16815250505b601254612b8e9061ffff16610f47565b612b98908661456d565b9450508080612ba6906146c3565b915050612945565b508215612c28576041546001600160a01b0316639dc29fac336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101869052604401600060405180830381600087803b158015612c0f57600080fd5b505af1158015612c23573d6000803e3d6000fd5b505050505b8315612c91576040546001600160a01b0316633da0128e33846040518363ffffffff1660e01b8152600401612c5e929190614267565b600060405180830381600087803b158015612c7857600080fd5b505af1158015612c8c573d6000803e3d6000fd5b505050505b612c99613091565b5050505050565b60006001600160a01b038216612d0b5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610cb3565b506001600160a01b031660009081526003602052604090205490565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612d848484846124c7565b612d908484848461348b565b611a485760405162461bcd60e51b8152600401610cb390614318565b6000326001836001600160401b031611612dc65782612dd1565b612dd16002846145f4565b60405160609290921b6bffffffffffffffffffffffff191660208301526001600160401b031640603482015260c084901b6001600160c01b0319166054820152605c8101859052607c016040516020818303038152906040528051906020012060001c90509392505050565b612e45613c96565b612e4e83613598565b9050603c6000612e5d83613729565b8152602001908152602001600020546000141561305a5780603b600086815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548160ff021916908360ff16021790555060608201518160000160036101000a81548160ff021916908360ff16021790555060808201518160000160046101000a81548160ff021916908360ff16021790555060a08201518160000160056101000a81548160ff021916908360ff16021790555060c08201518160000160066101000a81548160ff021916908360ff16021790555060e08201518160000160076101000a81548160ff021916908360ff1602179055506101008201518160000160086101000a81548160ff021916908360ff1602179055506101208201518160000160096101000a81548160ff021916908360ff16021790555061014082015181600001600a6101000a81548160ff021916908360ff16021790555090505083603c600061300684613729565b815260208101919091526040016000205580511561303c576001600b6000828254613031919061456d565b909155506130559050565b6001600c600082825461304f919061456d565b90915550505b611094565b6124bf846130718585600001518660200151612dac565b84612e3d565b611a1282826040518060200160405280600081525061378d565b326000908152603d6020526040902080546fffffffffffffffffffffffffffffffff1916600160401b436001600160401b031690810267ffffffffffffffff191691909117179055565b6001600160a01b0383166131365761313181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613159565b816001600160a01b0316836001600160a01b0316146131595761315983826137c0565b6001600160a01b03821661317057610e848161385d565b826001600160a01b0316826001600160a01b031614610e8457610e84828261390c565b6000808251604114156131ca5760208301516040840151606085015160001a6131be87828585613950565b945094505050506131fc565b8251604014156131f457602083015160408401516131e9868383613a3d565b9350935050506131fc565b506000905060025b9250929050565b600081600481111561321757613217614740565b14156132205750565b600181600481111561323457613234614740565b14156132825760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610cb3565b600281600481111561329657613296614740565b14156132e45760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610cb3565b60038160048111156132f8576132f8614740565b14156133515760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610cb3565b600481600481111561336557613365614740565b1415610ef05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610cb3565b60115460125460009161ffff9091161115806133e757506133e4600a60f584901c6146de565b15155b156133f25733610bf1565b604080549051600162955d2360e01b03198152609084901c60048201526000916001600160a01b03169063ff6aa2dd9060240160206040518083038186803b15801561343d57600080fd5b505afa158015613451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134759190613d65565b90506001600160a01b038116610bf15733611094565b60006001600160a01b0384163b1561358d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906134cf90339089908890889060040161422a565b602060405180830381600087803b1580156134e957600080fd5b505af1925050508015613519575060408051601f3d908101601f1916820190925261351691810190613fe2565b60015b613573573d808015613547576040519150601f19603f3d011682016040523d82523d6000602084013e61354c565b606091505b50805161356b5760405162461bcd60e51b8152600401610cb390614318565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506124bf565b506001949350505050565b6135a0613c96565b6135af600a61ffff84166146de565b15158082526000906135c25760006135c5565b600a5b60109390931c9290506135e661ffff84166135e1836000614585565b613a6c565b60ff16602083015260109290921c9161360861ffff84166135e1836001614585565b60ff16604083015260109290921c9161362a61ffff84166135e1836002614585565b60ff16606083015260109290921c9161364c61ffff84166135e1836003614585565b60ff16608083015260109290921c9161366e61ffff84166135e1836004614585565b60ff1660a083015260109290921c9161369061ffff84166135e1836005614585565b60ff1660c083015260109290921c916136b261ffff84166135e1836006614585565b60ff1660e083015260109290921c916136d461ffff84166135e1836007614585565b60ff1661010083015260109290921c916136f761ffff84166135e1836008614585565b60ff1661014083015260109290921c9161371a61ffff84166135e1836009614585565b60ff1661012083015250919050565b80516020808301516040808501516060860151608087015160a088015160c089015160e08a01516101008b01516101208c01516101408d0151985160009c6137759c909b9a910161418d565b604051602081830303815290604052610bf19061461c565b6137978383613b48565b6137a4600084848461348b565b610e845760405162461bcd60e51b8152600401610cb390614318565b600060016137cd84612ca0565b6137d791906145dd565b60008381526007602052604090205490915080821461382a576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061386f906001906145dd565b600083815260096020526040812054600880549394509092849081106138975761389761476c565b9060005260206000200154905080600883815481106138b8576138b861476c565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806138f0576138f0614756565b6001900381819060005260206000200160009055905550505050565b600061391783612ca0565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139875750600090506003613a34565b8460ff16601b1415801561399f57508460ff16601c14155b156139b05750600090506004613a34565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613a04573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613a2d57600060019250925050613a34565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b01613a5e87828885613950565b935093505050935093915050565b60008060138360ff1660148110613a8557613a8561476c565b0154613a9190856146f2565b905060138360ff1660148110613aa957613aa961476c565b018160ff1681548110613abe57613abe61476c565b60009182526020918290209181049091015460ff601f9092166101000a90048116600886901c9091161015613af4579050610bf1565b60278360ff1660148110613b0a57613b0a61476c565b018160ff1681548110613b1f57613b1f61476c565b90600052602060002090602091828204019190069054906101000a900460ff1691505092915050565b6001600160a01b038216613b9e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610cb3565b6000818152600260205260409020546001600160a01b031615613c035760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610cb3565b613c0f600083836130db565b6001600160a01b0382166000908152600360205260408120805460019290613c3890849061456d565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915290565b600082601f830112613d0357600080fd5b8135613d16613d1182614546565b614516565b818152846020838601011115613d2b57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215613d5a57600080fd5b813561109481614798565b600060208284031215613d7757600080fd5b815161109481614798565b60008060408385031215613d9557600080fd5b8235613da081614798565b91506020830135613db081614798565b809150509250929050565b600080600060608486031215613dd057600080fd5b8335613ddb81614798565b92506020840135613deb81614798565b929592945050506040919091013590565b60008060008060808587031215613e1257600080fd5b8435613e1d81614798565b93506020850135613e2d81614798565b92506040850135915060608501356001600160401b03811115613e4f57600080fd5b613e5b87828801613cf2565b91505092959194509250565b60008060408385031215613e7a57600080fd5b8235613e8581614798565b91506020830135613db0816147ad565b60008060408385031215613ea857600080fd5b8235613eb381614798565b946020939093013593505050565b60006020808385031215613ed457600080fd5b82356001600160401b0380821115613eeb57600080fd5b818501915085601f830112613eff57600080fd5b813581811115613f1157613f11614782565b8060051b9150613f22848301614516565b8181528481019084860184860187018a1015613f3d57600080fd5b600095505b83861015613f60578035835260019590950194918601918601613f42565b5098975050505050505050565b600060208284031215613f7f57600080fd5b8135611094816147ad565b600060208284031215613f9c57600080fd5b8151611094816147ad565b60008060408385031215613fba57600080fd5b8235613e85816147ad565b600060208284031215613fd757600080fd5b8135611094816147bb565b600060208284031215613ff457600080fd5b8151611094816147bb565b60006020828403121561401157600080fd5b81516001600160401b0381111561402757600080fd5b8201601f8101841361403857600080fd5b8051614046613d1182614546565b81815285602083850101111561405b57600080fd5b61406c826020830160208601614640565b95945050505050565b60006020828403121561408757600080fd5b5035919050565b6000602082840312156140a057600080fd5b5051919050565b600080604083850312156140ba57600080fd5b823591506020830135613db0816147ad565b600080604083850312156140df57600080fd5b50508035926020909101359150565b6000806000806080858703121561410457600080fd5b843593506020850135925060408501356001600160401b0381111561412857600080fd5b61413487828801613cf2565b9250506060850135614145816147ad565b939692955090935050565b60008151808452614168816020860160208601614640565b601f01601f19169290920160200192915050565b60f81b6001600160f81b0319169052565b8b151560f81b8152600060ff60f81b808d60f81b166001840152808c60f81b166002840152808b60f81b166003840152808a60f81b166004840152506141d6600583018961417c565b6141e3600683018861417c565b6141f0600783018761417c565b6141fd600883018661417c565b61420a600983018561417c565b614217600a83018461417c565b50600b019b9a5050505050505050505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061425d90830184614150565b9695505050505050565b6001600160a01b038316815260406020808301829052835191830182905260009184820191906060850190845b818110156142b457845161ffff1683529383019391830191600101614294565b5090979650505050505050565b6020808252825182820181905260009190848201906040850190845b818110156142f9578351835292840192918401916001016142dd565b50909695505050505050565b6020815260006110946020830184614150565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b602080825260119082015270686d6d6d6d207768617420646f696e673f60781b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b81511515815261016081016020830151614464602084018260ff169052565b506040830151614479604084018260ff169052565b50606083015161448e606084018260ff169052565b5060808301516144a3608084018260ff169052565b5060a08301516144b860a084018260ff169052565b5060c08301516144cd60c084018260ff169052565b5060e08301516144e260e084018260ff169052565b506101008381015160ff90811691840191909152610120808501518216908401526101409384015116929091019190915290565b604051601f8201601f191681016001600160401b038111828210171561453e5761453e614782565b604052919050565b60006001600160401b0382111561455f5761455f614782565b50601f01601f191660200190565b6000821982111561458057614580614714565b500190565b600060ff821660ff84168060ff038211156145a2576145a2614714565b019392505050565b6000826145b9576145b961472a565b500490565b60008160001904831182151516156145d8576145d8614714565b500290565b6000828210156145ef576145ef614714565b500390565b60006001600160401b038381169083168181101561461457614614614714565b039392505050565b805160208083015191908110156117df5760001960209190910360031b1b16919050565b60005b8381101561465b578181015183820152602001614643565b83811115611a485750506000910152565b600181811c9082168061468057607f821691505b602082108114156117df57634e487b7160e01b600052602260045260246000fd5b600061ffff808316818114156146b9576146b9614714565b6001019392505050565b60006000198214156146d7576146d7614714565b5060010190565b6000826146ed576146ed61472a565b500690565b600060ff8316806147055761470561472a565b8060ff84160691505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610ef057600080fd5b8015158114610ef057600080fd5b6001600160e01b031981168114610ef057600080fdfea2646970667358221220b5cf38e368665487325386b3bd260d6b3bfd1bd3e3c5225a91013f2a460aa76a64736f6c63430008070033

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

00000000000000000000000081d327cf395347dd6cc0c427bb9ea77ec120e304000000000000000000000000391f60b43619d39db931c645f863c12674a4da6e000000000000000000000000000000000000000000000000000000000000c350000000000000000000000000269b68fc83a90a83729047a9c925480152f707350000000000000000000000004958ce8ddf7131286dcf5298a357d981e18a5c9e

-----Decoded View---------------
Arg [0] : _egg (address): 0x81d327cF395347Dd6CC0C427Bb9EA77ec120E304
Arg [1] : _traits (address): 0x391F60B43619D39DB931c645f863C12674a4da6e
Arg [2] : _maxTokens (uint256): 50000
Arg [3] : _whitelistSigner (address): 0x269b68Fc83a90a83729047a9c925480152F70735
Arg [4] : _oldGoatContract (address): 0x4958cE8dDF7131286dcf5298A357D981E18A5c9e

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000081d327cf395347dd6cc0c427bb9ea77ec120e304
Arg [1] : 000000000000000000000000391f60b43619d39db931c645f863c12674a4da6e
Arg [2] : 000000000000000000000000000000000000000000000000000000000000c350
Arg [3] : 000000000000000000000000269b68fc83a90a83729047a9c925480152f70735
Arg [4] : 0000000000000000000000004958ce8ddf7131286dcf5298a357d981e18a5c9e


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

OVERVIEW

True Holders Count: **979**Thousands of [Tortoises](https://etherscan.io/address/0xb8f0bb7f5d2bb0d280cc0b60675675d31c105529) and [Goats](https://etherscan.io/address/0xb8f0bb7f5d2bb0d280cc0b60675675d31c105529) inhabit the same Island, but they don't get along very well. Sta...

Validator Index Block Amount
View All Withdrawals

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

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