ETH Price: $2,981.04 (-3.96%)
Gas: 2 Gwei

Token

Chained Horse (CH)
 

Overview

Max Total Supply

385 CH

Holders

85

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
2 CH
0xc3fbc3F485F0d9b0bD21B13a4aaA8340160156Cb
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Chained Horse is an NFT collection of at most 10'000 horses. All horses are generated by randomisation in the contract. The metadata lives on ethereum, yes the svgs do too. The horses can never die, unless burned in a rebirth.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
ChainedHorseTokenContract

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 17 : ChainedHorseTokenContract.sol
pragma solidity ^0.8.4;
//SPDX-License-Identifier: MIT

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./HorseUtilityContract.sol";
import "base64-sol/base64.sol";

//
//   ____ _           _                _   _   _                       _   _ _____ _____
//  / ___| |__   __ _(_)_ __   ___  __| | | | | | ___  _ __ ___  ___  | \ | |  ___|_   _|
// | |   | '_ \ / _` | | '_ \ / _ \/ _` | | |_| |/ _ \| '__/ __|/ _ \ |  \| | |_    | |
// | |___| | | | (_| | | | | |  __/ (_| | |  _  | (_) | |  \__ \  __/ | |\  |  _|   | |
//  \____|_| |_|\__,_|_|_| |_|\___|\__,_| |_| |_|\___/|_|  |___/\___| |_| \_|_|     |_|
//
//
//
//                                                 ,,  //
//                                              .//,,,,,,,,,
//                                              .//,,,,@@,,,,,,,
//                                            /////,,,,,,,,,,,,,
//                                            /////,,,,,,
//                                            /////,,,,,,
//                                          ///////,,,,,,
//                                      ///////////,,,,,,
//                        /////,,,,,,,,,,,,,,,,,,,,,,,,,,
//                      /////,,,,,,,,,,,,,,,,,,,,,,,,,,,,
//                      /////,,,,,,,,,,,,,,,,,,,,,,,,,,,,
//                      /////,,,,,,,,,,,,,,,,,,,,,,,,,,,,
//                    ////   ,,  //                ,,  //
//                    ////   ,,  //                ,,  //
//                    ////   ,,  //                ,,  //
//                    //     ,,  //                ,,  //
//                           @@  @@                @@  @@
//
// ** ChainedHorseNFT: ChainedHorseTokenContract.sol **
// Written and developed by: Moonfarm
// Twitter: @spacesh1pdev
// Discord: Moonfarm#1138
//

contract ChainedHorseTokenContract is ERC721Enumerable, Ownable {
    using SafeMath for uint256;

    // attribute rarities
    uint256[] private maneColorRarities = [
        4000,
        1000,
        1000,
        1000,
        800,
        800,
        500,
        300,
        300,
        200,
        100
    ];
    uint256[] private patternColorRarities = [
        3000,
        1700,
        1350,
        900,
        800,
        800,
        500,
        300,
        200,
        200,
        150,
        100
    ];
    uint256[] private hoofColorRarities = [
        3500,
        1500,
        1100,
        1000,
        1000,
        500,
        500,
        400,
        200,
        200,
        100
    ];
    uint256[] private bodyColorRarities = [
        2900,
        1500,
        1500,
        1500,
        700,
        600,
        500,
        500,
        200,
        100
    ];
    uint256[] private backgroundRarities = [
        1000,
        1000,
        1000,
        1000,
        1000,
        1000,
        1000,
        1000,
        1000,
        1000
    ];
    uint256[] private tailRarities = [
        3000,
        2000,
        1500,
        1200,
        1000,
        750,
        350,
        200
    ];
    uint256[] private maneRarities = [
        3000,
        1800,
        1600,
        900,
        800,
        700,
        600,
        400,
        200
    ];
    uint256[] private patternRarities = [
        2000,
        1500,
        1500,
        1100,
        1000,
        800,
        800,
        500,
        500,
        300
    ];
    uint256[] private headAccessoryRarities = [
        3100,
        1500,
        1000,
        800,
        700,
        700,
        500,
        550,
        250,
        300,
        300,
        150,
        100,
        50
    ];
    uint256[] private bodyAccessoryRarities = [
        2500,
        2300,
        1400,
        1000,
        800,
        800,
        600,
        400,
        200
    ];
    uint256[] private utilityRarities = [
        3700,
        1000,
        900,
        500,
        400,
        500,
        200,
        600,
        900,
        500,
        300,
        250,
        100,
        100,
        50
    ];

    // amount of attributes
    uint8 constant maneColorCount = 11;
    uint8 constant patternColorCount = 12;
    uint8 constant hoofColorCount = 11;
    uint8 constant bodyColorCount = 10;
    uint8 constant backgroundCount = 10;
    uint8 constant tailCount = 8;
    uint8 constant maneCount = 9;
    uint8 constant patternCount = 10;
    uint8 constant headAccessoryCount = 14;
    uint8 constant bodyAccessoryCount = 9;
    uint8 constant utilityCount = 15;

    /**
     * Define the utility contract address so we know where to fetch svgs from
     */
    address public utilityContract = 0x0000000000000000000000000000000000000001;

    /**
     * Pretty standard NFT contract variables
     */
    uint256 public maxTokens = 10000;
    uint256 public mintedTokens = 0;
    uint256 public burnedTokens = 0;
    uint256 public rebirthedTokens = 0;
    uint256 public mintPrice = 0.02 ether;
    uint256 public rebirthPrice = 0.01 ether;
    uint8 public claimableTokensPerAddress = 20;
    uint8 public maxTokensPerTxn = 5;
    bool public saleActive = false;

    /**
     * Whitelist info
     */
    uint256 public whitelistTokensUnlocksAtBlockNumber = 0;
    uint256 public whitelistAddressCount = 0;

    /**
     * Burned horse base64-image
     */
    string ashes =
        "data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAzMiAzMic+PHBhdGggZmlsbD0nI2QxZDNkNCcgZD0nTTAgMGgzMnYzMkgweicvPjxwYXRoIGZpbGw9JyM1ODU5NWInIGQ9J00xMCAyN0g5di0xaDF6bTEwIDBoLTF2LTFoMXptMiAwaC0xdi0xaDF6Jy8+PHBhdGggZmlsbD0nIzIzMWYyMCcgZD0nTTIzIDI3aC0xdi0xaDF6Jy8+PHBhdGggZmlsbD0nIzU4NTk1YicgZD0nTTI0IDI3aC0xdi0xaDF6bTEgMGgtMXYtMWgxem0tMTQgMGgtMXYtMWgxem0xIDBoLTF2LTFoMXptMSAwaC0xdi0xaDF6bTEgMGgtMXYtMWgxem0xIDBoLTF2LTFoMXptMSAwaC0xdi0xaDF6bTEgMGgtMXYtMWgxeicvPjxwYXRoIGZpbGw9JyM4MDgyODUnIGQ9J00xOCAyN2gtMXYtMWgxeicvPjxwYXRoIGZpbGw9JyM1ODU5NWInIGQ9J00xOSAyN2gtMXYtMWgxem0yIDBoLTF2LTFoMXptMC0xaC0xdi0xaDF6bS0xIDBoLTF2LTFoMXptLTEgMGgtMXYtMWgxem0tMSAwaC0xdi0xaDF6bS0xIDBoLTF2LTFoMXonLz48cGF0aCBmaWxsPScjMjMxZjIwJyBkPSdNMTYgMjZoLTF2LTFoMXonLz48cGF0aCBmaWxsPScjNTg1OTViJyBkPSdNMTUgMjZoLTF2LTFoMXptMS0xaC0xdi0xaDF6bTEgMGgtMXYtMWgxeicvPjxwYXRoIGZpbGw9JyMyMzFmMjAnIGQ9J00xOCAyNWgtMXYtMWgxeicvPjxwYXRoIGZpbGw9JyM1ODU5NWInIGQ9J00xOSAyNWgtMXYtMWgxem0xIDBoLTF2LTFoMXptLTEtMWgtMXYtMWgxeicvPjxwYXRoIGZpbGw9JyM4MDgyODUnIGQ9J00xNyAyNGgtMXYtMWgxeicvPjxwYXRoIGZpbGw9JyM1ODU5NWInIGQ9J00xOCAyNGgtMXYtMWgxem0tNCAyaC0xdi0xaDF6Jy8+PHBhdGggZmlsbD0nIzgwODI4NScgZD0nTTEzIDI2aC0xdi0xaDF6Jy8+PHBhdGggZmlsbD0nIzU4NTk1YicgZD0nTTEyIDI2aC0xdi0xaDF6Jy8+PC9zdmc+";

    /**
     * Amount of tokens a specific whitelist address has left to mint
     *
     * Always starts at 20 for each address added
     */
    mapping(address => uint256) public whitelistedAddressMintsLeft;

    /**
     * Save seed for traits for each token
     */
    mapping(uint256 => uint256) public tokenSeed;
    mapping(uint256 => bool) public tokenBurned;

    /**
     * Pretty standard constructor variables, nothing wierd here
     *
     * Mints #0 to the creator
     */
    constructor(
        string memory tokenName,
        string memory tokenSymbol,
        uint256 _maxTokens,
        address _utilityContract,
        address mintedByOnOldContract
    ) ERC721(tokenName, tokenSymbol) {
        maxTokens = _maxTokens;
        utilityContract = _utilityContract;
        migrateMintedTokensFromOldContract(mintedByOnOldContract);
    }

    /**
     * Mint tokens that have been minted on the old contract and send to minters
     * Set the same seed as the old contract generated for the minted tokens so they get the same properties
     */
    function migrateMintedTokensFromOldContract(address mintedByOnOldContract)
        private
    {
        _safeMint(msg.sender, 0);
        _safeMint(mintedByOnOldContract, 1);
        _safeMint(mintedByOnOldContract, 2);
        _safeMint(mintedByOnOldContract, 3);
        _safeMint(mintedByOnOldContract, 4);
        _safeMint(mintedByOnOldContract, 5);
        tokenSeed[0] = 5544338833776644337733999;
        tokenSeed[1] = 7788333333735555114477799;
        tokenSeed[2] = 1111772266993344221133999;
        tokenSeed[3] = 1155775566117788663333999;
        tokenSeed[4] = 1144222200001111889999799;
        tokenSeed[5] = 5588447788664477885544999;
        mintedTokens += 6;
    }

    /**
     * 1) Sets whitelisted tokens to be available for public mint in
     *    40320 blocks from the block this function was called (approximately a week)
     * 2) Starts the sale
     */
    function startSale() public onlyOwner {
        whitelistTokensUnlocksAtBlockNumber = block.number + 40320; // approximately a week
        saleActive = true;
    }

    /**
     * Standard withdraw function
     */
    function withdraw() public onlyOwner {
        uint256 balance = payable(address(this)).balance;
        payable(msg.sender).transfer(balance);
    }

    /**
     * Private function so it can be called cheaper from tokenURI and tokenSVG
     */
    function _tokenSVG(uint256 seed) private view returns (string memory) {
        (string memory svg, string memory properties) = getRandomAttributes(
            seed
        );

        return svg;
    }

    /**
     * Get the svg for a token in base64 format
     *
     * Comment:
     * Uses the UtilityContract to get svg-information for each attribute
     */
    function tokenSVG(uint256 tokenId) public view returns (string memory) {
        bool lessThanMinted = tokenId < mintedTokens;
        bool lessThanMintedRebirthOrMoreThanStartOfRebirth = tokenId <
            (maxTokens + burnedTokens) &&
            tokenId > maxTokens;
        if (
            !_exists(tokenId) &&
            (lessThanMinted || lessThanMintedRebirthOrMoreThanStartOfRebirth)
        ) {
            return ashes;
        }

        require(
            _exists(tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );
        return
            string(
                abi.encodePacked(
                    "data:image/svg+xml;base64,",
                    _tokenSVG(tokenSeed[tokenId])
                )
            );
    }

    /**
     * Get the metadata for a token in base64 format
     *
     * Comment:
     * Uses the UtilityContract to get svg-information for each attribute
     */
    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override
        returns (string memory)
    {
        if (
            !_exists(tokenId) &&
            (tokenId < mintedTokens ||
                (tokenId < (maxTokens + burnedTokens) && tokenId > maxTokens))
        ) {
            return
                string(
                    abi.encodePacked(
                        "data:application/json;base64,",
                        Base64.encode(
                            abi.encodePacked(
                                '{"name":"Burned Chained Horse #',
                                uint2str(tokenId),
                                '", "description": "A horse that lives on the ethereum blockchain.", "attributes": [',
                                packMetaData("status", "burned", 1),
                                '], "image":"',
                                ashes,
                                '"}'
                            )
                        )
                    )
                );
        }
        require(
            _exists(tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );
        (string memory svg, string memory properties) = getRandomAttributes(
            tokenSeed[tokenId]
        );

        return
            string(
                abi.encodePacked(
                    "data:application/json;base64,",
                    Base64.encode(
                        abi.encodePacked(
                            '{"name":"Chained Horse #',
                            uint2str(tokenId),
                            '", "description": "A horse that lives on the ethereum blockchain.", "attributes": [',
                            properties,
                            '], "image":"data:image/svg+xml;base64,',
                            svg,
                            '"}'
                        )
                    )
                )
            );
    }

    /**
     * A claim function for whitelisted addresses until claim-period is over
     */
    function claim(uint256 amount) public {
        require(
            whitelistedAddressMintsLeft[msg.sender] >= amount,
            "Exceeded amount of claims left on address"
        );
        require(
            whitelistTokensUnlocksAtBlockNumber > block.number,
            "Claim period is over"
        );
        mint(amount);
        whitelistedAddressMintsLeft[msg.sender] -= amount;
    }

    /**
     * A mint function for anyone
     */
    function publicMint(uint256 amount) public payable {
        require(
            amount.add(mintedTokens) <=
                maxTokens -
                    (whitelistAddressCount * claimableTokensPerAddress) ||
                block.number > whitelistTokensUnlocksAtBlockNumber,
            "Tokens left are for whitelist"
        );
        require(mintPrice.mul(amount) <= msg.value, "Not enough ether to mint");
        require(saleActive, "Sale has not started");
        mint(amount);
    }

    /**
     * Mint with requirements that both claim and publicMint needs to follow
     */
    function mint(uint256 amount) private {
        require(
            amount <= maxTokensPerTxn,
            "Trying to mint more than allowed tokens"
        );
        require(
            amount.add(mintedTokens) <= maxTokens,
            "Amount exceeded max tokens"
        );
        for (uint256 i = 0; i < amount; i++) {
            tokenSeed[mintedTokens + i] = uint256(
                keccak256(
                    abi.encodePacked(
                        block.difficulty,
                        block.timestamp,
                        mintedTokens + i
                    )
                )
            );
            _safeMint(msg.sender, mintedTokens + i);
        }
        mintedTokens += amount;
    }

    /**
     * Rebirth a horse by burning two horses owned by the caller
     */
    function rebirth(uint256 tokenId1, uint256 tokenId2) public payable {
        require(tokenId1 != tokenId2, "Not different tokens");
        require(ownerOf(tokenId1) == msg.sender, "Not owner of token");
        require(ownerOf(tokenId2) == msg.sender, "Not owner of token");
        require(!tokenBurned[tokenId1], "Already burned");
        require(!tokenBurned[tokenId2], "Already burned");
        require(msg.value == rebirthPrice, "Not enough ether to rebirth");

        tokenBurned[tokenId1] = true;
        tokenBurned[tokenId2] = true;
        _burn(tokenId1);
        _burn(tokenId2);

        burnedTokens += 2;

        uint256 rebirthTokenId = maxTokens.add(rebirthedTokens);
        tokenSeed[rebirthTokenId] = uint256(
            keccak256(
                abi.encodePacked(
                    block.difficulty,
                    block.timestamp,
                    rebirthTokenId
                )
            )
        );
        _safeMint(msg.sender, rebirthTokenId);
        rebirthedTokens++;
    }

    /**
     * Add an address to the whitelist
     */
    function addWhitelistAddresses(address[] memory newWhitelistMembers)
        public
        onlyOwner
    {
        for (uint256 i = 0; i < newWhitelistMembers.length; i++) {
            whitelistedAddressMintsLeft[
                newWhitelistMembers[i]
            ] = claimableTokensPerAddress;
            whitelistAddressCount++;
        }
    }

    /**
     * Small function to convert uint to string
     */
    function uint2str(uint256 _i)
        internal
        pure
        returns (string memory _uintAsString)
    {
        if (_i == 0) {
            return "0";
        }
        uint256 j = _i;
        uint256 len;
        while (j != 0) {
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint256 k = len;
        while (_i != 0) {
            k = k - 1;
            uint8 temp = (48 + uint8(_i - (_i / 10) * 10));
            bytes1 b1 = bytes1(temp);
            bstr[k] = b1;
            _i /= 10;
        }
        return string(bstr);
    }

    /**
     * Use:
     * Get random attributes for each different property of the token
     *
     * Comment:
     * Can only be used by the TokenContract defined by address tokenContract
     */
    function getRandomAttributes(uint256 randomNumber)
        public
        view
        returns (string memory svg, string memory properties)
    {
        uint8[] memory attributes = new uint8[](11);
        attributes[0] = getRandomIndex(
            maneColorRarities,
            maneColorCount,
            randomNumber
        );
        randomNumber = randomNumber / 100;
        attributes[1] = getRandomIndex(
            patternColorRarities,
            patternColorCount,
            randomNumber
        );
        randomNumber = randomNumber / 100;
        attributes[2] = getRandomIndex(
            hoofColorRarities,
            hoofColorCount,
            randomNumber
        );
        randomNumber = randomNumber / 100;
        attributes[3] = getRandomIndex(
            bodyColorRarities,
            bodyColorCount,
            randomNumber
        );
        randomNumber = randomNumber / 100;
        attributes[4] = getRandomIndex(
            backgroundRarities,
            backgroundCount,
            randomNumber
        );
        randomNumber = randomNumber / 100;
        attributes[5] = getRandomIndex(tailRarities, tailCount, randomNumber);
        randomNumber = randomNumber / 100;
        attributes[6] = getRandomIndex(maneRarities, maneCount, randomNumber);
        randomNumber = randomNumber / 100;
        attributes[7] = getRandomIndex(
            patternRarities,
            patternCount,
            randomNumber
        );
        randomNumber = randomNumber / 100;
        attributes[8] = getRandomIndex(
            headAccessoryRarities,
            headAccessoryCount,
            randomNumber
        );
        randomNumber = randomNumber / 100;
        attributes[9] = getRandomIndex(
            bodyAccessoryRarities,
            bodyAccessoryCount,
            randomNumber
        );
        randomNumber = randomNumber / 100;
        attributes[10] = getRandomIndex(
            utilityRarities,
            utilityCount,
            randomNumber
        );
        // render svg
        bytes memory _svg = HorseUtilityContract(utilityContract).renderHorse(
            HorseUtilityContract(utilityContract).renderColors(
                attributes[0],
                attributes[1],
                attributes[2],
                attributes[3]
            ),
            attributes[4],
            attributes[5],
            attributes[6],
            attributes[7],
            attributes[8],
            attributes[9],
            attributes[10]
        );

        svg = Base64.encode(_svg);

        // pack properties
        bytes memory _properties = abi.encodePacked(
            packMetaData(
                "background",
                HorseUtilityContract(utilityContract).getBackground(
                    attributes[4]
                ),
                0
            ),
            packMetaData(
                "tail",
                HorseUtilityContract(utilityContract).getTail(attributes[5]),
                0
            ),
            packMetaData(
                "mane",
                HorseUtilityContract(utilityContract).getMane(attributes[6]),
                0
            ),
            packMetaData(
                "pattern",
                HorseUtilityContract(utilityContract).getPattern(attributes[7]),
                0
            ),
            packMetaData(
                "head accessory",
                HorseUtilityContract(utilityContract).getHeadAccessory(
                    attributes[8]
                ),
                0
            ),
            packMetaData(
                "body accessory",
                HorseUtilityContract(utilityContract).getBodyAccessory(
                    attributes[9]
                ),
                0
            ),
            packMetaData(
                "utility",
                HorseUtilityContract(utilityContract).getUtility(
                    attributes[10]
                ),
                0
            )
        );

        string[] memory colorNames = new string[](4);

        colorNames[0] = HorseUtilityContract(utilityContract).getManeColor(
            attributes[0]
        );
        colorNames[1] = HorseUtilityContract(utilityContract).getPatternColor(
            attributes[1]
        );
        colorNames[2] = HorseUtilityContract(utilityContract).getHoofColor(
            attributes[2]
        );
        colorNames[3] = HorseUtilityContract(utilityContract).getBodyColor(
            attributes[3]
        );

        properties = string(
            abi.encodePacked(
                _properties,
                packMetaData("mane color", colorNames[0], 0),
                packMetaData("pattern color", colorNames[1], 0),
                packMetaData("hoof color", colorNames[2], 0),
                packMetaData("body color", colorNames[3], 1)
            )
        );

        return (svg, properties);
    }

    /**
     * Bundle metadata so it follows the standard
     */
    function packMetaData(
        string memory name,
        string memory svg,
        uint256 last
    ) private pure returns (bytes memory) {
        string memory comma = ",";
        if (last > 0) comma = "";
        return
            abi.encodePacked(
                '{"trait_type": "',
                name,
                '", "value": "',
                svg,
                '"}',
                comma
            );
    }

    /**
     * Use:
     * Get a random attribute using the rarities defined
     */
    function getRandomIndex(
        uint256[] memory attributeRarities,
        uint8 attributeCount,
        uint256 randomNumber
    ) private pure returns (uint8 index) {
        uint256 random10k = randomNumber % 10000;
        uint256 steps = 0;
        for (uint8 i = 0; i < attributeCount; i++) {
            uint256 currentRarity = attributeRarities[i] + steps;
            if (random10k < currentRarity) {
                return i;
            }
            steps = currentRarity;
        }
        return 0;
    }
}

File 2 of 17 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _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 3 of 17 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

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

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

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

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 4 of 17 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Base URI for computing {tokenURI}. 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 5 of 17 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 7 of 17 : HorseUtilityContract.sol
pragma solidity ^0.8.4;
//SPDX-License-Identifier: MIT

//
//   ____ _           _                _   _   _                       _   _ _____ _____
//  / ___| |__   __ _(_)_ __   ___  __| | | | | | ___  _ __ ___  ___  | \ | |  ___|_   _|
// | |   | '_ \ / _` | | '_ \ / _ \/ _` | | |_| |/ _ \| '__/ __|/ _ \ |  \| | |_    | |
// | |___| | | | (_| | | | | |  __/ (_| | |  _  | (_) | |  \__ \  __/ | |\  |  _|   | |
//  \____|_| |_|\__,_|_|_| |_|\___|\__,_| |_| |_|\___/|_|  |___/\___| |_| \_|_|     |_|
//
//
//
//                                                 ,,  //
//                                              .//,,,,,,,,,
//                                              .//,,,,@@,,,,,,,
//                                            /////,,,,,,,,,,,,,
//                                            /////,,,,,,
//                                            /////,,,,,,
//                                          ///////,,,,,,
//                                      ///////////,,,,,,
//                        /////,,,,,,,,,,,,,,,,,,,,,,,,,,
//                      /////,,,,,,,,,,,,,,,,,,,,,,,,,,,,
//                      /////,,,,,,,,,,,,,,,,,,,,,,,,,,,,
//                      /////,,,,,,,,,,,,,,,,,,,,,,,,,,,,
//                    ////   ,,  //                ,,  //
//                    ////   ,,  //                ,,  //
//                    ////   ,,  //                ,,  //
//                    //     ,,  //                ,,  //
//                           @@  @@                @@  @@
//
// ** ChainedHorseNFT: HorseUtilityContract.sol **
// Written and developed by: Moonfarm
// Twitter: @spacesh1pdev
// Discord: Moonfarm#1138
//

contract HorseUtilityContract {
    //SVG-parts
    string constant svgStart =
        "<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 32 32'>";
    string constant svgEnd = "</svg>";
    string constant base =
        "<path fill='url(#body-color)' d='M19 7h1v1h-1zm2 0h1v1h-1zm-2 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm0 1h1v1h-1zm-1 0h1v1H9zm0 1h1v1H9zm1 0h1v1h-1zm1 0h1v1h-1zm0-1h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm0 1h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm0 1h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1H9zm0-1h1v1H9zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm0-1h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-3 3h1v1H9zm0 1h1v1H9zm0 1h1v1H9zm0 1h1v1H9zm2 0h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm8 0h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm2 0h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1z' /><path fill='#000' opacity='.35' d='M21 7h1v1h-1zm0 14h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm-10 0h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1z' /><path fill='url(#hoof-color)' d='M9 25h1v1H9zm2 0h1v1h-1zm8 0h1v1h-1zm2 0h1v1h-1z' /><path fill='#000' d='M21 10h1v1h-1z' />";

    // attribute svgs
    string[] private maneColorSvgs = [
        "#000",
        "#da5d97",
        "#806bd5",
        "#b05ecd",
        "#f25a5f",
        "#ff8c2f",
        "#fff",
        "#00b7e6",
        "#3fa966",
        "#3d6ccd",
        "#ebbd54"
    ];
    string[] private patternColorSvgs = [
        "#643323",
        "#333",
        "#72d2ff",
        "#f1c5d1",
        "#dad4f7",
        "#6ecb63",
        "#da3832",
        "#fffac8",
        "#df6436",
        "#50b7e6",
        "#ff0075",
        "#fff"
    ];
    string[] private hoofColorSvgs = [
        "#000",
        "#544116",
        "#22577a",
        "#7e5b24",
        "#004927",
        "#008762",
        "#d53832",
        "#b0c7e6",
        "#76267b",
        "#e6adb0",
        "#ebbd54"
    ];
    string[] private bodyColorSvgs = [
        "#dfc969",
        "#685991",
        "#6d6e71",
        "#845f36",
        "#fff",
        "#6ecb63",
        "#b4255b",
        "#418151",
        "#007791",
        "#ebbd54"
    ];
    string[] private headAccessorySvgs = [
        "",
        "<path fill='#912b61' d='M19 8h1v1h-1zM19 7h1v1h-1zM20 7h1v1h-1zM21 7h1v1h-1zM21 8h1v1h-1zM20 8h1v1h-1zM22 8h1v1h-1zM23 8h1v1h-1zM24 8h1v1h-1zM22 7h1v1h-1z' />",
        "<path fill='#da3832' d='M19 8h1v1h-1zM19 7h1v1h-1zM20 7h1v1h-1z' /><path fill='#fae84b' d='M20 8h1v1h-1zM21 8h1v1h-1zM21 7h1v1h-1z' /><path fill='#4a549f' d='M22 7h1v1h-1zM22 8h1v1h-1z' /><path fill='#119b55' d='M23 8h1v1h-1zM24 8h1v1h-1z' /><path fill='#3e4e9c' d='M21 6h1v1h-1zM21 5h1v1h-1zM20 5h1v1h-1zM22 5h1v1h-1z' />",
        "<path fill='#ebbd54' d='M18 15h1v1h-1zM18 16h1v1h-1zM19 17h1v1h-1zM20 18h1v1h-1zM21 18h1v1h-1zM22 18h1v1h-1zM22 19h1v1h-1zM21 19h1v1h-1z' />",
        "<path fill='#1fafff' d='M22 9h1v1h-1zM22 8h1v1h-1zM23 8h1v1h-1zM23 7h1v1h-1zM24 7h1v1h-1zM24 6h1v1h-1zM24 5h1v1h-1z' />",
        "<path fill='#ebbc53' d='M26 10h1v1h-1zM25 11h1v1h-1zM27 10h1v1h-1zM27 12h1v1h-1zM28 12h1v1h-1zM28 11h1v1h-1zM29 12h1v1h-1zM29 11h1v1h-1zM30 11h1v1h-1z' /><path fill='#d53931' d='M27 11h1v1h-1zM26 11h1v1h-1z' /><path fill='#ebbc53' d='M28 10h1v1h-1z' />",
        "<path fill='#000' d='M18 8h1v1h-1zM19 8h1v1h-1zM19 7h1v1h-1zM19 6h1v1h-1zM20 6h1v1h-1zM20 7h1v1h-1zM19 5h1v1h-1zM20 5h1v1h-1zM21 5h1v1h-1zM22 5h1v1h-1zM20 8h1v1h-1zM21 8h1v1h-1zM21 7h1v1h-1zM21 6h1v1h-1zM22 8h1v1h-1zM22 7h1v1h-1zM22 6h1v1h-1zM23 8h1v1h-1z' />",
        "<path fill='#af3034' d='M19 9h1v1h-1zM19 8h1v1h-1zM19 7h1v1h-1zM19 6h1v1h-1z' /><path fill='#7c231f' d='M21 8h1v1h-1zM21 7h1v1h-1zM21 6h1v1h-1z' />",
        "<path fill='#2d388b' d='M17 9h1v1h-1zM17 8h1v1h-1zM18 9h1v1h-1z' /><path fill='#ebbd54' d='M19 7h1v1h-1z' /><path fill='#2d388b' d='M19 6h1v1h-1zM19 5h1v1h-1zM19 4h1v1h-1zM18 4h1v1h-1zM17 4h1v1h-1zM17 5h1v1h-1zM20 5h1v1h-1zM21 6h1v1h-1zM20 6h1v1h-1zM20 7h1v1h-1zM21 7h1v1h-1z' /><path fill='#ebbd54' d='M21 8h1v1h-1z' /><path fill='#2d388b' d='M22 8h1v1h-1zM22 7h1v1h-1zM24 7h1v1h-1zM23 8h1v1h-1zM20 8h1v1h-1zM19 9h1v1h-1zM19 8h1v1h-1z' />",
        "<path fill='#e65157' d='M21 10h1v1h-1zM22 10h1v1h-1zM23 10h1v1h-1zM24 10h1v1h-1zM25 10h1v1h-1zM26 10h1v1h-1zM27 10h1v1h-1zM28 10h1v1h-1zM29 10h1v1h-1zM30 10h1v1h-1zM31 10h1v1h-1z' />",
        "<path fill='#7f5748' d='M19 9h1v1h-1zM19 8h1v1h-1zM20 7h1v1h-1z' /><path fill='#b2b6ba' d='M20 8h1v1h-1z' /><path fill='#7f5748' d='M20 9h1v1h-1zM21 9h1v1h-1zM21 8h1v1h-1z' /><path fill='#b2b6ba' d='M19 7h1v1h-1zM19 6h1v1h-1zM19 5h1v1h-1z' /><path fill='#8e959c' d='M22 6h1v1h-1zM22 5h1v1h-1z' /><path fill='#7f5748' d='M21 7h1v1h-1zM22 7h1v1h-1zM22 8h1v1h-1zM22 9h1v1h-1zM23 8h1v1h-1zM23 9h1v1h-1z' />",
        "<path fill='#ebbd54' d='M18 4h1v1h-1zM19 5h1v1h-1zM20 5h1v1h-1zM21 5h1v1h-1zM22 5h1v1h-1zM23 4h1v1h-1zM22 3h1v1h-1zM21 3h1v1h-1zM20 3h1v1h-1zM19 3h1v1h-1z' />",
        "<path fill='#86c661' d='M25 14h1v1h-1zm0 1h1v1h-1z' /><path fill='#04b3e9' d='M25 16h1v1h-1z' /><path fill='#86c661' d='M25 19h1v1h-1zm0-1h1v1h-1z' /><path fill='#04b3e9' d='M25 21h1v1h-1z' /><path fill='#fbee41' d='M24 12h1v1h-1zm0 2h1v1h-1z' /><path fill='#f58220' d='M24 13h1v1h-1z' /><path fill='#fbee41' d='M24 16h1v1h-1zm0 2h1v1h-1zm0-3h1v1h-1z' /><path fill='#ef4354' d='M23 12h1v1h-1z' /><path fill='#f58220' d='M23 16h1v1h-1z' /><path fill='#ef4354' d='M23 15h1v1h-1zm0 2h1v1h-1zm0 2h1v1h-1zm0-6h1v1h-1z' />",
        "<path fill='#ebbd54' d='M19 9h1v1h-1zM19 8h1v1h-1zM19 7h1v1h-1zM19 6h1v1h-1zM20 7h1v1h-1zM20 8h1v1h-1zM20 9h1v1h-1zM21 9h1v1h-1zM21 8h1v1h-1zM21 7h1v1h-1zM21 6h1v1h-1zM22 7h1v1h-1zM22 8h1v1h-1zM22 9h1v1h-1zM23 6h1v1h-1zM23 7h1v1h-1zM23 8h1v1h-1zM23 9h1v1h-1z' />"
    ];
    string[] private bodyAccessorySvgs = [
        "",
        "<path fill='#898989' d='M12 16h1v1h-1zM12 17h1v1h-1zM12 18h1v1h-1zM12 19h1v1h-1zM12 20h1v1h-1zM17 20h1v1h-1zM17 19h1v1h-1zM17 18h1v1h-1zM17 17h1v1h-1z' /><path fill='#221f20' d='M14 17h1v1h-1z' /><path fill='#fff' d='M14 16h1v1h-1zM15 16h1v1h-1zM16 16h1v1h-1zM16 17h1v1h-1zM16 18h1v1h-1zM16 19h1v1h-1zM16 20h1v1h-1zM14 20h1v1h-1zM14 19h1v1h-1zM14 18h1v1h-1zM13 18h1v1h-1zM13 17h1v1h-1zM13 16h1v1h-1zM13 19h1v1h-1zM13 20h1v1h-1z' /><path fill='#221f20' d='M15 17h1v1h-1zM15 18h1v1h-1zM15 19h1v1h-1zM15 20h1v1h-1z' /><path fill='#898989' d='M17 16h1v1h-1z' />",
        "<path fill='#af7139' d='M9 23h1v1H9zM9 24h1v1H9zM9 25h1v1H9zM10 25h1v1h-1z' /><path fill='#643323' d='M11 23h1v1h-1zM11 24h1v1h-1zM11 25h1v1h-1zM12 25h1v1h-1z' /><path fill='#af7139' d='M19 23h1v1h-1zM19 24h1v1h-1zM19 25h1v1h-1zM20 25h1v1h-1z' /><path fill='#643323' d='M21 23h1v1h-1zM21 24h1v1h-1zM21 25h1v1h-1zM22 25h1v1h-1z' />",
        "<path fill='#ff8c2f' d='M15 16h1v1h-1z' /><path fill='#e65157' d='M15 15h1v1h-1z' /><path fill='#ff8c2f' d='M14 15h1v1h-1z' /><path fill='#fff560' d='M14 16h1v1h-1z' /><path fill='#94ce6e' d='M13 16h1v1h-1z' /><path fill='#fff560' d='M13 15h1v1h-1z' /><path fill='#94ce6e' d='M12 15h1v1h-1z' /><path fill='#1db1e3' d='M12 16h1v1h-1zM11 15h1v1h-1z' /><path fill='#e65157' d='M14 14h1v1h-1z' /><path fill='#ff8c2f' d='M13 14h1v1h-1z' /><path fill='#fff560' d='M12 14h1v1h-1z' /><path fill='#94ce6e' d='M11 14h1v1h-1z' /><path fill='#1db1e3' d='M10 14h1v1h-1z' /><path fill='#e65157' d='M12 13h1v1h-1z' /><path fill='#ff8c2f' d='M11 13h1v1h-1z' /><path fill='#fff560' d='M10 13h1v1h-1z' /><path fill='#94ce6e' d='M9 13h1v1H9z' /><path fill='#1db1e3' d='M8 13h1v1H8z' /><path fill='#e65157' d='M10 12h1v1h-1z' /><path fill='#ff8c2f' d='M9 12h1v1H9z' /><path fill='#fff560' d='M8 12h1v1H8z' /><path fill='#94ce6e' d='M7 12h1v1H7z' /><path fill='#1db1e3' d='M6 12h1v1H6z' /><path fill='#e65157' d='M8 11h1v1H8z' /><path fill='#ff8c2f' d='M7 11h1v1H7z' /><path fill='#fff560' d='M6 11h1v1H6z' /><path fill='#94ce6e' d='M5 11h1v1H5z' /><path fill='#1db1e3' d='M4 11h1v1H4z' /><path fill='#e65157' d='M5 10h1v1H5z' /><path fill='#ff8c2f' d='M4 10h1v1H4z' /><path fill='#fff560' d='M3 10h1v1H3z' /><path fill='#94ce6e' d='M2 10h1v1H2z' /><path fill='#1db1e3' d='M1 10h1v1H1z' /><path fill='#e65157' d='M2 9h1v1H2z' /><path fill='#ff8c2f' d='M1 9h1v1H1z' /><path fill='#fff560' d='M0 9h1v1H0z' />",
        "<path fill='#fdef38' d='M14 12h1v1h-1zM13 12h1v1h-1zM12 11h1v1h-1zM9 13h1v1H9zM9 14h1v1H9zM10 15h1v1h-1zM13 17h1v1h-1zM13 18h1v1h-1zM14 19h1v1h-1zM14 20h1v1h-1zM15 21h1v1h-1zM23 18h1v1h-1zM23 17h1v1h-1zM22 16h1v1h-1zM23 24h1v1h-1zM24 24h1v1h-1zM25 23h1v1h-1zM26 23h1v1h-1zM25 14h1v1h-1zM24 13h1v1h-1zM13 23h1v1h-1zM14 24h1v1h-1zM15 24h1v1h-1zM19 17h1v1h-1zM19 16h1v1h-1zM19 15h1v1h-1zM18 14h1v1h-1zM18 13h1v1h-1z' />",
        "<path fill='#4487ab' d='M15 16h1v1h-1z' /><path fill='#addbfb' d='M14 16h1v1h-1zM14 14h1v1h-1z' /><path fill='#4487ab' d='M15 14h1v1h-1zM15 13h1v1h-1zM14 13h1v1h-1zM13 14h1v1h-1z' /><path fill='#addbfb' d='M13 13h1v1h-1z' /><path fill='#4487ab' d='M12 13h1v1h-1z' /><path fill='#addbfb' d='M12 14h1v1h-1zM11 13h1v1h-1zM11 12h1v1h-1zM10 13h1v1h-1zM9 12h1v1H9zM8 11h1v1H8z' /><path fill='#4487ab' d='M8 10h1v1H8zM9 13h1v1H9z' /><path fill='#addbfb' d='M9 11h1v1H9zM10 12h1v1h-1z' /><path fill='#4487ab' d='M14 12h1v1h-1zM13 12h1v1h-1z' /><path fill='#addbfb' d='M12 12h1v1h-1z' /><path fill='#4487ab' d='M12 11h1v1h-1zM11 11h1v1h-1zM10 11h1v1h-1z' /><path fill='#addbfb' d='M11 14h1v1h-1zM10 14h1v1h-1z' /><path fill='#4487ab' d='M15 15h1v1h-1z' /><path fill='#addbfb' d='M14 15h1v1h-1zM13 15h1v1h-1zM12 15h1v1h-1z' /><path fill='#4487ab' d='M9 10h1v1H9z' />",
        "<path fill='#afadb0' d='M14 15h1v1h-1zM15 15h1v1h-1zM15 14h1v1h-1zM14 14h1v1h-1zM14 13h1v1h-1zM15 13h1v1h-1zM16 13h1v1h-1zM16 14h1v1h-1zM14 12h1v1h-1zM13 12h1v1h-1zM13 13h1v1h-1zM13 14h1v1h-1zM12 14h1v1h-1zM12 13h1v1h-1zM12 12h1v1h-1zM11 12h1v1h-1zM11 13h1v1h-1zM11 14h1v1h-1z' /><path fill='#f25a5f' d='M10 13h1v1h-1z' /><path fill='#f3cb4e' d='M10 12h1v1h-1zM9 12h1v1H9z' /><path fill='#f25a5f' d='M9 13h1v1H9z' /><path fill='#f3cb4e' d='M8 13h1v1H8zM8 12h1v1H8zM7 12h1v1H7zM7 13h1v1H7zM6 13h1v1H6zM10 14h1v1h-1zM9 14h1v1H9zM8 14h1v1H8z' />",
        "<path d='M14 15h1v1h-1zM14 14h1v1h-1zM13 14h1v1h-1zM13 15h1v1h-1zM12 15h1v1h-1zM12 14h1v1h-1zM11 14h1v1h-1zM11 15h1v1h-1zM11 16h1v1h-1zM11 17h1v1h-1zM11 18h1v1h-1zM14 13h1v1h-1zM14 12h1v1h-1zM13 12h1v1h-1zM13 13h1v1h-1zM12 13h1v1h-1zM13 11h1v1h-1zM13 10h1v1h-1zM14 10h1v1h-1zM14 11h1v1h-1zM13 9h1v1h-1zM15 11h1v1h-1zM15 10h1v1h-1z' /><path fill='#f8e100' d='M14 10h1v1h-1z' />",
        "<path fill='#221f20' d='M15 16h1v1h-1z' /><path fill='#5d5e60' d='M14 16h1v1h-1zM14 14h1v1h-1z' /><path fill='#221f20' d='M15 14h1v1h-1zM15 13h1v1h-1zM14 13h1v1h-1zM13 14h1v1h-1z' /><path fill='#5d5e60' d='M13 13h1v1h-1z' /><path fill='#221f20' d='M12 13h1v1h-1z' /><path fill='#5d5e60' d='M12 14h1v1h-1zM11 13h1v1h-1zM11 12h1v1h-1zM10 13h1v1h-1zM9 12h1v1H9zM8 11h1v1H8z' /><path fill='#221f20' d='M8 10h1v1H8zM9 13h1v1H9z' /><path fill='#5d5e60' d='M9 11h1v1H9zM10 12h1v1h-1z' /><path fill='#221f20' d='M14 12h1v1h-1zM13 12h1v1h-1z' /><path fill='#5d5e60' d='M12 12h1v1h-1z' /><path fill='#221f20' d='M12 11h1v1h-1zM11 11h1v1h-1zM10 11h1v1h-1z' /><path fill='#5d5e60' d='M11 14h1v1h-1zM10 14h1v1h-1z' /><path fill='#221f20' d='M15 15h1v1h-1z' /><path fill='#5d5e60' d='M14 15h1v1h-1zM13 15h1v1h-1zM12 15h1v1h-1z' /><path fill='#221f20' d='M9 10h1v1H9z' />"
    ];
    string[] private patternSvgs = [
        "<path fill='url(#pattern-color)' d='M19 7h1v1h-1zM21 7h1v1h-1zM23 10h1v1h-1zM24 10h1v1h-1zM19 12h1v1h-1zM19 13h1v1h-1zM21 14h1v1h-1zM21 15h1v1h-1zM19 17h1v1h-1zM20 18h1v1h-1zM16 18h1v1h-1zM16 17h1v1h-1zM14 16h1v1h-1zM13 17h1v1h-1zM14 20h1v1h-1zM13 20h1v1h-1zM18 20h1v1h-1zM19 21h1v1h-1zM21 24h1v1h-1zM21 23h1v1h-1zM9 20h1v1H9zM9 21h1v1H9zM11 16h1v1h-1zM11 17h1v1h-1z' />",
        "<path fill='url(#pattern-color)' d='M19 14h1v1h-1zM21 17h1v1h-1zM18 19h1v1h-1zM20 20h1v1h-1zM14 16h1v1h-1zM12 19h1v1h-1zM11 17h1v1h-1zM16 20h1v1h-1zM9 23h1v1H9z' />",
        "<path fill='url(#pattern-color)' d='M16 16h1v1h-1zM15 17h1v1h-1zM16 17h1v1h-1zM16 18h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1zM17 20h1v1h-1zM15 18h1v1h-1zM15 19h1v1h-1zM16 20h1v1h-1zM15 20h1v1h-1zM14 20h1v1h-1zM13 20h1v1h-1zM12 20h1v1h-1zM11 20h1v1h-1zM11 21h1v1h-1zM11 22h1v1h-1zM11 23h1v1h-1zM11 24h1v1h-1zM9 24h1v1H9zM9 23h1v1H9zM9 22h1v1H9zM9 21h1v1H9zM9 20h1v1H9zM10 20h1v1h-1zM10 19h1v1h-1zM9 19h1v1H9zM9 18h1v1H9zM9 17h1v1H9zM10 17h1v1h-1zM10 16h1v1h-1zM11 16h1v1h-1zM12 16h1v1h-1zM13 16h1v1h-1zM14 16h1v1h-1zM15 16h1v1h-1zM14 17h1v1h-1zM14 18h1v1h-1zM14 19h1v1h-1zM13 19h1v1h-1zM13 18h1v1h-1zM13 17h1v1h-1zM12 17h1v1h-1zM12 18h1v1h-1zM12 19h1v1h-1zM11 19h1v1h-1zM11 18h1v1h-1zM11 17h1v1h-1zM10 18h1v1h-1z' />",
        "<path fill='url(#pattern-color)' d='M24 10h1v1h-1zM19 7h1v1h-1zM21 7h1v1h-1z' />",
        "<path fill='url(#pattern-color)' d='M9 19h1v1H9zM10 19h1v1h-1zM11 18h1v1h-1zM12 18h1v1h-1zM13 17h1v1h-1zM14 17h1v1h-1zM15 17h1v1h-1zM16 18h1v1h-1zM17 18h1v1h-1zM18 18h1v1h-1zM19 19h1v1h-1zM20 19h1v1h-1zM21 18h1v1h-1zM19 12h1v1h-1zM20 13h1v1h-1zM21 14h1v1h-1zM21 15h1v1h-1zM17 20h1v1h-1zM16 20h1v1h-1zM15 20h1v1h-1zM9 22h1v1H9zM9 23h1v1H9zM9 24h1v1H9z' />",
        "<path fill='url(#pattern-color)' d='M12 16h1v1h-1zM11 17h1v1h-1zM10 18h1v1h-1zM9 19h1v1H9zM9 23h1v1H9zM12 20h1v1h-1zM13 19h1v1h-1zM14 18h1v1h-1zM15 17h1v1h-1zM15 16h1v1h-1zM18 16h1v1h-1zM18 17h1v1h-1zM18 18h1v1h-1zM18 19h1v1h-1zM17 20h1v1h-1zM21 17h1v1h-1zM20 16h1v1h-1zM20 15h1v1h-1zM19 14h1v1h-1zM19 11h1v1h-1zM20 12h1v1h-1zM21 13h1v1h-1zM19 22h1v1h-1zM21 24h1v1h-1zM11 22h1v1h-1z'/>",
        "<path fill='url(#pattern-color)' d='M9 18h1v1H9zM10 17h1v1h-1zM11 18h1v1h-1zM12 17h1v1h-1zM13 18h1v1h-1zM14 17h1v1h-1zM15 18h1v1h-1zM16 17h1v1h-1zM17 18h1v1h-1zM18 17h1v1h-1zM19 18h1v1h-1zM20 17h1v1h-1zM21 18h1v1h-1zM10 19h1v1h-1zM9 20h1v1H9zM11 20h1v1h-1zM12 19h1v1h-1zM13 20h1v1h-1zM14 19h1v1h-1zM15 20h1v1h-1zM16 19h1v1h-1zM17 20h1v1h-1zM18 19h1v1h-1zM19 20h1v1h-1zM20 19h1v1h-1zM21 20h1v1h-1zM21 16h1v1h-1zM19 16h1v1h-1zM20 15h1v1h-1zM19 14h1v1h-1zM20 13h1v1h-1zM19 12h1v1h-1zM19 22h1v1h-1zM19 24h1v1h-1zM9 22h1v1H9zM9 24h1v1H9zM11 24h1v1h-1zM11 22h1v1h-1zM21 22h1v1h-1zM21 24h1v1h-1z' />",
        "<path fill='url(#pattern-color)' d='M12 17h1v1h-1zM12 18h1v1h-1zM11 18h1v1h-1zM11 19h1v1h-1zM12 19h1v1h-1zM12 20h1v1h-1zM13 20h1v1h-1zM13 19h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM15 18h1v1h-1zM14 18h1v1h-1zM13 18h1v1h-1zM13 17h1v1h-1zM16 16h1v1h-1zM17 16h1v1h-1zM18 16h1v1h-1zM18 17h1v1h-1zM17 17h1v1h-1zM19 17h1v1h-1zM21 12h1v1h-1zM21 13h1v1h-1zM21 14h1v1h-1zM20 14h1v1h-1zM20 13h1v1h-1zM21 19h1v1h-1zM20 19h1v1h-1zM20 20h1v1h-1zM21 20h1v1h-1zM19 21h1v1h-1zM19 22h1v1h-1zM19 20h1v1h-1z'/>",
        "",
        "<path fill='url(#pattern-color)' d='M21 9h1v1h-1zM20 9h1v1h-1zM20 10h1v1h-1zM20 11h1v1h-1zM21 11h1v1h-1z' /><path fill='#fff' d='M21 10h1v1h-1z' /><path fill='url(#pattern-color)'  d='M22 11h1v1h-1zM22 10h1v1h-1zM22 9h1v1h-1zM23 10h1v1h-1zM23 11h1v1h-1zM24 10h1v1h-1zM24 11h1v1h-1zM20 13h1v1h-1zM20 14h1v1h-1zM20 15h1v1h-1zM20 16h1v1h-1zM19 16h1v1h-1zM18 16h1v1h-1zM17 16h1v1h-1zM16 16h1v1h-1zM15 16h1v1h-1zM14 16h1v1h-1zM13 16h1v1h-1zM12 16h1v1h-1zM11 16h1v1h-1zM10 16h1v1h-1zM11 17h1v1h-1zM10 18h1v1h-1zM10 19h1v1h-1zM14 17h1v1h-1zM13 18h1v1h-1zM13 19h1v1h-1zM17 17h1v1h-1zM16 18h1v1h-1zM16 19h1v1h-1zM19 17h1v1h-1zM19 18h1v1h-1zM19 19h1v1h-1z' />"
    ];
    string[] private tailSvgs = [
        "<path fill='url(#mane-color)' d='M10 17H9v-1h1zM9 17H8v-1h1zM8 18H7v-1h1zM9 18H8v-1h1zM9 19H8v-1h1zM8 19H7v-1h1zM8 20H7v-1h1zM9 20H8v-1h1zM9 21H8v-1h1zM8 21H7v-1h1zM8 22H7v-1h1zM7 22H6v-1h1zM8 23H7v-1h1zM7 23H6v-1h1zM7 24H6v-1h1zM8 24H7v-1h1zM7 25H6v-1h1z' />",
        "<path fill='url(#mane-color)' d='M10 17H9v-1h1zM9 17H8v-1h1zM9 18H8v-1h1zM8 18H7v-1h1zM8 19H7v-1h1zM8 20H7v-1h1zM8 21H7v-1h1zM9 21H8v-1h1zM9 20H8v-1h1zM9 19H8v-1h1zM8 22H7v-1h1zM7 22H6v-1h1zM7 21H6v-1h1zM6 21H5v-1h1zM6 20H5v-1h1z' />",
        "<path fill='url(#mane-color)' d='M10 17H9v-1h1zM10 16H9v-1h1zM10 15H9v-1h1z'/>",
        "<path fill='url(#mane-color)' d='M10 17H9v-1h1zM9 17H8v-1h1zM8 18H7v-1h1zM9 18H8v-1h1zM9 19H8v-1h1zM8 19H7v-1h1zM8 20H7v-1h1zM9 20H8v-1h1zM9 21H8v-1h1zM8 21H7v-1h1zM8 22H7v-1h1zM7 22H6v-1h1zM8 23H7v-1h1zM7 23H6v-1h1zM7 24H6v-1h1zM8 24H7v-1h1zM7 25H6v-1h1zM7 26H6v-1h1zM6 26H5v-1h1zM5 26H4v-1h1zM4 26H3v-1h1zM3 26H2v-1h1zM6 25H5v-1h1zM6 24H5v-1h1zM5 25H4v-1h1zM2 26H1v-1h1zM1 26H0v-1h1zM4 25H3v-1h1z' />",
        "<path fill='url(#mane-color)' d='M10 17H9v-1h1z' />",
        "<path fill='url(#mane-color)' d='M10 17H9v-1h1zM9 17H8v-1h1zM9 18H8v-1h1zM9 20H8v-1h1zM9 21H8v-1h1z' />",
        "<path fill='url(#mane-color)' d='M10 17H9v-1h1zM9 17H8v-1h1zM9 18H8v-1h1zM9 20H8v-1h1zM9 21H8v-1h1z' />",
        "<path fill='url(#mane-color)' d='M10 17H9v-1h1zM9 18H8v-1h1zM9 17H8v-1h1zM8 18H7v-1h1zM9 19H8v-1h1zM9 20H8v-1h1zM9 21H8v-1h1zM9 22H8v-1h1zM8 20H7v-1h1zM8 22H7v-1h1zM9 23H8v-1h1zM9 24H8v-1h1z'/>"
    ];

    string[] private maneSvgs = [
        "<path fill='url(#mane-color)' d='M21 9h-1V8h1zm-2 1h-1V9h1zm0 1h-1v-1h1zm0 1h-1v-1h1zm0 1h-1v-1h1zm0 1h-1v-1h1zm0 1h-1v-1h1zm0 1h-1v-1h1zm-1 0h-1v-1h1zm-1 0h-1v-1h1zm-1 0h-1v-1h1zm-1 0h-1v-1h1zm2-1h-1v-1h1zm1 0h-1v-1h1zm0-1h-1v-1h1zm0-1h-1v-1h1zm0-1h-1v-1h1zm4-3h-1V8h1z' />",
        "<path fill='url(#mane-color)' d='M21 9h-1V8h1zM21 10h-1V9h1zM19 10h-1V9h1zM19 11h-1v-1h1zM19 12h-1v-1h1zM19 13h-1v-1h1zM19 14h-1v-1h1zM19 15h-1v-1h1zM19 16h-1v-1h1zM18 16h-1v-1h1zM17 16h-1v-1h1zM16 16h-1v-1h1zM16 17h-1v-1h1zM15 17h-1v-1h1zM14 17h-1v-1h1zM14 18h-1v-1h1zM15 18h-1v-1h1zM15 19h-1v-1h1zM14 19h-1v-1h1zM14 20h-1v-1h1zM14 21h-1v-1h1zM13 20h-1v-1h1zM13 21h-1v-1h1zM13 22h-1v-1h1zM13 23h-1v-1h1zM15 16h-1v-1h1zM17 15h-1v-1h1zM18 15h-1v-1h1zM18 14h-1v-1h1zM18 13h-1v-1h1zM18 12h-1v-1h1zM22 9h-1V8h1z' />",
        "<path fill='url(#mane-color)' d='M21 9h-1V8h1zM19 10h-1V9h1zM19 11h-1v-1h1zM19 12h-1v-1h1zM19 13h-1v-1h1zM19 14h-1v-1h1zM19 15h-1v-1h1zM19 16h-1v-1h1zM18 16h-1v-1h1zM22 9h-1V8h1z' />",
        "<path fill='url(#mane-color)' d='M21 9h-1V8h1zM19 10h-1V9h1zM19 11h-1v-1h1zM19 12h-1v-1h1zM19 13h-1v-1h1zM19 14h-1v-1h1zM19 15h-1v-1h1zM19 16h-1v-1h1zM18 16h-1v-1h1zM17 16h-1v-1h1zM17 17h-1v-1h1zM16 17h-1v-1h1zM16 18h-1v-1h1zM16 19h-1v-1h1zM15 18h-1v-1h1zM15 19h-1v-1h1zM15 20h-1v-1h1zM15 21h-1v-1h1zM15 22h-1v-1h1zM15 23h-1v-1h1zM15 24h-1v-1h1zM16 16h-1v-1h1zM15 16h-1v-1h1zM15 17h-1v-1h1zM14 17h-1v-1h1zM14 18h-1v-1h1zM14 19h-1v-1h1zM14 20h-1v-1h1zM14 21h-1v-1h1zM14 22h-1v-1h1zM14 23h-1v-1h1zM17 15h-1v-1h1zM18 15h-1v-1h1zM18 14h-1v-1h1zM18 13h-1v-1h1zM18 12h-1v-1h1zM22 9h-1V8h1z' />",
        "<path fill='url(#mane-color)' d='M21 9h-1V8h1zM19 10h-1V9h1zM19 11h-1v-1h1zM19 12h-1v-1h1zM19 13h-1v-1h1zM19 14h-1v-1h1zM22 9h-1V8h1z' />",
        "<path fill='url(#mane-color)' d='M21 9h-1V8h1zM19 10h-1V9h1zM19 11h-1v-1h1zM19 12h-1v-1h1zM19 13h-1v-1h1zM19 14h-1v-1h1zM19 15h-1v-1h1zM19 16h-1v-1h1zM18 16h-1v-1h1zM17 16h-1v-1h1zM16 16h-1v-1h1zM17 15h-1v-1h1zM18 15h-1v-1h1zM18 14h-1v-1h1zM18 13h-1v-1h1zM18 12h-1v-1h1zM15 16h-1v-1h1zM24 13h-1v-1h1zM24 14h-1v-1h1zM24 15h-1v-1h1zM25 13h-1v-1h1zM22 9h-1V8h1z' />",
        "<path fill='url(#mane-color)' d='M21 9h-1V8h1zM19 10h-1V9h1zM18 10h-1V9h1zM18 12h-1v-1h1zM19 11h-1v-1h1zM19 12h-1v-1h1zM19 13h-1v-1h1zM19 14h-1v-1h1zM19 15h-1v-1h1zM18 14h-1v-1h1zM22 9h-1V8h1z' />",
        "<path fill='url(#mane-color)' d='M21 9h-1V8h1zM19 10h-1V9h1zM19 11h-1v-1h1zM19 13h-1v-1h1zM19 14h-1v-1h1zM19 16h-1v-1h1zM18 16h-1v-1h1zM22 9h-1V8h1z' />",
        "<path fill='url(#mane-color)' d='M21 9h-1V8h1zm-2 1h-1V9h1zm-1 0h-1V9h1zm0 2h-1v-1h1zm1-1h-1v-1h1zm0 1h-1v-1h1zm0 1h-1v-1h1zm0 1h-1v-1h1zm0 1h-1v-1h1zm0 1h-1v-1h1zm-1 0h-1v-1h1zm-1 0h-1v-1h1zm-1 0h-1v-1h1zm-1 0h-1v-1h1zm-1 0h-1v-1h1zm-1 0h-1v-1h1zm-1 0h-1v-1h1zm4-1h-1v-1h1zm-2 0h-1v-1h1zm10-2h-1v-1h1zm1 0h-1v-1h1zm-1 1h-1v-1h1zm0 1h-1v-1h1zm-6-1h-1v-1h1zm4-5h-1V8h1z' />"
    ];
    string[] private backgroundSvgs = [
        "<rect width='32' height='32' fill='#fff9d0' />",
        "<rect width='32' height='32' fill='#dfefff' />",
        "<rect width='32' height='32' fill='#aaffcf' />",
        "<rect width='32' height='32' fill='#efefcf' />",
        "<rect width='32' height='32' fill='#dadee9' />",
        "<rect width='32' height='32' fill='#ddadaf' />",
        "<rect width='32' height='32' fill='#ffefcf' />",
        "<rect width='32' height='32' fill='#bbe4ea' />",
        "<rect width='32' height='32' fill='#ffefbf' />",
        "<rect width='32' height='32' fill='#ffdfff' />"
    ];

    string[] private utilitySvgs = [
        "",
        "<path fill='#7f5748' d='M28 3h1v1h-1zM28 4h1v1h-1zM27 2h1v1h-1zM29 2h1v1h-1z' /><path fill='#ffda69' d='M29 3h1v1h-1zM29 5h1v1h-1zM27 3h1v1h-1zM27 5h1v1h-1z' />",
        "<path fill='#93d0f3' d='M27 23h1v1h-1zM27 24h1v1h-1zM28 22h1v1h-1z' /><path fill='#a4d18a' d='M28 21h1v1h-1z' /><path fill='#ffea84' d='M27 22h1v1h-1z' /><path fill='#93d0f3' d='M27 25h1v1h-1zM26 25h1v1h-1zM28 25h1v1h-1zM26 22h1v1h-1z' />",
        "<path fill='#ffda69' d='M27 20h1v1h-1zM26 21h1v1h-1z' /><path fill='#7f5748' d='M27 21h1v1h-1z' /><path fill='#ffda69' d='M28 21h1v1h-1zM28 22h1v1h-1zM27 22h1v1h-1zM26 22h1v1h-1zM27 23h1v1h-1zM27 24h1v1h-1zM26 25h1v1h-1zM27 25h1v1h-1zM28 25h1v1h-1z' />",
        "<path fill='#ffda69' d='M27 18h1v1h-1zM28 20h1v1h-1zM27 22h1v1h-1zM27 23h1v1h-1zM26 23h1v1h-1zM26 24h1v1h-1z' /><path fill='#d9554d' d='M27 24h1v1h-1z' /><path fill='#ffda69' d='M28 24h1v1h-1z' /><path fill='#a85f44' d='M28 25h1v1h-1zM27 25h1v1h-1zM26 25h1v1h-1zM25 25h1v1h-1zM29 25h1v1h-1z' />",
        "<path fill='#4dc7f6' d='M26 16h1v1h-1z' /><path fill='#555' d='M27 24h1v1h-1zm1-1h1v1h-1zm1-1h1v1h-1zm1-1h1v1h-1zm1-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm-1-1h1v1h-1zm-1-1h1v1h-1zm-1-1h1v1h-1zm-1 0h1v1h-1zm0 8h1v1h-1zm0 2h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm3 0h1v1h-1zm1 0h1v1h-1z' /><path fill='#4dc7f6' d='M25 17h1v1h-1z' /><path fill='#56b746' d='M24 18h1v1h-1zm0 1h1v1h-1z' /><path fill='#4dc7f6' d='M24 20h1v1h-1zm1 1h1v1h-1zm1 1h1v1h-1z' /><path fill='#56b746' d='M27 22h1v1h-1z' /><path fill='#4dc7f6' d='M28 22h1v1h-1zm1-1h1v1h-1z' /><path fill='#56b746' d='M30 20h1v1h-1z' /><path fill='#4dc7f6' d='M30 19h1v1h-1z' /><path fill='#56b746' d='M30 18h1v1h-1z' /><path fill='#4dc7f6' d='M29 17h1v1h-1zm-1-1h1v1h-1z' /><path fill='#56b746' d='M27 16h1v1h-1z' /><path fill='#4dc7f6' d='M26 17h1v1h-1z' /><path fill='#56b746' d='M26 18h1v1h-1zm-1 0h1v1h-1zm0 1h1v1h-1zm1 1h1v1h-1z' /><path fill='#4dc7f6' d='M26 19h1v1h-1zm-1 1h1v1h-1zm1 1h1v1h-1z' /><path fill='#56b746' d='M27 21h1v1h-1zm1 0h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm-1 0h1v1h-1zm0 1h1v1h-1z' /><path fill='#4dc7f6' d='M29 20h1v1h-1z' /><path fill='#56b746' d='M29 19h1v1h-1zm0-1h1v1h-1z' /><path fill='#4dc7f6' d='M28 18h1v1h-1z' /><path fill='#56b746' d='M27 18h1v1h-1zm0-1h1v1h-1zm1 0h1v1h-1z' />",
        "<path fill='#000' d='M27 8h1v1h-1zM26 7h1v1h-1zM28 7h1v1h-1zM22 4h1v1h-1zM21 3h1v1h-1zM23 3h1v1h-1zM28 3h1v1h-1zM27 2h1v1h-1zM29 2h1v1h-1z' />",
        "<path fill='#555' d='M27 25h1v1h-1zM27 24h1v1h-1zM27 23h1v1h-1zM27 22h1v1h-1zM26 25h1v1h-1zM26 22h1v1h-1zM28 22h1v1h-1zM28 25h1v1h-1z' /><path fill='#27aae1' d='M26 18h1v1h-1zM25 19h1v1h-1zM25 20h1v1h-1zM26 21h1v1h-1zM27 21h1v1h-1zM28 21h1v1h-1zM29 20h1v1h-1zM29 19h1v1h-1zM29 18h1v1h-1zM28 17h1v1h-1zM27 17h1v1h-1zM26 17h1v1h-1zM25 18h1v1h-1zM26 19h1v1h-1zM26 20h1v1h-1zM27 20h1v1h-1zM28 20h1v1h-1zM28 19h1v1h-1z' /><path fill='#fff' d='M28 18h1v1h-1z' /><path fill='#27aae1' d='M27 18h1v1h-1zM27 19h1v1h-1z' />",
        "<path fill='#75c164' d='M27 25h1v1h-1zM27 24h1v1h-1zM27 23h1v1h-1z' /><path fill='#ffda6a' d='M27 22h1v1h-1z' /><path fill='#ee2636' d='M27 21h1v1h-1z' /><path fill='#ffda6a' d='M27 20h1v1h-1z' /><path fill='#fff' d='M26 20h1v1h-1z' /><path fill='#ffda6a' d='M26 21h1v1h-1z' /><path fill='#fff' d='M26 22h1v1h-1zM28 22h1v1h-1z' /><path fill='#ffda6a' d='M28 21h1v1h-1z' /><path fill='#fff' d='M28 20h1v1h-1z' /><path fill='#75c164' d='M28 24h1v1h-1z' />",
        "<path fill='#1c75bc' d='M27 22h1v1h-1zm-1 1h1v1h-1zm0 1h1v1h-1zm1 1h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1-1h1v1h-1zm0-1h1v1h-1zm-1-1h1v1h-1z' /><path fill='#00aeef' d='M27 23h1v1h-1zm1 0h1v1h-1z' /><path fill='#fbb040' d='M29 23h1v1h-1z' /><path fill='#00aeef' d='M29 24h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1z' />",
        "<path fill='#754c29' d='M26 24h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm-1 1h1v1h-1zm-1 0h1v1h-1z' /><path fill='#a97c50' d='M28 23h1v1h-1zm-1-1h1v1h-1zm1-1h1v1h-1zm1 0h1v1h-1zm1-1h1v1h-1z' /><path fill='#75c164' d='M30 19h1v1h-1zm0-1h1v1h-1zm-1 0h1v1h-1zm0-1h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm0 1h1v1h-1zm-1 0h1v1h-1zm0 1h1v1h-1zm1 0h1v1h-1zm0 1h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm0-1h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm0-1h1v1h-1zm1 0h1v1h-1z' />",
        "<path fill='#8b5e3c' d='M26 25h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm-2 0h1v1h-1zm-1 0h1v1h-1z' /><path fill='#ffda6a' d='M27 22h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm-3 0h1v1h-1zm1-1h1v1h-1zm1 0h1v1h-1z' /><path fill='#8b5e3c' d='M26 24h1v1h-1z' /><path fill='#414042' d='M27 24h1v1h-1zm1 0h1v1h-1z' /><path fill='#8b5e3c' d='M28 23h1v1h-1zm2-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm1 1h1v1h-1zm0 1h1v1h-1z' />",
        "<path fill='#a97c50' d='M29 25h1v1h-1zm-2 0h1v1h-1z' /><path fill='#4eb74a' d='M24 23h1v1h-1zm1 0h1v1h-1zm0 1h1v1h-1zm-1 0h1v1h-1zm2 0h1v1h-1z' /><path fill='#408251' d='M27 24h1v1h-1zm0-1h1v1h-1zm1-1h1v1h-1zm1 0h1v1h-1zm1 2h1v1h-1zm-1 0h1v1h-1zm-1 0h1v1h-1zm0-1h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1z' /><path fill='#4eb74a' d='M31 24h1v1h-1z' />",
        "<path fill='#f57f20' d='M26 25h1v1h-1zM28 25h1v1h-1z' /><path fill='#fff' d='M29 23h1v1h-1zM29 22h1v1h-1zM29 24h1v1h-1zM28 24h1v1h-1zM27 24h1v1h-1zM26 24h1v1h-1zM26 23h1v1h-1zM25 23h1v1h-1zM25 22h1v1h-1zM25 21h1v1h-1zM25 20h1v1h-1zM26 20h1v1h-1zM26 21h1v1h-1zM26 22h1v1h-1zM27 23h1v1h-1zM28 23h1v1h-1z' /><path fill='#ebbd54' d='M24 21h1v1h-1z' />",
        "<path fill='#939598' opacity='.5' d='M26 23h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm1 0h1v1h-1zm0-1h1v1h-1zm1 0h1v1h-1zm1 0h1v1h-1zm0 1h1v1h-1zm1 0h1v1h-1zm0 2h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm-1-1h1v1h-1zm-1 1h1v1h-1zm-1-1h1v1h-1zm1 0h1v1h-1zm0-1h1v1h-1zm1 0h1v1h-1zm0-1h1v1h-1zm0-1h1v1h-1zm-1-1h1v1h-1zm-1 1h1v1h-1zm0 1h1v1h-1zm0 1h1v1h-1zm1-1h1v1h-1z' /><path fill='#fff200' d='M30 19h1v1h-1zm-2 0h1v1h-1z' />"
    ];

    // attribute names
    string[] private patternNames = [
        "giraffe",
        "small spots",
        "two tone",
        "tips",
        "curves",
        "stripes",
        "racing",
        "big spots",
        "butt naked",
        "death"
    ];
    string[] private headAccessoryNames = [
        "none",
        "purple cap",
        "propeller cap",
        "golden necklace",
        "unicorn horn",
        "flame breath",
        "top hat",
        "devil horns",
        "wizard hat",
        "laser",
        "viking helmet",
        "golden halo",
        "rainbow puke",
        "crown"
    ];
    string[] private bodyAccessoryNames = [
        "none",
        "winner",
        "bravery boots",
        "rainbow",
        "charged",
        "wings",
        "speed booster",
        "black cat",
        "hell wings"
    ];
    string[] private maneColorNames = [
        "black",
        "strawberry",
        "blackberry",
        "juneberry",
        "cranberry",
        "cloudberry",
        "snowberry",
        "blueberry",
        "caperberry",
        "dewberry",
        "gold"
    ];
    string[] private patternColorNames = [
        "brown",
        "dark",
        "light blue",
        "pink",
        "purple",
        "green",
        "red",
        "cream",
        "orange",
        "blue",
        "deep pink",
        "white"
    ];
    string[] private hoofColorNames = [
        "black",
        "dark brown",
        "dark blue",
        "brown",
        "dark green",
        "light green",
        "red",
        "light purple",
        "purple",
        "pink",
        "gold"
    ];
    string[] private bodyColorNames = [
        "giraffe",
        "butterfly",
        "elephant",
        "bear",
        "polar bear",
        "frog",
        "lobster",
        "turtle",
        "whale",
        "gold"
    ];
    string[] private tailNames = [
        "normal",
        "pointy",
        "dog",
        "long",
        "bun",
        "baked",
        "pile",
        "dragon"
    ];
    string[] private maneNames = [
        "normal",
        "messy",
        "tidy",
        "overwhelming",
        "short",
        "bearded",
        "dragon",
        "baked",
        "mother of dragons"
    ];
    string[] private backgroundNames = [
        "curd",
        "starlight",
        "seafoam",
        "ghost green",
        "fog",
        "chestnut",
        "sand",
        "ice",
        "banana",
        "grape"
    ];
    string[] private utilityNames = [
        "none",
        "butterfly of fortune",
        "martini with alcohol",
        "grail of gold",
        "bonfire from hell",
        "globe of nastyness",
        "bats of mayhem",
        "orb of future",
        "flower of goodwill",
        "bowl of gold fish",
        "bonsai of life",
        "chest with bling",
        "turtle of speed",
        "duck of doom",
        "ghost of death"
    ];

    // attribute rarities
    uint256[] private maneColorRarities = [
        4000,
        1000,
        1000,
        1000,
        800,
        800,
        500,
        300,
        300,
        200,
        100
    ];
    uint256[] private patternColorRarities = [
        3000,
        1700,
        1350,
        900,
        800,
        800,
        500,
        300,
        200,
        200,
        150,
        100
    ];
    uint256[] private hoofColorRarities = [
        3500,
        1500,
        1100,
        1000,
        1000,
        500,
        500,
        400,
        200,
        200,
        100
    ];
    uint256[] private bodyColorRarities = [
        2900,
        1500,
        1500,
        1500,
        700,
        600,
        500,
        500,
        200,
        100
    ];
    uint256[] private backgroundRarities = [
        1000,
        1000,
        1000,
        1000,
        1000,
        1000,
        1000,
        1000,
        1000,
        1000
    ];
    uint256[] private tailRarities = [
        3000,
        2000,
        1500,
        1200,
        1000,
        750,
        350,
        200
    ];
    uint256[] private maneRarities = [
        3000,
        1800,
        1600,
        900,
        800,
        700,
        600,
        400,
        200
    ];
    uint256[] private patternRarities = [
        2000,
        1500,
        1500,
        1100,
        1000,
        800,
        800,
        500,
        500,
        300
    ];
    uint256[] private headAccessoryRarities = [
        3100,
        1500,
        1000,
        800,
        700,
        700,
        500,
        550,
        250,
        300,
        300,
        150,
        100,
        50
    ];
    uint256[] private bodyAccessoryRarities = [
        2500,
        2300,
        1400,
        1000,
        800,
        800,
        600,
        400,
        200
    ];
    uint256[] private utilityRarities = [
        3700,
        1000,
        900,
        500,
        400,
        500,
        200,
        600,
        900,
        500,
        300,
        250,
        100,
        100,
        50
    ];

    // amount of attributes
    uint8 constant maneColorCount = 11;
    uint8 constant patternColorCount = 12;
    uint8 constant hoofColorCount = 11;
    uint8 constant bodyColorCount = 10;
    uint8 constant backgroundCount = 10;
    uint8 constant tailCount = 8;
    uint8 constant maneCount = 9;
    uint8 constant patternCount = 10;
    uint8 constant headAccessoryCount = 14;
    uint8 constant bodyAccessoryCount = 9;
    uint8 constant utilityCount = 15;

    /**
     * Use:
     * Get a random attribute using the rarities defined
     */
    function getRandomIndex(
        uint256[] memory attributeRarities,
        uint8 attributeCount,
        uint256 randomNumber
    ) private pure returns (uint8 index) {
        uint256 random10k = randomNumber % 10000;
        uint256 steps = 0;
        for (uint8 i = 0; i < attributeCount; i++) {
            uint256 currentRarity = attributeRarities[i] + steps;
            if (random10k < currentRarity) {
                return i;
            }
            steps = currentRarity;
        }
        return 0;
    }

    /**
     * Use:
     * Get random attributes for each different property of the token
     *
     * Comment:
     * Can only be used by the TokenContract defined by address tokenContract
     */
    function getRandomAttributes(uint256 randomNumber)
        public
        view
        returns (
            uint8 maneColor,
            uint8 patternColor,
            uint8 hoofColor,
            uint8 bodyColor,
            uint8 background,
            uint8 tail,
            uint8 mane,
            uint8 pattern,
            uint8 headAccessory,
            uint8 bodyAccessory,
            uint8 utility
        )
    {
        maneColor = getRandomManeColor(randomNumber);
        randomNumber = randomNumber / 10;
        patternColor = getRandomPatternColor(randomNumber);
        randomNumber = randomNumber / 10;
        hoofColor = getRandomHoofColor(randomNumber);
        randomNumber = randomNumber / 10;
        bodyColor = getRandomBodyColor(randomNumber);
        randomNumber = randomNumber / 10;
        background = getRandomBackground(randomNumber);
        randomNumber = randomNumber / 10;
        tail = getRandomTail(randomNumber);
        randomNumber = randomNumber / 10;
        mane = getRandomMane(randomNumber);
        randomNumber = randomNumber / 10;
        pattern = getRandomPattern(randomNumber);
        randomNumber = randomNumber / 10;
        headAccessory = getRandomHeadAccessory(randomNumber);
        randomNumber = randomNumber / 10;
        bodyAccessory = getRandomBodyAccessory(randomNumber);
        randomNumber = randomNumber / 10;
        utility = getRandomUtility(randomNumber);

        return (
            maneColor,
            patternColor,
            hoofColor,
            bodyColor,
            background,
            tail,
            mane,
            pattern,
            headAccessory,
            bodyAccessory,
            utility
        );
    }

    function getRandomManeColor(uint256 randomNumber)
        private
        view
        returns (uint8)
    {
        return getRandomIndex(maneColorRarities, maneColorCount, randomNumber);
    }

    function getRandomPatternColor(uint256 randomNumber)
        private
        view
        returns (uint8)
    {
        return
            getRandomIndex(
                patternColorRarities,
                patternColorCount,
                randomNumber
            );
    }

    function getRandomHoofColor(uint256 randomNumber)
        private
        view
        returns (uint8)
    {
        return getRandomIndex(hoofColorRarities, hoofColorCount, randomNumber);
    }

    function getRandomBodyColor(uint256 randomNumber)
        private
        view
        returns (uint8)
    {
        return getRandomIndex(bodyColorRarities, bodyColorCount, randomNumber);
    }

    function getRandomBackground(uint256 randomNumber)
        private
        view
        returns (uint8)
    {
        return
            getRandomIndex(backgroundRarities, backgroundCount, randomNumber);
    }

    function getRandomTail(uint256 randomNumber) private view returns (uint8) {
        return getRandomIndex(tailRarities, tailCount, randomNumber);
    }

    function getRandomMane(uint256 randomNumber) private view returns (uint8) {
        return getRandomIndex(maneRarities, maneCount, randomNumber);
    }

    function getRandomPattern(uint256 randomNumber)
        private
        view
        returns (uint8)
    {
        return getRandomIndex(patternRarities, patternCount, randomNumber);
    }

    function getRandomHeadAccessory(uint256 randomNumber)
        private
        view
        returns (uint8)
    {
        return
            getRandomIndex(
                headAccessoryRarities,
                headAccessoryCount,
                randomNumber
            );
    }

    function getRandomBodyAccessory(uint256 randomNumber)
        private
        view
        returns (uint8)
    {
        return
            getRandomIndex(
                bodyAccessoryRarities,
                bodyAccessoryCount,
                randomNumber
            );
    }

    function getRandomUtility(uint256 randomNumber)
        private
        view
        returns (uint8)
    {
        return getRandomIndex(utilityRarities, utilityCount, randomNumber);
    }

    /**
     * Use:
     * Get the attribute name for the properties of the token
     *
     * Comment:
     * Can only be used by the TokenContract defined by address tokenContract
     */
    function getManeColor(uint8 index) public view returns (string memory) {
        return maneColorNames[index];
    }

    function getPatternColor(uint8 index) public view returns (string memory) {
        return patternColorNames[index];
    }

    function getHoofColor(uint8 index) public view returns (string memory) {
        return hoofColorNames[index];
    }

    function getBodyColor(uint8 index) public view returns (string memory) {
        return bodyColorNames[index];
    }

    function getBackground(uint8 index) public view returns (string memory) {
        return backgroundNames[index];
    }

    function getTail(uint8 index) public view returns (string memory) {
        return tailNames[index];
    }

    function getMane(uint8 index) public view returns (string memory) {
        return maneNames[index];
    }

    function getPattern(uint8 index) public view returns (string memory) {
        return patternNames[index];
    }

    function getHeadAccessory(uint8 index) public view returns (string memory) {
        return headAccessoryNames[index];
    }

    function getBodyAccessory(uint8 index) public view returns (string memory) {
        return bodyAccessoryNames[index];
    }

    function getUtility(uint8 index) public view returns (string memory) {
        return utilityNames[index];
    }

    /**
     * Use:
     * Get the attribute svg for a different property of the token
     *
     * Comment:
     * Can only be used by the TokenContract defined by address tokenContract
     */
    function renderHorse(
        bytes memory colors,
        uint8 background,
        uint8 tail,
        uint8 mane,
        uint8 pattern,
        uint8 headAccessory,
        uint8 bodyAccessory,
        uint8 utility
    ) public view returns (bytes memory) {
        bytes memory start = abi.encodePacked(
            svgStart,
            colors,
            backgroundSvgs[background],
            base,
            patternSvgs[pattern]
        );
        return
            abi.encodePacked(
                start,
                tailSvgs[tail],
                maneSvgs[mane],
                headAccessorySvgs[headAccessory],
                bodyAccessorySvgs[bodyAccessory],
                utilitySvgs[utility],
                svgEnd
            );
    }

    /**
     * Use:
     * Create color definitions for the svg
     */
    function packColor(string memory colorName, string memory colorSvg)
        private
        pure
        returns (bytes memory)
    {
        return
            abi.encodePacked(
                "<linearGradient id='",
                colorName,
                "'><stop stop-color='",
                colorSvg,
                "'/></linearGradient>"
            );
    }

    /**
     * Use:
     * Pack all colors together
     */
    function renderColors(
        uint8 maneColor,
        uint8 patternColor,
        uint8 hoofColor,
        uint8 bodyColor
    ) public view returns (bytes memory) {
        return
            abi.encodePacked(
                "<defs>",
                packColor("mane-color", maneColorSvgs[maneColor]),
                packColor("pattern-color", patternColorSvgs[patternColor]),
                packColor("hoof-color", hoofColorSvgs[hoofColor]),
                packColor("body-color", bodyColorSvgs[bodyColor]),
                "</defs>"
            );
    }
}

File 8 of 17 : base64.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0;

/// @title Base64
/// @author Brecht Devos - <[email protected]>
/// @notice Provides functions for encoding/decoding base64
library Base64 {
    string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
    bytes  internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000"
                                            hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000"
                                            hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000"
                                            hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000";

    function encode(bytes memory data) internal pure returns (string memory) {
        if (data.length == 0) return '';

        // load the table into memory
        string memory table = TABLE_ENCODE;

        // multiply by 4/3 rounded up
        uint256 encodedLen = 4 * ((data.length + 2) / 3);

        // add some extra buffer at the end required for the writing
        string memory result = new string(encodedLen + 32);

        assembly {
            // set the actual output length
            mstore(result, encodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

            // result ptr, jump over length
            let resultPtr := add(result, 32)

            // run over the input, 3 bytes at a time
            for {} lt(dataPtr, endPtr) {}
            {
                // read 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // write 4 characters
                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(shr( 6, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(        input,  0x3F))))
                resultPtr := add(resultPtr, 1)
            }

            // padding with '='
            switch mod(mload(data), 3)
            case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) }
            case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) }
        }

        return result;
    }

    function decode(string memory _data) internal pure returns (bytes memory) {
        bytes memory data = bytes(_data);

        if (data.length == 0) return new bytes(0);
        require(data.length % 4 == 0, "invalid base64 decoder input");

        // load the table into memory
        bytes memory table = TABLE_DECODE;

        // every 4 characters represent 3 bytes
        uint256 decodedLen = (data.length / 4) * 3;

        // add some extra buffer at the end required for the writing
        bytes memory result = new bytes(decodedLen + 32);

        assembly {
            // padding with '='
            let lastBytes := mload(add(data, mload(data)))
            if eq(and(lastBytes, 0xFF), 0x3d) {
                decodedLen := sub(decodedLen, 1)
                if eq(and(lastBytes, 0xFFFF), 0x3d3d) {
                    decodedLen := sub(decodedLen, 1)
                }
            }

            // set the actual output length
            mstore(result, decodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

            // result ptr, jump over length
            let resultPtr := add(result, 32)

            // run over the input, 4 characters at a time
            for {} lt(dataPtr, endPtr) {}
            {
               // read 4 characters
               dataPtr := add(dataPtr, 4)
               let input := mload(dataPtr)

               // write 3 bytes
               let output := add(
                   add(
                       shl(18, and(mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF)),
                       shl(12, and(mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF))),
                   add(
                       shl( 6, and(mload(add(tablePtr, and(shr( 8, input), 0xFF))), 0xFF)),
                               and(mload(add(tablePtr, and(        input , 0xFF))), 0xFF)
                    )
                )
                mstore(resultPtr, shl(232, output))
                resultPtr := add(resultPtr, 3)
            }
        }

        return result;
    }
}

File 9 of 17 : 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 10 of 17 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 11 of 17 : 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 12 of 17 : 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 13 of 17 : 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 14 of 17 : 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 15 of 17 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 16 of 17 : 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 17 of 17 : 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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"tokenName","type":"string"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint256","name":"_maxTokens","type":"uint256"},{"internalType":"address","name":"_utilityContract","type":"address"},{"internalType":"address","name":"mintedByOnOldContract","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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address[]","name":"newWhitelistMembers","type":"address[]"}],"name":"addWhitelistAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimableTokensPerAddress","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"getRandomAttributes","outputs":[{"internalType":"string","name":"svg","type":"string"},{"internalType":"string","name":"properties","type":"string"}],"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":[],"name":"maxTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTokensPerTxn","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId1","type":"uint256"},{"internalType":"uint256","name":"tokenId2","type":"uint256"}],"name":"rebirth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"rebirthPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebirthedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"saleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startSale","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenBurned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenSVG","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenSeed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"utilityContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistAddressCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistTokensUnlocksAtBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedAddressMintsLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101e0604052610fa060809081526103e860a081905260c081905260e052610320610100819052610120526101f46101405261012c6101608190526101805260c86101a05260646101c0526200005990600b908162000e54565b506040805161018081018252610bb881526106a460208201526105469181019190915261038460608201526103206080820181905260a08201526101f460c082015261012c60e082015260c8610100820181905261012082015260966101408201526064610160820152620000d290600c908162000e54565b506040805161016081018252610dac81526105dc602082015261044c918101919091526103e86060820181905260808201526101f460a0820181905260c082015261019060e082015260c8610100820181905261012082015260646101408201526200014390600d90600b62000e54565b506040805161014081018252610b5481526105dc6020820181905291810182905260608101919091526102bc608082015261025860a08201526101f460c0820181905260e082015260c86101008201526064610120820152620001ab90600e90600a62000e54565b5060408051610140810182526103e880825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810182905261010081018290526101208101919091526200020e90600f90600a62000e54565b506040805161010081018252610bb881526107d060208201526105dc918101919091526104b060608201526103e860808201526102ee60a082015261015e60c082015260c860e08201526200026890601090600862000e54565b506040805161012081018252610bb88152610708602082015261064091810191909152610384606082015261032060808201526102bc60a082015261025860c082015261019060e082015260c8610100820152620002cb90601190600962000e54565b5060408051610140810182526107d081526105dc602082018190529181019190915261044c60608201526103e8608082015261032060a0820181905260c08201526101f460e0820181905261010082015261012c6101208201526200033590601290600a62000e54565b50604080516101c081018252610c1c81526105dc60208201526103e89181019190915261032060608201526102bc6080820181905260a08201526101f460c082015261022660e082015260fa61010082015261012c61012082018190526101408201526096610160820152606461018082015260326101a0820152620003c090601390600e62000e54565b5060408051610120810182526109c481526108fc6020820152610578918101919091526103e860608201526103206080820181905260a082015261025860c082015261019060e082015260c86101008201526200042290601490600962000e54565b50604080516101e081018252610e7481526103e860208201526103849181018290526101f460608201819052610190608083015260a0820181905260c860c083015261025860e083015261010082019290925261012081019190915261012c61014082015260fa610160820152606461018082018190526101a082015260326101c0820152620004b790601590600f62000e54565b50601680546001600160a01b0319166001179055612710601755600060188190556019819055601a81905566470de4df820000601b55662386f26fc10000601c55601d805462ffffff1916610514179055601e819055601f556040805161052081019091526104f680825262005435602083013980516200053f916020919082019062000eaa565b503480156200054d57600080fd5b506040516200592b3803806200592b83398101604081905262000570916200101f565b8451859085906200058990600090602085019062000eaa565b5080516200059f90600190602084019062000eaa565b505050620005bc620005b6620005f260201b60201c565b620005f6565b6017839055601680546001600160a01b0319166001600160a01b038416179055620005e78162000648565b50505050506200120b565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62000655336000620007d0565b62000662816001620007d0565b6200066f816002620007d0565b6200067c816003620007d0565b62000689816004620007d0565b62000696816005620007d0565b60226020526a04960f35dea9c0fecc916f7fb84cf808d0d5b1ad44962c9bfddd3cfce67763c49ab557cfd0e9f6804faade99556a06713e6561d1f9841828e77fe39b43e4224876d80510ac9d8f190663bcce357e28a4aec26f3bf2e600bb40ec5569eb6d4b9ca88621a1bcaf7f52978eb6718a0ed733b71dbb3c4781d6da146a41523832713c09679420d0cac55569f4beb80f5ebc49eac46f7f3f1c07aec4ba487306d5d4faaa1d9deb5d8db1e41c6130041b740cb07487a5975569f24c68e587f9a09af7b77fd7343ae3d2c16eacc7c893fad12c1ec38efa5751e5cb5741a848035a232aa5e855600560009081526a049f665c960cfac7723a277f7936fc421e3565b4d3dbcb3877e96699375ad835c0ef9d9615e712c52b84dd4a556018805460069290620007c89084906200110e565b909155505050565b620007f2828260405180602001604052806000815250620007f660201b60201c565b5050565b62000802838362000872565b620008116000848484620009c8565b6200086d5760405162461bcd60e51b815260206004820152603260248201526000805160206200541583398151915260448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084015b60405180910390fd5b505050565b6001600160a01b038216620008ca5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640162000864565b6000818152600260205260409020546001600160a01b031615620009315760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640162000864565b6200093f6000838362000b31565b6001600160a01b03821660009081526003602052604081208054600192906200096a9084906200110e565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000620009e9846001600160a01b031662000c0d60201b620026ef1760201c565b1562000b2557604051630a85bd0160e11b81526001600160a01b0385169063150b7a029062000a23903390899088908890600401620010b8565b602060405180830381600087803b15801562000a3e57600080fd5b505af192505050801562000a71575060408051601f3d908101601f1916820190925262000a6e9181019062000fec565b60015b62000b0a573d80801562000aa2576040519150601f19603f3d011682016040523d82523d6000602084013e62000aa7565b606091505b50805162000b025760405162461bcd60e51b815260206004820152603260248201526000805160206200541583398151915260448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606482015260840162000864565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905062000b29565b5060015b949350505050565b62000b498383836200086d60201b620009f51760201c565b6001600160a01b03831662000ba75762000ba181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b62000bcd565b816001600160a01b0316836001600160a01b03161462000bcd5762000bcd838262000c13565b6001600160a01b03821662000be7576200086d8162000cc0565b826001600160a01b0316826001600160a01b0316146200086d576200086d828262000d7a565b3b151590565b6000600162000c2d8462000dcb60201b62000f1d1760201c565b62000c39919062001129565b60008381526007602052604090205490915080821462000c8d576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009062000cd49060019062001129565b6000838152600960205260408120546008805493945090928490811062000cff5762000cff620011df565b90600052602060002001549050806008838154811062000d235762000d23620011df565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548062000d5e5762000d5e620011c9565b6001900381819060005260206000200160009055905550505050565b600062000d928362000dcb60201b62000f1d1760201c565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60006001600160a01b03821662000e385760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840162000864565b506001600160a01b031660009081526003602052604090205490565b82805482825590600052602060002090810192821562000e98579160200282015b8281111562000e98578251829061ffff1690559160200191906001019062000e75565b5062000ea692915062000f27565b5090565b82805462000eb89062001176565b90600052602060002090601f01602090048101928262000edc576000855562000e98565b82601f1062000ef757805160ff191683800117855562000e98565b8280016001018555821562000e98579182015b8281111562000e9857825182559160200191906001019062000f0a565b5b8082111562000ea6576000815560010162000f28565b80516001600160a01b038116811462000f5657600080fd5b919050565b600082601f83011262000f6d57600080fd5b81516001600160401b038082111562000f8a5762000f8a620011f5565b604051601f8301601f19908116603f0116810190828211818310171562000fb55762000fb5620011f5565b8160405283815286602085880101111562000fcf57600080fd5b62000fe284602083016020890162001143565b9695505050505050565b60006020828403121562000fff57600080fd5b81516001600160e01b0319811681146200101857600080fd5b9392505050565b600080600080600060a086880312156200103857600080fd5b85516001600160401b03808211156200105057600080fd5b6200105e89838a0162000f5b565b965060208801519150808211156200107557600080fd5b50620010848882890162000f5b565b945050604086015192506200109c6060870162000f3e565b9150620010ac6080870162000f3e565b90509295509295909350565b600060018060a01b038087168352808616602084015250836040830152608060608301528251806080840152620010f78160a085016020870162001143565b601f01601f19169190910160a00195945050505050565b60008219821115620011245762001124620011b3565b500190565b6000828210156200113e576200113e620011b3565b500390565b60005b838110156200116057818101518382015260200162001146565b8381111562001170576000848401525b50505050565b600181811c908216806200118b57607f821691505b60208210811415620011ad57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6141fa806200121b6000396000f3fe6080604052600436106102515760003560e01c806370a0823111610139578063b66a0e5d116100b6578063dd8d4aa91161007a578063dd8d4aa9146106ae578063e8315742146106dc578063e985e9c5146106f2578063f2fde38b1461073b578063f34341c71461075b578063f5a1561e1461077a57600080fd5b8063b66a0e5d14610630578063b88d4fde14610645578063ba4ebdbd14610665578063c87b56dd1461067b578063cc98b3e81461069b57600080fd5b80638da5cb5b116100fd5780638da5cb5b146105a75780638dfb4b31146105c557806395d89b41146105db5780639bac5f7a146105f0578063a22cb4651461061057600080fd5b806370a082311461051a578063715018a61461053a578063740735c01461054f57806374a46577146105655780638d75fe051461059157600080fd5b8063369b1a40116101d25780634f6ccce7116101965780634f6ccce7146104475780635f516836146104675780636352211e146104945780636817c76c146104b457806368428a1b146104ca578063693be489146104ea57600080fd5b8063369b1a40146103c6578063379607f5146103dc5780633ccfd60b146103fc57806342842e0e1461041157806347b5dd541461043157600080fd5b806318160ddd1161021957806318160ddd1461032757806323b872dd1461034657806324ecd970146103665780632db11544146103935780632f745c59146103a657600080fd5b806301ffc9a71461025657806306fdde031461028b578063081812fc146102ad578063095ea7b3146102e55780630e256a5e14610307575b600080fd5b34801561026257600080fd5b50610276610271366004613823565b61079a565b60405190151581526020015b60405180910390f35b34801561029757600080fd5b506102a06107c5565b6040516102829190613e02565b3480156102b957600080fd5b506102cd6102c83660046138a6565b610857565b6040516001600160a01b039091168152602001610282565b3480156102f157600080fd5b50610305610300366004613745565b6108e4565b005b34801561031357600080fd5b5061030561032236600461376f565b6109fa565b34801561033357600080fd5b506008545b604051908152602001610282565b34801561035257600080fd5b50610305610361366004613627565b610aae565b34801561037257600080fd5b506103386103813660046135d9565b60216020526000908152604090205481565b6103056103a13660046138a6565b610adf565b3480156103b257600080fd5b506103386103c1366004613745565b610c1f565b3480156103d257600080fd5b50610338601e5481565b3480156103e857600080fd5b506103056103f73660046138a6565b610cb5565b34801561040857600080fd5b50610305610d9e565b34801561041d57600080fd5b5061030561042c366004613627565b610df8565b34801561043d57600080fd5b5061033860195481565b34801561045357600080fd5b506103386104623660046138a6565b610e13565b34801561047357600080fd5b506103386104823660046138a6565b60226020526000908152604090205481565b3480156104a057600080fd5b506102cd6104af3660046138a6565b610ea6565b3480156104c057600080fd5b50610338601b5481565b3480156104d657600080fd5b50601d546102769062010000900460ff1681565b3480156104f657600080fd5b506102766105053660046138a6565b60236020526000908152604090205460ff1681565b34801561052657600080fd5b506103386105353660046135d9565b610f1d565b34801561054657600080fd5b50610305610fa4565b34801561055b57600080fd5b50610338601f5481565b34801561057157600080fd5b50601d5461057f9060ff1681565b60405160ff9091168152602001610282565b34801561059d57600080fd5b5061033860185481565b3480156105b357600080fd5b50600a546001600160a01b03166102cd565b3480156105d157600080fd5b50610338601a5481565b3480156105e757600080fd5b506102a0610fda565b3480156105fc57600080fd5b506102a061060b3660046138a6565b610fe9565b34801561061c57600080fd5b5061030561062b366004613709565b61112f565b34801561063c57600080fd5b506103056111f4565b34801561065157600080fd5b50610305610660366004613663565b611240565b34801561067157600080fd5b50610338601c5481565b34801561068757600080fd5b506102a06106963660046138a6565b611278565b6103056106a93660046138bf565b6113cf565b3480156106ba57600080fd5b506106ce6106c93660046138a6565b611685565b604051610282929190613e15565b3480156106e857600080fd5b5061033860175481565b3480156106fe57600080fd5b5061027661070d3660046135f4565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561074757600080fd5b506103056107563660046135d9565b612657565b34801561076757600080fd5b50601d5461057f90610100900460ff1681565b34801561078657600080fd5b506016546102cd906001600160a01b031681565b60006001600160e01b0319821663780e9d6360e01b14806107bf57506107bf826126f5565b92915050565b6060600080546107d490614076565b80601f016020809104026020016040519081016040528092919081815260200182805461080090614076565b801561084d5780601f106108225761010080835404028352916020019161084d565b820191906000526020600020905b81548152906001019060200180831161083057829003601f168201915b5050505050905090565b600061086282612745565b6108c85760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006108ef82610ea6565b9050806001600160a01b0316836001600160a01b0316141561095d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016108bf565b336001600160a01b03821614806109795750610979813361070d565b6109eb5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108bf565b6109f58383612762565b505050565b600a546001600160a01b03163314610a245760405162461bcd60e51b81526004016108bf90613e95565b60005b8151811015610aaa57601d54825160ff90911690602190600090859085908110610a5357610a53614142565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550601f6000815480929190610a92906140b1565b91905055508080610aa2906140b1565b915050610a27565b5050565b610ab833826127d0565b610ad45760405162461bcd60e51b81526004016108bf90613f19565b6109f58383836128ba565b601d54601f54610af29160ff1690614014565b601754610aff9190614033565b601854610b0d908390612a65565b111580610b1b5750601e5443115b610b675760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e73206c6566742061726520666f722077686974656c69737400000060448201526064016108bf565b601b543490610b769083612a78565b1115610bc45760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f75676820657468657220746f206d696e74000000000000000060448201526064016108bf565b601d5462010000900460ff16610c135760405162461bcd60e51b815260206004820152601460248201527314d85b19481a185cc81b9bdd081cdd185c9d195960621b60448201526064016108bf565b610c1c81612a84565b50565b6000610c2a83610f1d565b8210610c8c5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016108bf565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b33600090815260216020526040902054811115610d265760405162461bcd60e51b815260206004820152602960248201527f457863656564656420616d6f756e74206f6620636c61696d73206c656674206f6044820152686e206164647265737360b81b60648201526084016108bf565b43601e5411610d6e5760405162461bcd60e51b815260206004820152601460248201527321b630b4b6903832b934b7b21034b99037bb32b960611b60448201526064016108bf565b610d7781612a84565b3360009081526021602052604081208054839290610d96908490614033565b909155505050565b600a546001600160a01b03163314610dc85760405162461bcd60e51b81526004016108bf90613e95565b604051303190339082156108fc029083906000818181858888f19350505050158015610aaa573d6000803e3d6000fd5b6109f583838360405180602001604052806000815250611240565b6000610e1e60085490565b8210610e815760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016108bf565b60088281548110610e9457610e94614142565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806107bf5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016108bf565b60006001600160a01b038216610f885760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016108bf565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b03163314610fce5760405162461bcd60e51b81526004016108bf90613e95565b610fd86000612bfb565b565b6060600180546107d490614076565b606060006018548310905060006019546017546110069190613fc3565b84108015611015575060175484115b905061102084612745565b158015611031575081806110315750805b156110ca576020805461104390614076565b80601f016020809104026020016040519081016040528092919081815260200182805461106f90614076565b80156110bc5780601f10611091576101008083540402835291602001916110bc565b820191906000526020600020905b81548152906001019060200180831161109f57829003601f168201915b505050505092505050919050565b6110d384612745565b6110ef5760405162461bcd60e51b81526004016108bf90613eca565b60008481526022602052604090205461110790612c4d565b6040516020016111179190613d28565b60405160208183030381529060405292505050919050565b6001600160a01b0382163314156111885760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108bf565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b0316331461121e5760405162461bcd60e51b81526004016108bf90613e95565b61122a43619d80613fc3565b601e55601d805462ff0000191662010000179055565b61124a33836127d0565b6112665760405162461bcd60e51b81526004016108bf90613f19565b61127284848484612c64565b50505050565b606061128382612745565b1580156112b557506018548210806112b557506019546017546112a69190613fc3565b821080156112b5575060175482115b1561135c576113366112c683612c97565b61130e6040518060400160405280600681526020016573746174757360d01b81525060405180604001604052806006815260200165189d5c9b995960d21b8152506001612db7565b602060405160200161132293929190613afe565b604051602081830303815290604052612e17565b6040516020016113469190613ce3565b6040516020818303038152906040529050919050565b61136582612745565b6113815760405162461bcd60e51b81526004016108bf90613eca565b600082815260226020526040812054819061139b90611685565b915091506113bf6113ab85612c97565b828460405160200161132293929190613c24565b6040516020016111179190613ce3565b808214156114165760405162461bcd60e51b81526020600482015260146024820152734e6f7420646966666572656e7420746f6b656e7360601b60448201526064016108bf565b3361142083610ea6565b6001600160a01b03161461146b5760405162461bcd60e51b81526020600482015260126024820152712737ba1037bbb732b91037b3103a37b5b2b760711b60448201526064016108bf565b3361147582610ea6565b6001600160a01b0316146114c05760405162461bcd60e51b81526020600482015260126024820152712737ba1037bbb732b91037b3103a37b5b2b760711b60448201526064016108bf565b60008281526023602052604090205460ff16156115105760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e48189d5c9b995960921b60448201526064016108bf565b60008181526023602052604090205460ff16156115605760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e48189d5c9b995960921b60448201526064016108bf565b601c5434146115b15760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f75676820657468657220746f2072656269727468000000000060448201526064016108bf565b6000828152602360205260408082208054600160ff19918216811790925584845291909220805490911690911790556115e982612f7d565b6115f281612f7d565b6002601960008282546116059190613fc3565b9091555050601a5460175460009161161d9190612a65565b6040805144602082015242918101919091526060810182905290915060800160408051601f1981840301815291815281516020928301206000848152602290935291205561166b3382613024565b601a805490600061167b836140b1565b9190505550505050565b60408051600b8082526101808201909252606091829160009160208201610160803683375050600b8054604080516020808402820181019092528281529495506117079493508301828280156116fa57602002820191906000526020600020905b8154815260200190600101908083116116e6575b5050505050600b8661303e565b8160008151811061171a5761171a614142565b60ff90921660209283029190910190910152611737606485614000565b9350611795600c80548060200260200160405190810160405280929190818152602001828054801561178857602002820191906000526020600020905b815481526020019060010190808311611774575b5050505050600c8661303e565b816001815181106117a8576117a8614142565b60ff909216602092830291909101909101526117c5606485614000565b9350611821600d8054806020026020016040519081016040528092919081815260200182805480156116fa57602002820191906000526020600020908154815260200190600101908083116116e6575050505050600b8661303e565b8160028151811061183457611834614142565b60ff90921660209283029190910190910152611851606485614000565b93506118af600e8054806020026020016040519081016040528092919081815260200182805480156118a257602002820191906000526020600020905b81548152602001906001019080831161188e575b5050505050600a8661303e565b816003815181106118c2576118c2614142565b60ff909216602092830291909101909101526118df606485614000565b935061193b600f8054806020026020016040519081016040528092919081815260200182805480156118a2576020028201919060005260206000209081548152602001906001019080831161188e575050505050600a8661303e565b8160048151811061194e5761194e614142565b60ff9092166020928302919091019091015261196b606485614000565b93506119c960108054806020026020016040519081016040528092919081815260200182805480156119bc57602002820191906000526020600020905b8154815260200190600101908083116119a8575b505050505060088661303e565b816005815181106119dc576119dc614142565b60ff909216602092830291909101909101526119f9606485614000565b9350611a576011805480602002602001604051908101604052809291908181526020018280548015611a4a57602002820191906000526020600020905b815481526020019060010190808311611a36575b505050505060098661303e565b81600681518110611a6a57611a6a614142565b60ff90921660209283029190910190910152611a87606485614000565b9350611ae360128054806020026020016040519081016040528092919081815260200182805480156118a2576020028201919060005260206000209081548152602001906001019080831161188e575050505050600a8661303e565b81600781518110611af657611af6614142565b60ff90921660209283029190910190910152611b13606485614000565b9350611b716013805480602002602001604051908101604052809291908181526020018280548015611b6457602002820191906000526020600020905b815481526020019060010190808311611b50575b5050505050600e8661303e565b81600881518110611b8457611b84614142565b60ff90921660209283029190910190910152611ba1606485614000565b9350611bfd6014805480602002602001604051908101604052809291908181526020018280548015611a4a5760200282019190600052602060002090815481526020019060010190808311611a3657505050505060098661303e565b81600981518110611c1057611c10614142565b60ff90921660209283029190910190910152611c2d606485614000565b9350611c8b6015805480602002602001604051908101604052809291908181526020018280548015611c7e57602002820191906000526020600020905b815481526020019060010190808311611c6a575b5050505050600f8661303e565b81600a81518110611c9e57611c9e614142565b60ff9092166020928302919091019091015260165481516000916001600160a01b031690632bd6746490829063d5b1ef489086908690611ce057611ce0614142565b602002602001015186600181518110611cfb57611cfb614142565b602002602001015187600281518110611d1657611d16614142565b602002602001015188600381518110611d3157611d31614142565b60200260200101516040518563ffffffff1660e01b8152600401611d78949392919060ff948516815292841660208401529083166040830152909116606082015260800190565b60006040518083038186803b158015611d9057600080fd5b505afa158015611da4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611dcc919081019061385d565b84600481518110611ddf57611ddf614142565b602002602001015185600581518110611dfa57611dfa614142565b602002602001015186600681518110611e1557611e15614142565b602002602001015187600781518110611e3057611e30614142565b602002602001015188600881518110611e4b57611e4b614142565b602002602001015189600981518110611e6657611e66614142565b60200260200101518a600a81518110611e8157611e81614142565b60200260200101516040518963ffffffff1660e01b8152600401611eac989796959493929190613daa565b60006040518083038186803b158015611ec457600080fd5b505afa158015611ed8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611f00919081019061385d565b9050611f0b81612e17565b60408051808201909152600a815269189858dad9dc9bdd5b9960b21b60208201526016548451929650600092611fe792916001600160a01b03169063192afd7e9087906004908110611f5f57611f5f614142565b60200260200101516040518263ffffffff1660e01b8152600401611f8c919060ff91909116815260200190565b60006040518083038186803b158015611fa457600080fd5b505afa158015611fb8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611fe0919081019061385d565b6000612db7565b6040805180820190915260048152631d185a5b60e21b6020820152601654855161202f92916001600160a01b03169063ea7680679088906005908110611f5f57611f5f614142565b6040805180820190915260048152636d616e6560e01b6020820152601654865161207792916001600160a01b03169063f6b40a169089906006908110611f5f57611f5f614142565b604080518082019091526007808252663830ba3a32b93760c91b602083015260165488516120c393926001600160a01b0390921691638a2d37d8918b91908110611f5f57611f5f614142565b60408051808201909152600e81526d68656164206163636573736f727960901b6020820152601654885161211592916001600160a01b031690634bafe6eb908b906008908110611f5f57611f5f614142565b60408051808201909152600e81526d626f6479206163636573736f727960901b6020820152601654895161216792916001600160a01b03169063971aa6a7908c906009908110611f5f57611f5f614142565b6040805180820190915260078152667574696c69747960c81b60208201526016548a516121b292916001600160a01b03169063e958ce05908d90600a908110611f5f57611f5f614142565b6040516020016121c897969594939291906139e3565b60408051808303601f19018152600480845260a08401909252925060009190816020015b60608152602001906001900390816121ec57505060165485519192506001600160a01b0316906301c1cee590869060009061222957612229614142565b60200260200101516040518263ffffffff1660e01b8152600401612256919060ff91909116815260200190565b60006040518083038186803b15801561226e57600080fd5b505afa158015612282573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122aa919081019061385d565b816000815181106122bd576122bd614142565b602090810291909101015260165484516001600160a01b039091169063cd6cff3890869060019081106122f2576122f2614142565b60200260200101516040518263ffffffff1660e01b815260040161231f919060ff91909116815260200190565b60006040518083038186803b15801561233757600080fd5b505afa15801561234b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612373919081019061385d565b8160018151811061238657612386614142565b602090810291909101015260165484516001600160a01b0390911690635ef559cd90869060029081106123bb576123bb614142565b60200260200101516040518263ffffffff1660e01b81526004016123e8919060ff91909116815260200190565b60006040518083038186803b15801561240057600080fd5b505afa158015612414573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261243c919081019061385d565b8160028151811061244f5761244f614142565b602090810291909101015260165484516001600160a01b0390911690633099e812908690600390811061248457612484614142565b60200260200101516040518263ffffffff1660e01b81526004016124b1919060ff91909116815260200190565b60006040518083038186803b1580156124c957600080fd5b505afa1580156124dd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612505919081019061385d565b8160038151811061251857612518614142565b60200260200101819052508161256c6040518060400160405280600a81526020016936b0b7329031b7b637b960b11b8152508360008151811061255d5761255d614142565b60200260200101516000612db7565b6125a86040518060400160405280600d81526020016c3830ba3a32b9371031b7b637b960991b8152508460018151811061255d5761255d614142565b6125e16040518060400160405280600a8152602001693437b7b31031b7b637b960b11b8152508560028151811061255d5761255d614142565b6126296040518060400160405280600a8152602001693137b23c9031b7b637b960b11b8152508660038151811061261a5761261a614142565b60200260200101516001612db7565b60405160200161263d959493929190613978565b604051602081830303815290604052945050505050915091565b600a546001600160a01b031633146126815760405162461bcd60e51b81526004016108bf90613e95565b6001600160a01b0381166126e65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108bf565b610c1c81612bfb565b3b151590565b60006001600160e01b031982166380ac58cd60e01b148061272657506001600160e01b03198216635b5e139f60e01b145b806107bf57506301ffc9a760e01b6001600160e01b03198316146107bf565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061279782610ea6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006127db82612745565b61283c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108bf565b600061284783610ea6565b9050806001600160a01b0316846001600160a01b031614806128825750836001600160a01b031661287784610857565b6001600160a01b0316145b806128b257506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166128cd82610ea6565b6001600160a01b0316146129355760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016108bf565b6001600160a01b0382166129975760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108bf565b6129a28383836130c1565b6129ad600082612762565b6001600160a01b03831660009081526003602052604081208054600192906129d6908490614033565b90915550506001600160a01b0382166000908152600360205260408120805460019290612a04908490613fc3565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000612a718284613fc3565b9392505050565b6000612a718284614014565b601d54610100900460ff16811115612aee5760405162461bcd60e51b815260206004820152602760248201527f547279696e6720746f206d696e74206d6f7265207468616e20616c6c6f77656460448201526620746f6b656e7360c81b60648201526084016108bf565b601754601854612aff908390612a65565b1115612b4d5760405162461bcd60e51b815260206004820152601a60248201527f416d6f756e74206578636565646564206d617820746f6b656e7300000000000060448201526064016108bf565b60005b81811015612be857444282601854612b689190613fc3565b60408051602081019490945283019190915260608201526080016040516020818303038152906040528051906020012060001c6022600083601854612bad9190613fc3565b815260200190815260200160002081905550612bd63382601854612bd19190613fc3565b613024565b80612be0816140b1565b915050612b50565b508060186000828254610d969190613fc3565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6060600080612c5b84611685565b50949350505050565b612c6f8484846128ba565b612c7b84848484613179565b6112725760405162461bcd60e51b81526004016108bf90613e43565b606081612cbb5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612ce55780612ccf816140b1565b9150612cde9050600a83614000565b9150612cbf565b60008167ffffffffffffffff811115612d0057612d00614158565b6040519080825280601f01601f191660200182016040528015612d2a576020820181803683370190505b509050815b8515612c5b57612d40600182614033565b90506000612d4f600a88614000565b612d5a90600a614014565b612d649088614033565b612d6f906030613fdb565b905060008160f81b905080848481518110612d8c57612d8c614142565b60200101906001600160f81b031916908160001a905350612dae600a89614000565b97505050612d2f565b6040805180820190915260018152600b60fa1b60208201526060908215612de957506040805160208101909152600081525b848482604051602001612dfe93929190613a75565b6040516020818303038152906040529150509392505050565b6060815160001415612e3757505060408051602081019091526000815290565b60006040518060600160405280604081526020016141856040913990506000600384516002612e669190613fc3565b612e709190614000565b612e7b906004614014565b90506000612e8a826020613fc3565b67ffffffffffffffff811115612ea257612ea2614158565b6040519080825280601f01601f191660200182016040528015612ecc576020820181803683370190505b509050818152600183018586518101602084015b81831015612f38576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f8116850151825350600101612ee0565b600389510660018114612f525760028114612f6357612f6f565b613d3d60f01b600119830152612f6f565b603d60f81b6000198301525b509398975050505050505050565b6000612f8882610ea6565b9050612f96816000846130c1565b612fa1600083612762565b6001600160a01b0381166000908152600360205260408120805460019290612fca908490614033565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610aaa828260405180602001604052806000815250613286565b60008061304d612710846140ec565b90506000805b8560ff168160ff1610156130b457600082888360ff168151811061307957613079614142565b602002602001015161308b9190613fc3565b9050808410156130a057509250612a71915050565b9150806130ac816140cc565b915050613053565b5060009695505050505050565b6001600160a01b03831661311c5761311781600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61313f565b816001600160a01b0316836001600160a01b03161461313f5761313f83826132b9565b6001600160a01b038216613156576109f581613356565b826001600160a01b0316826001600160a01b0316146109f5576109f58282613405565b60006001600160a01b0384163b1561327b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906131bd903390899088908890600401613d6d565b602060405180830381600087803b1580156131d757600080fd5b505af1925050508015613207575060408051601f3d908101601f1916820190925261320491810190613840565b60015b613261573d808015613235576040519150601f19603f3d011682016040523d82523d6000602084013e61323a565b606091505b5080516132595760405162461bcd60e51b81526004016108bf90613e43565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506128b2565b506001949350505050565b6132908383613449565b61329d6000848484613179565b6109f55760405162461bcd60e51b81526004016108bf90613e43565b600060016132c684610f1d565b6132d09190614033565b600083815260076020526040902054909150808214613323576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061336890600190614033565b6000838152600960205260408120546008805493945090928490811061339057613390614142565b9060005260206000200154905080600883815481106133b1576133b1614142565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806133e9576133e961412c565b6001900381819060005260206000200160009055905550505050565b600061341083610f1d565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b03821661349f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108bf565b6134a881612745565b156134f55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108bf565b613501600083836130c1565b6001600160a01b038216600090815260036020526040812080546001929061352a908490613fc3565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600061359b61359684613f9b565b613f6a565b90508281528383830111156135af57600080fd5b612a7183602083018461404a565b80356001600160a01b03811681146135d457600080fd5b919050565b6000602082840312156135eb57600080fd5b612a71826135bd565b6000806040838503121561360757600080fd5b613610836135bd565b915061361e602084016135bd565b90509250929050565b60008060006060848603121561363c57600080fd5b613645846135bd565b9250613653602085016135bd565b9150604084013590509250925092565b6000806000806080858703121561367957600080fd5b613682856135bd565b9350613690602086016135bd565b925060408501359150606085013567ffffffffffffffff8111156136b357600080fd5b8501601f810187136136c457600080fd5b80356136d261359682613f9b565b8181528860208385010111156136e757600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b6000806040838503121561371c57600080fd5b613725836135bd565b91506020830135801515811461373a57600080fd5b809150509250929050565b6000806040838503121561375857600080fd5b613761836135bd565b946020939093013593505050565b6000602080838503121561378257600080fd5b823567ffffffffffffffff8082111561379a57600080fd5b818501915085601f8301126137ae57600080fd5b8135818111156137c0576137c0614158565b8060051b91506137d1848301613f6a565b8181528481019084860184860187018a10156137ec57600080fd5b600095505b8386101561381657613802816135bd565b8352600195909501949186019186016137f1565b5098975050505050505050565b60006020828403121561383557600080fd5b8135612a718161416e565b60006020828403121561385257600080fd5b8151612a718161416e565b60006020828403121561386f57600080fd5b815167ffffffffffffffff81111561388657600080fd5b8201601f8101841361389757600080fd5b6128b284825160208401613588565b6000602082840312156138b857600080fd5b5035919050565b600080604083850312156138d257600080fd5b50508035926020909101359150565b600081518084526138f981602086016020860161404a565b601f01601f19169290920160200192915050565b7f222c20226465736372697074696f6e223a20224120686f72736520746861742081527f6c69766573206f6e2074686520657468657265756d20626c6f636b636861696e6020820152722e222c202261747472696275746573223a205b60681b604082015260530190565b6000865161398a818460208b0161404a565b86519083019061399e818360208b0161404a565b86519101906139b1818360208a0161404a565b85519101906139c481836020890161404a565b84519101906139d781836020880161404a565b01979650505050505050565b6000885160206139f68285838e0161404a565b895191840191613a098184848e0161404a565b8951920191613a1b8184848d0161404a565b8851920191613a2d8184848c0161404a565b8751920191613a3f8184848b0161404a565b8651920191613a518184848a0161404a565b8551920191613a63818484890161404a565b919091019a9950505050505050505050565b6f3d913a3930b4ba2fba3cb832911d101160811b81528351600090613aa181601085016020890161404a565b6c111610113b30b63ab2911d101160991b6010918401918201528451613ace81601d84016020890161404a565b61227d60f01b601d92909101918201528351613af181601f84016020880161404a565b01601f0195945050505050565b7f7b226e616d65223a224275726e656420436861696e656420486f7273652023008152600084516020613b3782601f8601838a0161404a565b613b45601f8386010161390d565b91508551613b568184848a0161404a565b6b2e96101134b6b0b3b2911d1160a11b92019182528454600c90600090600181811c9080831680613b8857607f831692505b868310811415613ba657634e487b7160e01b85526022600452602485fd5b808015613bba5760018114613bcf57613c00565b60ff1985168988015283890187019550613c00565b60008c81526020902060005b85811015613bf65781548b82018a0152908401908901613bdb565b505086848a010195505b5050505050613c178161227d60f01b815260020190565b9998505050505050505050565b7f7b226e616d65223a22436861696e656420486f72736520230000000000000000815260008451613c5c81601885016020890161404a565b613c6a60188285010161390d565b90508451613c7c81836020890161404a565b8082019150507f5d2c2022696d616765223a22646174613a696d6167652f7376672b786d6c3b62815265185cd94d8d0b60d21b60208201528351613cc781602684016020880161404a565b61227d60f01b6026929091019182015260280195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251613d1b81601d85016020870161404a565b91909101601d0192915050565b7f646174613a696d6167652f7376672b786d6c3b6261736536342c000000000000815260008251613d6081601a85016020870161404a565b91909101601a0192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613da0908301846138e1565b9695505050505050565b6000610100808352613dbe8184018c6138e1565b60ff9a8b166020850152988a16604084015250509487166060860152928616608085015290851660a0840152841660c083015290921660e090920191909152919050565b602081526000612a7160208301846138e1565b604081526000613e2860408301856138e1565b8281036020840152613e3a81856138e1565b95945050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff81118282101715613f9357613f93614158565b604052919050565b600067ffffffffffffffff821115613fb557613fb5614158565b50601f01601f191660200190565b60008219821115613fd657613fd6614100565b500190565b600060ff821660ff84168060ff03821115613ff857613ff8614100565b019392505050565b60008261400f5761400f614116565b500490565b600081600019048311821515161561402e5761402e614100565b500290565b60008282101561404557614045614100565b500390565b60005b8381101561406557818101518382015260200161404d565b838111156112725750506000910152565b600181811c9082168061408a57607f821691505b602082108114156140ab57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156140c5576140c5614100565b5060010190565b600060ff821660ff8114156140e3576140e3614100565b60010192915050565b6000826140fb576140fb614116565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610c1c57600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212202ad8d0942fcfb02a44350d2f2d8a8b261131f82d3c0abcb80799dca8365654d164736f6c634300080700334552433732313a207472616e7366657220746f206e6f6e204552433732315265646174613a696d6167652f7376672b786d6c3b6261736536342c50484e325a79423462577875637a306e6148523063446f764c336433647935334d793576636d63764d6a41774d43397a646d636e49485a705a586443623367394a7a41674d43417a4d69417a4d69632b50484268644767675a6d6c736244306e493251785a444e6b4e4363675a44306e545441674d47677a4d6e597a4d6b677765696376506a78775958526f49475a70624777394a794d314f4455354e57496e494751394a3030784d4341794e3067356469307861444636625445774944426f4c5446324c54466f4d5870744d6941776143307864693078614446364a79382b50484268644767675a6d6c736244306e497a497a4d5759794d4363675a44306e5454497a494449336143307864693078614446364a79382b50484268644767675a6d6c736244306e497a55344e546b31596963675a44306e5454493049444933614330786469307861444636625445674d4767744d5859744d576778656d30744d5451674d4767744d5859744d576778656d30784944426f4c5446324c54466f4d5870744d534177614330786469307861444636625445674d4767744d5859744d576778656d30784944426f4c5446324c54466f4d5870744d534177614330786469307861444636625445674d4767744d5859744d57677865696376506a78775958526f49475a70624777394a794d344d4467794f44556e494751394a3030784f4341794e3267744d5859744d57677865696376506a78775958526f49475a70624777394a794d314f4455354e57496e494751394a3030784f5341794e3267744d5859744d576778656d30794944426f4c5446324c54466f4d5870744d433078614330786469307861444636625330784944426f4c5446324c54466f4d5870744c5445674d4767744d5859744d576778656d30744d534177614330786469307861444636625330784944426f4c5446324c54466f4d586f6e4c7a3438634746306143426d615778735053636a4d6a4d785a6a49774a79426b5053644e4d5459674d6a5a6f4c5446324c54466f4d586f6e4c7a3438634746306143426d615778735053636a4e5467314f5456694a79426b5053644e4d5455674d6a5a6f4c5446324c54466f4d5870744d533078614330786469307861444636625445674d4767744d5859744d57677865696376506a78775958526f49475a70624777394a794d794d7a466d4d6a416e494751394a3030784f4341794e5767744d5859744d57677865696376506a78775958526f49475a70624777394a794d314f4455354e57496e494751394a3030784f5341794e5767744d5859744d576778656d30784944426f4c5446324c54466f4d5870744c5445744d5767744d5859744d57677865696376506a78775958526f49475a70624777394a794d344d4467794f44556e494751394a3030784e7941794e4767744d5859744d57677865696376506a78775958526f49475a70624777394a794d314f4455354e57496e494751394a3030784f4341794e4767744d5859744d576778656d30744e4341796143307864693078614446364a79382b50484268644767675a6d6c736244306e497a67774f4449344e5363675a44306e5454457a494449326143307864693078614446364a79382b50484268644767675a6d6c736244306e497a55344e546b31596963675a44306e54544579494449326143307864693078614446364a79382b5043397a646d632b00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000002710000000000000000000000000610b9dc17a6e457af9be6cd8d7956e12a4a596c3000000000000000000000000b2815298bb6f8cec3b1faacf81b4f1ad0b111918000000000000000000000000000000000000000000000000000000000000000d436861696e656420486f7273650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024348000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102515760003560e01c806370a0823111610139578063b66a0e5d116100b6578063dd8d4aa91161007a578063dd8d4aa9146106ae578063e8315742146106dc578063e985e9c5146106f2578063f2fde38b1461073b578063f34341c71461075b578063f5a1561e1461077a57600080fd5b8063b66a0e5d14610630578063b88d4fde14610645578063ba4ebdbd14610665578063c87b56dd1461067b578063cc98b3e81461069b57600080fd5b80638da5cb5b116100fd5780638da5cb5b146105a75780638dfb4b31146105c557806395d89b41146105db5780639bac5f7a146105f0578063a22cb4651461061057600080fd5b806370a082311461051a578063715018a61461053a578063740735c01461054f57806374a46577146105655780638d75fe051461059157600080fd5b8063369b1a40116101d25780634f6ccce7116101965780634f6ccce7146104475780635f516836146104675780636352211e146104945780636817c76c146104b457806368428a1b146104ca578063693be489146104ea57600080fd5b8063369b1a40146103c6578063379607f5146103dc5780633ccfd60b146103fc57806342842e0e1461041157806347b5dd541461043157600080fd5b806318160ddd1161021957806318160ddd1461032757806323b872dd1461034657806324ecd970146103665780632db11544146103935780632f745c59146103a657600080fd5b806301ffc9a71461025657806306fdde031461028b578063081812fc146102ad578063095ea7b3146102e55780630e256a5e14610307575b600080fd5b34801561026257600080fd5b50610276610271366004613823565b61079a565b60405190151581526020015b60405180910390f35b34801561029757600080fd5b506102a06107c5565b6040516102829190613e02565b3480156102b957600080fd5b506102cd6102c83660046138a6565b610857565b6040516001600160a01b039091168152602001610282565b3480156102f157600080fd5b50610305610300366004613745565b6108e4565b005b34801561031357600080fd5b5061030561032236600461376f565b6109fa565b34801561033357600080fd5b506008545b604051908152602001610282565b34801561035257600080fd5b50610305610361366004613627565b610aae565b34801561037257600080fd5b506103386103813660046135d9565b60216020526000908152604090205481565b6103056103a13660046138a6565b610adf565b3480156103b257600080fd5b506103386103c1366004613745565b610c1f565b3480156103d257600080fd5b50610338601e5481565b3480156103e857600080fd5b506103056103f73660046138a6565b610cb5565b34801561040857600080fd5b50610305610d9e565b34801561041d57600080fd5b5061030561042c366004613627565b610df8565b34801561043d57600080fd5b5061033860195481565b34801561045357600080fd5b506103386104623660046138a6565b610e13565b34801561047357600080fd5b506103386104823660046138a6565b60226020526000908152604090205481565b3480156104a057600080fd5b506102cd6104af3660046138a6565b610ea6565b3480156104c057600080fd5b50610338601b5481565b3480156104d657600080fd5b50601d546102769062010000900460ff1681565b3480156104f657600080fd5b506102766105053660046138a6565b60236020526000908152604090205460ff1681565b34801561052657600080fd5b506103386105353660046135d9565b610f1d565b34801561054657600080fd5b50610305610fa4565b34801561055b57600080fd5b50610338601f5481565b34801561057157600080fd5b50601d5461057f9060ff1681565b60405160ff9091168152602001610282565b34801561059d57600080fd5b5061033860185481565b3480156105b357600080fd5b50600a546001600160a01b03166102cd565b3480156105d157600080fd5b50610338601a5481565b3480156105e757600080fd5b506102a0610fda565b3480156105fc57600080fd5b506102a061060b3660046138a6565b610fe9565b34801561061c57600080fd5b5061030561062b366004613709565b61112f565b34801561063c57600080fd5b506103056111f4565b34801561065157600080fd5b50610305610660366004613663565b611240565b34801561067157600080fd5b50610338601c5481565b34801561068757600080fd5b506102a06106963660046138a6565b611278565b6103056106a93660046138bf565b6113cf565b3480156106ba57600080fd5b506106ce6106c93660046138a6565b611685565b604051610282929190613e15565b3480156106e857600080fd5b5061033860175481565b3480156106fe57600080fd5b5061027661070d3660046135f4565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561074757600080fd5b506103056107563660046135d9565b612657565b34801561076757600080fd5b50601d5461057f90610100900460ff1681565b34801561078657600080fd5b506016546102cd906001600160a01b031681565b60006001600160e01b0319821663780e9d6360e01b14806107bf57506107bf826126f5565b92915050565b6060600080546107d490614076565b80601f016020809104026020016040519081016040528092919081815260200182805461080090614076565b801561084d5780601f106108225761010080835404028352916020019161084d565b820191906000526020600020905b81548152906001019060200180831161083057829003601f168201915b5050505050905090565b600061086282612745565b6108c85760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006108ef82610ea6565b9050806001600160a01b0316836001600160a01b0316141561095d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016108bf565b336001600160a01b03821614806109795750610979813361070d565b6109eb5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108bf565b6109f58383612762565b505050565b600a546001600160a01b03163314610a245760405162461bcd60e51b81526004016108bf90613e95565b60005b8151811015610aaa57601d54825160ff90911690602190600090859085908110610a5357610a53614142565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550601f6000815480929190610a92906140b1565b91905055508080610aa2906140b1565b915050610a27565b5050565b610ab833826127d0565b610ad45760405162461bcd60e51b81526004016108bf90613f19565b6109f58383836128ba565b601d54601f54610af29160ff1690614014565b601754610aff9190614033565b601854610b0d908390612a65565b111580610b1b5750601e5443115b610b675760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e73206c6566742061726520666f722077686974656c69737400000060448201526064016108bf565b601b543490610b769083612a78565b1115610bc45760405162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f75676820657468657220746f206d696e74000000000000000060448201526064016108bf565b601d5462010000900460ff16610c135760405162461bcd60e51b815260206004820152601460248201527314d85b19481a185cc81b9bdd081cdd185c9d195960621b60448201526064016108bf565b610c1c81612a84565b50565b6000610c2a83610f1d565b8210610c8c5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016108bf565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b33600090815260216020526040902054811115610d265760405162461bcd60e51b815260206004820152602960248201527f457863656564656420616d6f756e74206f6620636c61696d73206c656674206f6044820152686e206164647265737360b81b60648201526084016108bf565b43601e5411610d6e5760405162461bcd60e51b815260206004820152601460248201527321b630b4b6903832b934b7b21034b99037bb32b960611b60448201526064016108bf565b610d7781612a84565b3360009081526021602052604081208054839290610d96908490614033565b909155505050565b600a546001600160a01b03163314610dc85760405162461bcd60e51b81526004016108bf90613e95565b604051303190339082156108fc029083906000818181858888f19350505050158015610aaa573d6000803e3d6000fd5b6109f583838360405180602001604052806000815250611240565b6000610e1e60085490565b8210610e815760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016108bf565b60088281548110610e9457610e94614142565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806107bf5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016108bf565b60006001600160a01b038216610f885760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016108bf565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b03163314610fce5760405162461bcd60e51b81526004016108bf90613e95565b610fd86000612bfb565b565b6060600180546107d490614076565b606060006018548310905060006019546017546110069190613fc3565b84108015611015575060175484115b905061102084612745565b158015611031575081806110315750805b156110ca576020805461104390614076565b80601f016020809104026020016040519081016040528092919081815260200182805461106f90614076565b80156110bc5780601f10611091576101008083540402835291602001916110bc565b820191906000526020600020905b81548152906001019060200180831161109f57829003601f168201915b505050505092505050919050565b6110d384612745565b6110ef5760405162461bcd60e51b81526004016108bf90613eca565b60008481526022602052604090205461110790612c4d565b6040516020016111179190613d28565b60405160208183030381529060405292505050919050565b6001600160a01b0382163314156111885760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108bf565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600a546001600160a01b0316331461121e5760405162461bcd60e51b81526004016108bf90613e95565b61122a43619d80613fc3565b601e55601d805462ff0000191662010000179055565b61124a33836127d0565b6112665760405162461bcd60e51b81526004016108bf90613f19565b61127284848484612c64565b50505050565b606061128382612745565b1580156112b557506018548210806112b557506019546017546112a69190613fc3565b821080156112b5575060175482115b1561135c576113366112c683612c97565b61130e6040518060400160405280600681526020016573746174757360d01b81525060405180604001604052806006815260200165189d5c9b995960d21b8152506001612db7565b602060405160200161132293929190613afe565b604051602081830303815290604052612e17565b6040516020016113469190613ce3565b6040516020818303038152906040529050919050565b61136582612745565b6113815760405162461bcd60e51b81526004016108bf90613eca565b600082815260226020526040812054819061139b90611685565b915091506113bf6113ab85612c97565b828460405160200161132293929190613c24565b6040516020016111179190613ce3565b808214156114165760405162461bcd60e51b81526020600482015260146024820152734e6f7420646966666572656e7420746f6b656e7360601b60448201526064016108bf565b3361142083610ea6565b6001600160a01b03161461146b5760405162461bcd60e51b81526020600482015260126024820152712737ba1037bbb732b91037b3103a37b5b2b760711b60448201526064016108bf565b3361147582610ea6565b6001600160a01b0316146114c05760405162461bcd60e51b81526020600482015260126024820152712737ba1037bbb732b91037b3103a37b5b2b760711b60448201526064016108bf565b60008281526023602052604090205460ff16156115105760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e48189d5c9b995960921b60448201526064016108bf565b60008181526023602052604090205460ff16156115605760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e48189d5c9b995960921b60448201526064016108bf565b601c5434146115b15760405162461bcd60e51b815260206004820152601b60248201527f4e6f7420656e6f75676820657468657220746f2072656269727468000000000060448201526064016108bf565b6000828152602360205260408082208054600160ff19918216811790925584845291909220805490911690911790556115e982612f7d565b6115f281612f7d565b6002601960008282546116059190613fc3565b9091555050601a5460175460009161161d9190612a65565b6040805144602082015242918101919091526060810182905290915060800160408051601f1981840301815291815281516020928301206000848152602290935291205561166b3382613024565b601a805490600061167b836140b1565b9190505550505050565b60408051600b8082526101808201909252606091829160009160208201610160803683375050600b8054604080516020808402820181019092528281529495506117079493508301828280156116fa57602002820191906000526020600020905b8154815260200190600101908083116116e6575b5050505050600b8661303e565b8160008151811061171a5761171a614142565b60ff90921660209283029190910190910152611737606485614000565b9350611795600c80548060200260200160405190810160405280929190818152602001828054801561178857602002820191906000526020600020905b815481526020019060010190808311611774575b5050505050600c8661303e565b816001815181106117a8576117a8614142565b60ff909216602092830291909101909101526117c5606485614000565b9350611821600d8054806020026020016040519081016040528092919081815260200182805480156116fa57602002820191906000526020600020908154815260200190600101908083116116e6575050505050600b8661303e565b8160028151811061183457611834614142565b60ff90921660209283029190910190910152611851606485614000565b93506118af600e8054806020026020016040519081016040528092919081815260200182805480156118a257602002820191906000526020600020905b81548152602001906001019080831161188e575b5050505050600a8661303e565b816003815181106118c2576118c2614142565b60ff909216602092830291909101909101526118df606485614000565b935061193b600f8054806020026020016040519081016040528092919081815260200182805480156118a2576020028201919060005260206000209081548152602001906001019080831161188e575050505050600a8661303e565b8160048151811061194e5761194e614142565b60ff9092166020928302919091019091015261196b606485614000565b93506119c960108054806020026020016040519081016040528092919081815260200182805480156119bc57602002820191906000526020600020905b8154815260200190600101908083116119a8575b505050505060088661303e565b816005815181106119dc576119dc614142565b60ff909216602092830291909101909101526119f9606485614000565b9350611a576011805480602002602001604051908101604052809291908181526020018280548015611a4a57602002820191906000526020600020905b815481526020019060010190808311611a36575b505050505060098661303e565b81600681518110611a6a57611a6a614142565b60ff90921660209283029190910190910152611a87606485614000565b9350611ae360128054806020026020016040519081016040528092919081815260200182805480156118a2576020028201919060005260206000209081548152602001906001019080831161188e575050505050600a8661303e565b81600781518110611af657611af6614142565b60ff90921660209283029190910190910152611b13606485614000565b9350611b716013805480602002602001604051908101604052809291908181526020018280548015611b6457602002820191906000526020600020905b815481526020019060010190808311611b50575b5050505050600e8661303e565b81600881518110611b8457611b84614142565b60ff90921660209283029190910190910152611ba1606485614000565b9350611bfd6014805480602002602001604051908101604052809291908181526020018280548015611a4a5760200282019190600052602060002090815481526020019060010190808311611a3657505050505060098661303e565b81600981518110611c1057611c10614142565b60ff90921660209283029190910190910152611c2d606485614000565b9350611c8b6015805480602002602001604051908101604052809291908181526020018280548015611c7e57602002820191906000526020600020905b815481526020019060010190808311611c6a575b5050505050600f8661303e565b81600a81518110611c9e57611c9e614142565b60ff9092166020928302919091019091015260165481516000916001600160a01b031690632bd6746490829063d5b1ef489086908690611ce057611ce0614142565b602002602001015186600181518110611cfb57611cfb614142565b602002602001015187600281518110611d1657611d16614142565b602002602001015188600381518110611d3157611d31614142565b60200260200101516040518563ffffffff1660e01b8152600401611d78949392919060ff948516815292841660208401529083166040830152909116606082015260800190565b60006040518083038186803b158015611d9057600080fd5b505afa158015611da4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611dcc919081019061385d565b84600481518110611ddf57611ddf614142565b602002602001015185600581518110611dfa57611dfa614142565b602002602001015186600681518110611e1557611e15614142565b602002602001015187600781518110611e3057611e30614142565b602002602001015188600881518110611e4b57611e4b614142565b602002602001015189600981518110611e6657611e66614142565b60200260200101518a600a81518110611e8157611e81614142565b60200260200101516040518963ffffffff1660e01b8152600401611eac989796959493929190613daa565b60006040518083038186803b158015611ec457600080fd5b505afa158015611ed8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611f00919081019061385d565b9050611f0b81612e17565b60408051808201909152600a815269189858dad9dc9bdd5b9960b21b60208201526016548451929650600092611fe792916001600160a01b03169063192afd7e9087906004908110611f5f57611f5f614142565b60200260200101516040518263ffffffff1660e01b8152600401611f8c919060ff91909116815260200190565b60006040518083038186803b158015611fa457600080fd5b505afa158015611fb8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611fe0919081019061385d565b6000612db7565b6040805180820190915260048152631d185a5b60e21b6020820152601654855161202f92916001600160a01b03169063ea7680679088906005908110611f5f57611f5f614142565b6040805180820190915260048152636d616e6560e01b6020820152601654865161207792916001600160a01b03169063f6b40a169089906006908110611f5f57611f5f614142565b604080518082019091526007808252663830ba3a32b93760c91b602083015260165488516120c393926001600160a01b0390921691638a2d37d8918b91908110611f5f57611f5f614142565b60408051808201909152600e81526d68656164206163636573736f727960901b6020820152601654885161211592916001600160a01b031690634bafe6eb908b906008908110611f5f57611f5f614142565b60408051808201909152600e81526d626f6479206163636573736f727960901b6020820152601654895161216792916001600160a01b03169063971aa6a7908c906009908110611f5f57611f5f614142565b6040805180820190915260078152667574696c69747960c81b60208201526016548a516121b292916001600160a01b03169063e958ce05908d90600a908110611f5f57611f5f614142565b6040516020016121c897969594939291906139e3565b60408051808303601f19018152600480845260a08401909252925060009190816020015b60608152602001906001900390816121ec57505060165485519192506001600160a01b0316906301c1cee590869060009061222957612229614142565b60200260200101516040518263ffffffff1660e01b8152600401612256919060ff91909116815260200190565b60006040518083038186803b15801561226e57600080fd5b505afa158015612282573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122aa919081019061385d565b816000815181106122bd576122bd614142565b602090810291909101015260165484516001600160a01b039091169063cd6cff3890869060019081106122f2576122f2614142565b60200260200101516040518263ffffffff1660e01b815260040161231f919060ff91909116815260200190565b60006040518083038186803b15801561233757600080fd5b505afa15801561234b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612373919081019061385d565b8160018151811061238657612386614142565b602090810291909101015260165484516001600160a01b0390911690635ef559cd90869060029081106123bb576123bb614142565b60200260200101516040518263ffffffff1660e01b81526004016123e8919060ff91909116815260200190565b60006040518083038186803b15801561240057600080fd5b505afa158015612414573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261243c919081019061385d565b8160028151811061244f5761244f614142565b602090810291909101015260165484516001600160a01b0390911690633099e812908690600390811061248457612484614142565b60200260200101516040518263ffffffff1660e01b81526004016124b1919060ff91909116815260200190565b60006040518083038186803b1580156124c957600080fd5b505afa1580156124dd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612505919081019061385d565b8160038151811061251857612518614142565b60200260200101819052508161256c6040518060400160405280600a81526020016936b0b7329031b7b637b960b11b8152508360008151811061255d5761255d614142565b60200260200101516000612db7565b6125a86040518060400160405280600d81526020016c3830ba3a32b9371031b7b637b960991b8152508460018151811061255d5761255d614142565b6125e16040518060400160405280600a8152602001693437b7b31031b7b637b960b11b8152508560028151811061255d5761255d614142565b6126296040518060400160405280600a8152602001693137b23c9031b7b637b960b11b8152508660038151811061261a5761261a614142565b60200260200101516001612db7565b60405160200161263d959493929190613978565b604051602081830303815290604052945050505050915091565b600a546001600160a01b031633146126815760405162461bcd60e51b81526004016108bf90613e95565b6001600160a01b0381166126e65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108bf565b610c1c81612bfb565b3b151590565b60006001600160e01b031982166380ac58cd60e01b148061272657506001600160e01b03198216635b5e139f60e01b145b806107bf57506301ffc9a760e01b6001600160e01b03198316146107bf565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061279782610ea6565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006127db82612745565b61283c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016108bf565b600061284783610ea6565b9050806001600160a01b0316846001600160a01b031614806128825750836001600160a01b031661287784610857565b6001600160a01b0316145b806128b257506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b03166128cd82610ea6565b6001600160a01b0316146129355760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016108bf565b6001600160a01b0382166129975760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016108bf565b6129a28383836130c1565b6129ad600082612762565b6001600160a01b03831660009081526003602052604081208054600192906129d6908490614033565b90915550506001600160a01b0382166000908152600360205260408120805460019290612a04908490613fc3565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000612a718284613fc3565b9392505050565b6000612a718284614014565b601d54610100900460ff16811115612aee5760405162461bcd60e51b815260206004820152602760248201527f547279696e6720746f206d696e74206d6f7265207468616e20616c6c6f77656460448201526620746f6b656e7360c81b60648201526084016108bf565b601754601854612aff908390612a65565b1115612b4d5760405162461bcd60e51b815260206004820152601a60248201527f416d6f756e74206578636565646564206d617820746f6b656e7300000000000060448201526064016108bf565b60005b81811015612be857444282601854612b689190613fc3565b60408051602081019490945283019190915260608201526080016040516020818303038152906040528051906020012060001c6022600083601854612bad9190613fc3565b815260200190815260200160002081905550612bd63382601854612bd19190613fc3565b613024565b80612be0816140b1565b915050612b50565b508060186000828254610d969190613fc3565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6060600080612c5b84611685565b50949350505050565b612c6f8484846128ba565b612c7b84848484613179565b6112725760405162461bcd60e51b81526004016108bf90613e43565b606081612cbb5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612ce55780612ccf816140b1565b9150612cde9050600a83614000565b9150612cbf565b60008167ffffffffffffffff811115612d0057612d00614158565b6040519080825280601f01601f191660200182016040528015612d2a576020820181803683370190505b509050815b8515612c5b57612d40600182614033565b90506000612d4f600a88614000565b612d5a90600a614014565b612d649088614033565b612d6f906030613fdb565b905060008160f81b905080848481518110612d8c57612d8c614142565b60200101906001600160f81b031916908160001a905350612dae600a89614000565b97505050612d2f565b6040805180820190915260018152600b60fa1b60208201526060908215612de957506040805160208101909152600081525b848482604051602001612dfe93929190613a75565b6040516020818303038152906040529150509392505050565b6060815160001415612e3757505060408051602081019091526000815290565b60006040518060600160405280604081526020016141856040913990506000600384516002612e669190613fc3565b612e709190614000565b612e7b906004614014565b90506000612e8a826020613fc3565b67ffffffffffffffff811115612ea257612ea2614158565b6040519080825280601f01601f191660200182016040528015612ecc576020820181803683370190505b509050818152600183018586518101602084015b81831015612f38576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f8116850151825350600101612ee0565b600389510660018114612f525760028114612f6357612f6f565b613d3d60f01b600119830152612f6f565b603d60f81b6000198301525b509398975050505050505050565b6000612f8882610ea6565b9050612f96816000846130c1565b612fa1600083612762565b6001600160a01b0381166000908152600360205260408120805460019290612fca908490614033565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610aaa828260405180602001604052806000815250613286565b60008061304d612710846140ec565b90506000805b8560ff168160ff1610156130b457600082888360ff168151811061307957613079614142565b602002602001015161308b9190613fc3565b9050808410156130a057509250612a71915050565b9150806130ac816140cc565b915050613053565b5060009695505050505050565b6001600160a01b03831661311c5761311781600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61313f565b816001600160a01b0316836001600160a01b03161461313f5761313f83826132b9565b6001600160a01b038216613156576109f581613356565b826001600160a01b0316826001600160a01b0316146109f5576109f58282613405565b60006001600160a01b0384163b1561327b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906131bd903390899088908890600401613d6d565b602060405180830381600087803b1580156131d757600080fd5b505af1925050508015613207575060408051601f3d908101601f1916820190925261320491810190613840565b60015b613261573d808015613235576040519150601f19603f3d011682016040523d82523d6000602084013e61323a565b606091505b5080516132595760405162461bcd60e51b81526004016108bf90613e43565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506128b2565b506001949350505050565b6132908383613449565b61329d6000848484613179565b6109f55760405162461bcd60e51b81526004016108bf90613e43565b600060016132c684610f1d565b6132d09190614033565b600083815260076020526040902054909150808214613323576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061336890600190614033565b6000838152600960205260408120546008805493945090928490811061339057613390614142565b9060005260206000200154905080600883815481106133b1576133b1614142565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806133e9576133e961412c565b6001900381819060005260206000200160009055905550505050565b600061341083610f1d565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b03821661349f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108bf565b6134a881612745565b156134f55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108bf565b613501600083836130c1565b6001600160a01b038216600090815260036020526040812080546001929061352a908490613fc3565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600061359b61359684613f9b565b613f6a565b90508281528383830111156135af57600080fd5b612a7183602083018461404a565b80356001600160a01b03811681146135d457600080fd5b919050565b6000602082840312156135eb57600080fd5b612a71826135bd565b6000806040838503121561360757600080fd5b613610836135bd565b915061361e602084016135bd565b90509250929050565b60008060006060848603121561363c57600080fd5b613645846135bd565b9250613653602085016135bd565b9150604084013590509250925092565b6000806000806080858703121561367957600080fd5b613682856135bd565b9350613690602086016135bd565b925060408501359150606085013567ffffffffffffffff8111156136b357600080fd5b8501601f810187136136c457600080fd5b80356136d261359682613f9b565b8181528860208385010111156136e757600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b6000806040838503121561371c57600080fd5b613725836135bd565b91506020830135801515811461373a57600080fd5b809150509250929050565b6000806040838503121561375857600080fd5b613761836135bd565b946020939093013593505050565b6000602080838503121561378257600080fd5b823567ffffffffffffffff8082111561379a57600080fd5b818501915085601f8301126137ae57600080fd5b8135818111156137c0576137c0614158565b8060051b91506137d1848301613f6a565b8181528481019084860184860187018a10156137ec57600080fd5b600095505b8386101561381657613802816135bd565b8352600195909501949186019186016137f1565b5098975050505050505050565b60006020828403121561383557600080fd5b8135612a718161416e565b60006020828403121561385257600080fd5b8151612a718161416e565b60006020828403121561386f57600080fd5b815167ffffffffffffffff81111561388657600080fd5b8201601f8101841361389757600080fd5b6128b284825160208401613588565b6000602082840312156138b857600080fd5b5035919050565b600080604083850312156138d257600080fd5b50508035926020909101359150565b600081518084526138f981602086016020860161404a565b601f01601f19169290920160200192915050565b7f222c20226465736372697074696f6e223a20224120686f72736520746861742081527f6c69766573206f6e2074686520657468657265756d20626c6f636b636861696e6020820152722e222c202261747472696275746573223a205b60681b604082015260530190565b6000865161398a818460208b0161404a565b86519083019061399e818360208b0161404a565b86519101906139b1818360208a0161404a565b85519101906139c481836020890161404a565b84519101906139d781836020880161404a565b01979650505050505050565b6000885160206139f68285838e0161404a565b895191840191613a098184848e0161404a565b8951920191613a1b8184848d0161404a565b8851920191613a2d8184848c0161404a565b8751920191613a3f8184848b0161404a565b8651920191613a518184848a0161404a565b8551920191613a63818484890161404a565b919091019a9950505050505050505050565b6f3d913a3930b4ba2fba3cb832911d101160811b81528351600090613aa181601085016020890161404a565b6c111610113b30b63ab2911d101160991b6010918401918201528451613ace81601d84016020890161404a565b61227d60f01b601d92909101918201528351613af181601f84016020880161404a565b01601f0195945050505050565b7f7b226e616d65223a224275726e656420436861696e656420486f7273652023008152600084516020613b3782601f8601838a0161404a565b613b45601f8386010161390d565b91508551613b568184848a0161404a565b6b2e96101134b6b0b3b2911d1160a11b92019182528454600c90600090600181811c9080831680613b8857607f831692505b868310811415613ba657634e487b7160e01b85526022600452602485fd5b808015613bba5760018114613bcf57613c00565b60ff1985168988015283890187019550613c00565b60008c81526020902060005b85811015613bf65781548b82018a0152908401908901613bdb565b505086848a010195505b5050505050613c178161227d60f01b815260020190565b9998505050505050505050565b7f7b226e616d65223a22436861696e656420486f72736520230000000000000000815260008451613c5c81601885016020890161404a565b613c6a60188285010161390d565b90508451613c7c81836020890161404a565b8082019150507f5d2c2022696d616765223a22646174613a696d6167652f7376672b786d6c3b62815265185cd94d8d0b60d21b60208201528351613cc781602684016020880161404a565b61227d60f01b6026929091019182015260280195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251613d1b81601d85016020870161404a565b91909101601d0192915050565b7f646174613a696d6167652f7376672b786d6c3b6261736536342c000000000000815260008251613d6081601a85016020870161404a565b91909101601a0192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613da0908301846138e1565b9695505050505050565b6000610100808352613dbe8184018c6138e1565b60ff9a8b166020850152988a16604084015250509487166060860152928616608085015290851660a0840152841660c083015290921660e090920191909152919050565b602081526000612a7160208301846138e1565b604081526000613e2860408301856138e1565b8281036020840152613e3a81856138e1565b95945050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff81118282101715613f9357613f93614158565b604052919050565b600067ffffffffffffffff821115613fb557613fb5614158565b50601f01601f191660200190565b60008219821115613fd657613fd6614100565b500190565b600060ff821660ff84168060ff03821115613ff857613ff8614100565b019392505050565b60008261400f5761400f614116565b500490565b600081600019048311821515161561402e5761402e614100565b500290565b60008282101561404557614045614100565b500390565b60005b8381101561406557818101518382015260200161404d565b838111156112725750506000910152565b600181811c9082168061408a57607f821691505b602082108114156140ab57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156140c5576140c5614100565b5060010190565b600060ff821660ff8114156140e3576140e3614100565b60010192915050565b6000826140fb576140fb614116565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610c1c57600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212202ad8d0942fcfb02a44350d2f2d8a8b261131f82d3c0abcb80799dca8365654d164736f6c63430008070033

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

00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000002710000000000000000000000000610b9dc17a6e457af9be6cd8d7956e12a4a596c3000000000000000000000000b2815298bb6f8cec3b1faacf81b4f1ad0b111918000000000000000000000000000000000000000000000000000000000000000d436861696e656420486f7273650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024348000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : tokenName (string): Chained Horse
Arg [1] : tokenSymbol (string): CH
Arg [2] : _maxTokens (uint256): 10000
Arg [3] : _utilityContract (address): 0x610b9Dc17a6e457AF9Be6CD8d7956E12A4a596C3
Arg [4] : mintedByOnOldContract (address): 0xB2815298Bb6F8ceC3b1faacF81b4f1AD0B111918

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [3] : 000000000000000000000000610b9dc17a6e457af9be6cd8d7956e12a4a596c3
Arg [4] : 000000000000000000000000b2815298bb6f8cec3b1faacf81b4f1ad0b111918
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000d
Arg [6] : 436861696e656420486f72736500000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [8] : 4348000000000000000000000000000000000000000000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.