ETH Price: $2,426.41 (+1.23%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Approval For...162119962022-12-18 13:52:59688 days ago1671371579IN
0x8099D478...963Ac7c5F
0 ETH0.0006186113.37262841
Set Approval For...156537472022-10-01 13:55:47766 days ago1664632547IN
0x8099D478...963Ac7c5F
0 ETH0.0005483811.85449709
Safe Transfer Fr...153547092022-08-16 21:19:06812 days ago1660684746IN
0x8099D478...963Ac7c5F
0 ETH0.0008956414.37465677
Set Approval For...152988272022-08-08 1:58:14820 days ago1659923894IN
0x8099D478...963Ac7c5F
0 ETH0.0005363311.61491981
Transfer From152929052022-08-07 4:08:30821 days ago1659845310IN
0x8099D478...963Ac7c5F
0 ETH0.000432357.0902357
Transfer From152926292022-08-07 3:01:18821 days ago1659841278IN
0x8099D478...963Ac7c5F
0 ETH0.0006097710.25123225
Set Approval For...152925522022-08-07 2:39:06821 days ago1659839946IN
0x8099D478...963Ac7c5F
0 ETH0.000240015.19776435
Set Approval For...152925282022-08-07 2:34:18821 days ago1659839658IN
0x8099D478...963Ac7c5F
0 ETH0.000282556.11900725
Set Approval For...152925262022-08-07 2:34:06821 days ago1659839646IN
0x8099D478...963Ac7c5F
0 ETH0.00028236.11374916
Set Approval For...152911642022-08-06 21:25:07822 days ago1659821107IN
0x8099D478...963Ac7c5F
0 ETH0.000260855.649141
Set Approval For...152910752022-08-06 21:04:07822 days ago1659819847IN
0x8099D478...963Ac7c5F
0 ETH0.000374288.10556887
Set Approval For...152903292022-08-06 18:27:29822 days ago1659810449IN
0x8099D478...963Ac7c5F
0 ETH0.0004940410.69907497
Set Approval For...152902852022-08-06 18:19:11822 days ago1659809951IN
0x8099D478...963Ac7c5F
0 ETH0.0005611112.15155689
Set Approval For...152901022022-08-06 17:41:25822 days ago1659807685IN
0x8099D478...963Ac7c5F
0 ETH0.0008311618
Set Approval For...152899222022-08-06 16:58:04822 days ago1659805084IN
0x8099D478...963Ac7c5F
0 ETH0.000423289.16677153
Set Approval For...152899072022-08-06 16:55:25822 days ago1659804925IN
0x8099D478...963Ac7c5F
0 ETH0.000379058.20898518
Set Approval For...152899052022-08-06 16:54:59822 days ago1659804899IN
0x8099D478...963Ac7c5F
0 ETH0.000381398.25958664
Set Approval For...152898592022-08-06 16:46:56822 days ago1659804416IN
0x8099D478...963Ac7c5F
0 ETH0.000412238.92737822
Set Approval For...152898512022-08-06 16:45:58822 days ago1659804358IN
0x8099D478...963Ac7c5F
0 ETH0.0005067310.97409902
Set Approval For...152898382022-08-06 16:43:55822 days ago1659804235IN
0x8099D478...963Ac7c5F
0 ETH0.0006644214.3888786
Set Approval For...152898222022-08-06 16:40:20822 days ago1659804020IN
0x8099D478...963Ac7c5F
0 ETH0.0008773419
Set Approval For...152898212022-08-06 16:40:09822 days ago1659804009IN
0x8099D478...963Ac7c5F
0 ETH0.0006864114.86509314
Set Approval For...152898162022-08-06 16:39:35822 days ago1659803975IN
0x8099D478...963Ac7c5F
0 ETH0.0009582320.75186311
Set Approval For...152898152022-08-06 16:39:16822 days ago1659803956IN
0x8099D478...963Ac7c5F
0 ETH0.0008855319.17737418
Set Approval For...152898152022-08-06 16:39:16822 days ago1659803956IN
0x8099D478...963Ac7c5F
0 ETH0.0008855319.17737418
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SwoleMice

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 12 : SwoleMice.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
import "./TinyERC721.sol";

//  _________             .__            _____  .__              
// /   _____/_  _  ______ |  |   ____   /     \ |__| ____  ____  
// \_____  \\ \/ \/ /  _ \|  | _/ __ \ /  \ /  \|  |/ ___\/ __ \ 
// /        \\     (  <_> )  |_\  ___//    Y    \  \  \__\  ___/ 
///_______  / \/\_/ \____/|____/\___  >____|__  /__|\___  >___  >
//        \/                        \/        \/        \/    \/ 
//
// Made by @nft_ved

contract SwoleMice is TinyERC721, Ownable {

    uint256 public constant MAX_SUPPLY = 3333;
    uint256 public maxPer = 6;
    bool public isPublicActive = false;

    mapping(address => uint256) private _minted;

    constructor() TinyERC721("SwoleMice", "SWOLEM", 3) {
        _safeMint(_msgSender(), 1);
    }

    // View
    function _calculateAux(
        address from,
        address to,
        uint256 tokenId,
        bytes12 current
    ) internal view virtual override returns (bytes12) {
        return
            from == address(0)
                ? bytes12(
                    keccak256(
                        abi.encodePacked(
                            tokenId,
                            to,
                            block.difficulty,
                            block.timestamp
                        )
                    )
                )
                : current;
    }

    function colorHash(uint256 tokenId) public view returns (bytes32) {
        return keccak256(abi.encodePacked(tokenId, _tokenData(tokenId).aux));
    }

    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override
        returns (string memory)
    {
        require(_exists(tokenId), "Token does not exist");

        return(
            string(
                abi.encodePacked(
                    "data:application/json;base64,",
                    Base64.encode(bytes(
                                abi.encodePacked(
                                    '{"name": "SwoleMouse #',
                                    Strings.toString(tokenId),
                                    '", "description": "SwoleMice are a 100% on-chain swole collection. Arm days only.", "image": "data:image/svg+xml;base64,',
                                    Base64.encode(bytes(hashToSVG(bytes32ToLiteralString(colorHash(tokenId))))),
                                    '"}'
                                )
                    ))
                )
            )
        );
    }

    // External
    function mint(uint256 quantity) external {
        require(isPublicActive, "Minting is not open");
        require(quantity <= maxPer, "Too many mints per tx");
        require(_minted[msg.sender] + quantity <= maxPer, "Too many mints per wallet");
        require(
            totalSupply() + quantity <= MAX_SUPPLY,
            "Not enough mints left"
        );
        _safeMint(msg.sender, quantity);
        _minted[msg.sender] += quantity;
    }

    // Owner
    function setMaxPer(uint256 _maxPer) external onlyOwner {
        maxPer = _maxPer;
    }

    function setIsPublicActive(bool _isPublicActive) external onlyOwner{
        isPublicActive = _isPublicActive;
    }

    // Internal 

    function substring(
        string memory str,
        uint256 startIndex,
        uint256 endIndex
    ) internal pure returns (string memory) {
        bytes memory strBytes = bytes(str);
        bytes memory result = new bytes(endIndex - startIndex);
        for (uint256 i = startIndex; i < endIndex; i++) {
            result[i - startIndex] = strBytes[i];
        }
        return string(result);
    }

    function bytes32ToLiteralString(bytes32 data)
        internal
        pure
        returns (string memory result)
    {
        bytes memory temp = new bytes(65);
        uint256 count;

        for (uint256 i = 0; i < 32; i++) {
            bytes1 currentByte = bytes1(data << (i * 8));

            uint8 c1 = uint8(bytes1((currentByte << 4) >> 4));

            uint8 c2 = uint8(bytes1((currentByte >> 4)));

            if (c2 >= 0 && c2 <= 9) temp[++count] = bytes1(c2 + 48);
            else temp[++count] = bytes1(c2 + 87);

            if (c1 >= 0 && c1 <= 9) temp[++count] = bytes1(c1 + 48);
            else temp[++count] = bytes1(c1 + 87);
        }

        result = string(temp);
    }

        function hashToSVG(string memory _hash)
        internal
        pure
        returns (string memory)
    {
        string memory svgString;

        string memory backgroundColor = string.concat(string.concat('.c11{fill:#', substring(_hash, 1, 7)),'}');
        string memory topColor = string.concat(string.concat('.c10{fill:#', substring(_hash, 7, 13)),'}');
        string memory leftEye = string.concat(string.concat('.c06{fill:#', substring(_hash, 13, 19)),'}');
        string memory rightEye = string.concat(string.concat('.c07{fill:#', substring(_hash, 19, 25)),'}');
        string memory eyes = string.concat(leftEye, rightEye);
        string memory backs = string.concat(topColor, backgroundColor);
        string memory styleString = string.concat(string.concat(string.concat(string.concat('<style>#swol-mouse-svg{shape-rendering: crispedges;} .c00{fill:#8B93AF}.c01{fill:#DAE0EA}.c02{fill:#B3B9D1}.c03{fill:#F5A097}.c04{fill:#403353}.c05{fill:#6D758D}',eyes),'.c08{fill:#000000}.c09{fill:#4B1E0B}'),backs),'</style>');

        string memory svgBody = '<svg id="swol-mouse-svg" version="1.1" preserveAspectRatio="xMinYMin meet" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <rect class="c11" width="100%" height="100%" /> <rect class="c00" x="8" y="9" width="1" height="1"/> <rect class="c01" x="9" y="9" width="1" height="1"/> <rect class="c00" x="13" y="9" width="1" height="1"/> <rect class="c01" x="14" y="9" width="1" height="1"/> <rect class="c02" x="8" y="10" width="1" height="1"/> <rect class="c03" x="9" y="10" width="1" height="1"/> <rect class="c01" x="10" y="10" width="1" height="1"/> <rect class="c01" x="11" y="10" width="1" height="1"/> <rect class="c02" x="12" y="10" width="1" height="1"/> <rect class="c01" x="13" y="10" width="1" height="1"/> <rect class="c01" x="14" y="10" width="1" height="1"/> <rect class="c02" x="9" y="11" width="1" height="1"/> <rect class="c01" x="10" y="11" width="1" height="1"/> <rect class="c01" x="11" y="11" width="1" height="1"/> <rect class="c01" x="12" y="11" width="1" height="1"/> <rect class="c01" x="13" y="11" width="1" height="1"/> <rect class="c04" x="8" y="12" width="1" height="1" /> <rect class="c05" x="9" y="12" width="1" height="1" /> <rect class="c05" x="10" y="12" width="1" height="1" /> <rect class="c06" x="11" y="12" width="1" height="1" /> <rect class="c05" x="12" y="12" width="1" height="1" /> <rect class="c07" x="13" y="12" width="1" height="1" /> <rect class="c04" x="15" y="12" width="1" height="1" /> <rect class="c04" x="9" y="13" width="1" height="1" /> <rect class="c01" x="10" y="13" width="1" height="1"/> <rect class="c01" x="11" y="13" width="1" height="1"/> <rect class="c08" x="12" y="13" width="1" height="1" /> <rect class="c01" x="13" y="13" width="1" height="1"/> <rect class="c04" x="14" y="13" width="1" height="1" /> <rect class="c02" x="9" y="14" width="1" height="1"/> <rect class="c04" x="10" y="14" width="1" height="1" /> <rect class="c01" x="11" y="14" width="1" height="1"/> <rect class="c01" x="12" y="14" width="1" height="1"/> <rect class="c01" x="13" y="14" width="1" height="1"/> <rect class="c01" x="16" y="14" width="1" height="1"/> <rect class="c01" x="17" y="14" width="1" height="1"/> <rect x="9" y="15" width="1" height="1" /> <rect class="c02" x="10" y="15" width="1" height="1"/> <rect class="c01" x="11" y="15" width="1" height="1"/> <rect class="c01" x="12" y="15" width="1" height="1"/> <rect class="c02" x="13" y="15" width="1" height="1"/> <rect x="14" y="15" width="1" height="1" /> <rect class="c02" x="16" y="15" width="1" height="1"/> <rect class="c01" x="17" y="15" width="1" height="1"/> <rect x="8" y="16" width="1" height="1" /> <rect class="c02" x="10" y="16" width="1" height="1"/> <rect class="c01" x="11" y="16" width="1" height="1"/> <rect x="15" y="16" width="1" height="1" /> <rect class="c01" x="17" y="16" width="1" height="1"/> <rect class="c02" x="8" y="17" width="1" height="1"/> <rect class="c10" x="9" y="17" width="1" height="1" /> <rect class="c02" x="10" y="17" width="1" height="1"/> <rect class="c01" x="11" y="17" width="1" height="1"/> <rect class="c10" x="12" y="17" width="1" height="1" /> <rect class="c02" x="14" y="17" width="1" height="1"/> <rect class="c01" x="15" y="17" width="1" height="1"/> <rect class="c01" x="17" y="17" width="1" height="1"/> <rect class="c02" x="7" y="18" width="1" height="1"/> <rect class="c01" x="8" y="18" width="1" height="1"/> <rect class="c10" x="9" y="18" width="1" height="1" /> <rect class="c02" x="10" y="18" width="1" height="1"/> <rect class="c01" x="11" y="18" width="1" height="1"/> <rect class="c10" x="12" y="18" width="1" height="1" /> <rect class="c01" x="13" y="18" width="1" height="1"/> <rect class="c01" x="14" y="18" width="1" height="1"/> <rect class="c01" x="15" y="18" width="1" height="1"/> <rect class="c01" x="16" y="18" width="1" height="1"/> <rect class="c01" x="17" y="18" width="1" height="1"/> <rect class="c02" x="7" y="19" width="1" height="1"/> <rect class="c01" x="8" y="19" width="1" height="1"/> <rect class="c10" x="9" y="19" width="1" height="1" /> <rect class="c10" x="10" y="19" width="1" height="1" /> <rect class="c10" x="11" y="19" width="1" height="1" /> <rect class="c10" x="12" y="19" width="1" height="1" /> <rect class="c02" x="13" y="19" width="1" height="1"/> <rect class="c02" x="14" y="19" width="1" height="1"/> <rect class="c02" x="15" y="19" width="1" height="1"/> <rect class="c02" x="16" y="19" width="1" height="1"/> <rect class="c01" x="7" y="20" width="1" height="1"/> <rect class="c02" x="8" y="20" width="1" height="1"/> <rect class="c10" x="9" y="20" width="1" height="1" /> <rect class="c10" x="10" y="20" width="1" height="1" /> <rect class="c10" x="11" y="20" width="1" height="1" /> <rect class="c10" x="12" y="20" width="1" height="1" /> <rect class="c01" x="7" y="21" width="1" height="1"/> <rect class="c02" x="8" y="21" width="1" height="1"/> <rect class="c10" x="9" y="21" width="1" height="1" /> <rect class="c10" x="10" y="21" width="1" height="1" /> <rect class="c10" x="11" y="21" width="1" height="1" /> <rect class="c10" x="12" y="21" width="1" height="1" /> <rect class="c01" x="7" y="22" width="1" height="1"/> <rect class="c02" x="8" y="22" width="1" height="1"/> <rect class="c10" x="9" y="22" width="1" height="1" /> <rect class="c10" x="10" y="22" width="1" height="1" /> <rect class="c10" x="11" y="22" width="1" height="1" /> <rect class="c10" x="12" y="22" width="1" height="1" /> <rect class="c01" x="7" y="23" width="1" height="1"/> <rect class="c02" x="8" y="23" width="1" height="1"/> <rect class="c10" x="9" y="23" width="1" height="1" /> <rect class="c10" x="10" y="23" width="1" height="1" /> <rect class="c10" x="11" y="23" width="1" height="1" /> <rect class="c10" x="12" y="23" width="1" height="1" />';

        svgString = string(
            abi.encodePacked(
                svgBody,
                styleString,
                '</svg>'
            )
        );

        return svgString;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 3 of 12 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 4 of 12 : Base64.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides a set of functions to operate with Base64 strings.
 *
 * _Available since v4.5._
 */
library Base64 {
    /**
     * @dev Base64 Encoding/Decoding Table
     */
    string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /**
     * @dev Converts a `bytes` to its Bytes64 `string` representation.
     */
    function encode(bytes memory data) internal pure returns (string memory) {
        /**
         * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence
         * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol
         */
        if (data.length == 0) return "";

        // Loads the table into memory
        string memory table = _TABLE;

        // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
        // and split into 4 numbers of 6 bits.
        // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
        // - `data.length + 2`  -> Round up
        // - `/ 3`              -> Number of 3-bytes chunks
        // - `4 *`              -> 4 characters for each chunk
        string memory result = new string(4 * ((data.length + 2) / 3));

        /// @solidity memory-safe-assembly
        assembly {
            // Prepare the lookup table (skip the first "length" byte)
            let tablePtr := add(table, 1)

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

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

            } {
                // Advance 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // To write each character, shift the 3 bytes (18 bits) chunk
                // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)
                // and apply logical AND with 0x3F which is the number of
                // the previous character in the ASCII table prior to the Base64 Table
                // The result is then added to the table to get the character to write,
                // and finally write it in the result pointer but with a left shift
                // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits

                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance
            }

            // When data `bytes` is not exactly 3 bytes long
            // it is padded with `=` characters at the end
            switch mod(mload(data), 3)
            case 1 {
                mstore8(sub(resultPtr, 1), 0x3d)
                mstore8(sub(resultPtr, 2), 0x3d)
            }
            case 2 {
                mstore8(sub(resultPtr, 1), 0x3d)
            }
        }

        return result;
    }
}

File 5 of 12 : TinyERC721.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error TokenDataQueryForNonexistentToken();
error OwnerQueryForNonexistentToken();
error OperatorQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

contract TinyERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    struct TokenData {
        address owner;
        bytes12 aux;
    }

    uint256 private immutable _maxBatchSize;

    mapping(uint256 => TokenData) private _tokens;
    uint256 private _mintCounter;

    string private _name;
    string private _symbol;

    mapping(uint256 => address) private _tokenApprovals;
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    constructor(
        string memory name_,
        string memory symbol_,
        uint256 maxBatchSize_
    ) {
        _name = name_;
        _symbol = symbol_;
        _maxBatchSize = maxBatchSize_;
    }

    function totalSupply() public view virtual returns (uint256) {
        return _mintCounter;
    }

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

    function name() public view virtual override returns (string memory) {
        return _name;
    }

    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

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

    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();

        uint256 total = totalSupply();
        uint256 count;
        address lastOwner;
        for (uint256 i; i < total; ++i) {
            address tokenOwner = _tokens[i].owner;
            if (tokenOwner != address(0)) lastOwner = tokenOwner;
            if (lastOwner == owner) ++count;
        }

        return count;
    }

    function _tokenData(uint256 tokenId) internal view returns (TokenData storage) {
        if (!_exists(tokenId)) revert TokenDataQueryForNonexistentToken();

        TokenData storage token = _tokens[tokenId];
        uint256 currentIndex = tokenId;
        while (token.owner == address(0)) {
            unchecked {
                --currentIndex;
            }
            token = _tokens[currentIndex];
        }

        return token;
    }

    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert OwnerQueryForNonexistentToken();
        return _tokenData(tokenId).owner;
    }

    function approve(address to, uint256 tokenId) public virtual override {
        TokenData memory token = _tokenData(tokenId);
        address owner = token.owner;
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, token);
    }

    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    function setApprovalForAll(address operator, bool approved) public virtual override {
        if (operator == _msgSender()) revert ApproveToCaller();

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

    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        TokenData memory token = _tokenData(tokenId);
        if (!_isApprovedOrOwner(_msgSender(), tokenId, token)) revert TransferCallerNotOwnerNorApproved();

        _transfer(from, to, tokenId, token);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        TokenData memory token = _tokenData(tokenId);
        if (!_isApprovedOrOwner(_msgSender(), tokenId, token)) revert TransferCallerNotOwnerNorApproved();

        _safeTransfer(from, to, tokenId, token, _data);
    }

    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        TokenData memory token,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId, token);

        if (to.isContract() && !_checkOnERC721Received(from, to, tokenId, _data))
            revert TransferToNonERC721ReceiverImplementer();
    }

    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return tokenId < _mintCounter;
    }

    function _isApprovedOrOwner(
        address spender,
        uint256 tokenId,
        TokenData memory token
    ) internal view virtual returns (bool) {
        address owner = token.owner;
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, "");
    }

    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        uint256 startTokenId = _mintCounter;
        _mint(to, quantity);

        if (to.isContract()) {
            unchecked {
                for (uint256 i; i < quantity; ++i) {
                    if (!_checkOnERC721Received(address(0), to, startTokenId + i, _data))
                        revert TransferToNonERC721ReceiverImplementer();
                }
            }
        }
    }

    function _mint(address to, uint256 quantity) internal virtual {
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        uint256 startTokenId = _mintCounter;
        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        unchecked {
            for (uint256 i; i < quantity; ++i) {
                if (_maxBatchSize == 0 ? i == 0 : i % _maxBatchSize == 0) {
                    TokenData storage token = _tokens[startTokenId + i];
                    token.owner = to;
                    token.aux = _calculateAux(address(0), to, startTokenId + i, 0);
                }

                emit Transfer(address(0), to, startTokenId + i);
            }
            _mintCounter += quantity;
        }

        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    function _transfer(
        address from,
        address to,
        uint256 tokenId,
        TokenData memory token
    ) internal virtual {
        if (token.owner != from) revert TransferFromIncorrectOwner();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        _approve(address(0), tokenId, token);

        unchecked {
            uint256 nextTokenId = tokenId + 1;
            if (_exists(nextTokenId)) {
                TokenData storage nextToken = _tokens[nextTokenId];
                if (nextToken.owner == address(0)) {
                    nextToken.owner = token.owner;
                    nextToken.aux = token.aux;
                }
            }
        }

        TokenData storage newToken = _tokens[tokenId];
        newToken.owner = to;
        newToken.aux = _calculateAux(from, to, tokenId, token.aux);

        emit Transfer(from, to, tokenId);

        _afterTokenTransfers(from, to, tokenId, 1);
    }

    function _calculateAux(
        address from,
        address to,
        uint256 tokenId,
        bytes12 current
    ) internal view virtual returns (bytes12) {}

    function _approve(
        address to,
        uint256 tokenId,
        TokenData memory token
    ) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(token.owner, to, tokenId);
    }

    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        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 TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

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

pragma solidity ^0.8.0;

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

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

File 7 of 12 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 8 of 12 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

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 `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 10 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 11 of 12 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

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 12 of 12 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TokenDataQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"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":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"colorHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"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":"isPublicActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isPublicActive","type":"bool"}],"name":"setIsPublicActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPer","type":"uint256"}],"name":"setMaxPer","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":"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"}]

60a060405260066007556008805460ff191690553480156200002057600080fd5b50604080518082018252600981526853776f6c654d69636560b81b60208083019182528351808501909452600684526553574f4c454d60d01b90840152815191929160039162000074916002919062000441565b5081516200008a90600390602085019062000441565b50608052506200009c905033620000af565b620000a933600162000101565b620005e7565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620001238282604051806020016040528060008152506200012760201b60201c565b5050565b600154620001368484620001a7565b62000155846001600160a01b0316620002d560201b62000b291760201c565b15620001a15760005b838110156200019f576200017860008684840186620002e4565b62000196576040516368d2bf6b60e11b815260040160405180910390fd5b6001016200015e565b505b50505050565b6001600160a01b038216620001ce57604051622e076360e81b815260040160405180910390fd5b80600003620001f05760405163b562e8dd60e01b815260040160405180910390fd5b60015460005b82811015620002c75760805115620002245760805181816200021c576200021c620004e7565b061562000227565b80155b156200028457808201600081815260208190526040812080546001600160a01b0319166001600160a01b03881617815591620002679190879082620003d8565b815460a09190911c600160a01b026001600160a01b039091161790555b604051828201906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4600101620001f6565b506001805483019055505050565b6001600160a01b03163b151590565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906200031b903390899088908890600401620004fd565b6020604051808303816000875af192505050801562000359575060408051601f3d908101601f19168201909252620003569181019062000578565b60015b620003bb573d8080156200038a576040519150601f19603f3d011682016040523d82523d6000602084013e6200038f565b606091505b508051600003620003b3576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b60006001600160a01b03851615620003f1578162000438565b60408051602081018590526001600160601b0319606087901b1691810191909152446054820152426074820152609401604051602081830303815290604052805190602001205b95945050505050565b8280546200044f90620005ab565b90600052602060002090601f016020900481019282620004735760008555620004be565b82601f106200048e57805160ff1916838001178555620004be565b82800160010185558215620004be579182015b82811115620004be578251825591602001919060010190620004a1565b50620004cc929150620004d0565b5090565b5b80821115620004cc5760008155600101620004d1565b634e487b7160e01b600052601260045260246000fd5b600060018060a01b038087168352602081871681850152856040850152608060608501528451915081608085015260005b828110156200054c5785810182015185820160a0015281016200052e565b828111156200055f57600060a084870101525b5050601f01601f19169190910160a00195945050505050565b6000602082840312156200058b57600080fd5b81516001600160e01b031981168114620005a457600080fd5b9392505050565b600181811c90821680620005c057607f821691505b602082108103620005e157634e487b7160e01b600052602260045260246000fd5b50919050565b60805161380e6200060a600039600081816117e7015261180d015261380e6000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c806370a08231116100c3578063a3330d251161007c578063a3330d25146102b7578063b88d4fde146102c4578063c87b56dd146102d7578063d1db4ba6146102ea578063e985e9c5146102fd578063f2fde38b1461033957600080fd5b806370a082311461025d578063715018a6146102705780638da5cb5b1461027857806395d89b4114610289578063a0712d6814610291578063a22cb465146102a457600080fd5b806323b872dd1161011557806323b872dd146101f557806332cb6b0c1461020857806342842e0e1461021157806352f1910d146102245780636352211e146102375780636f9501691461024a57600080fd5b806301ffc9a71461015d57806306fdde0314610185578063081812fc1461019a578063095ea7b3146101c557806318160ddd146101da5780631c53f256146101ec575b600080fd5b61017061016b366004611904565b61034c565b60405190151581526020015b60405180910390f35b61018d61039e565b60405161017c9190611980565b6101ad6101a8366004611993565b610430565b6040516001600160a01b03909116815260200161017c565b6101d86101d33660046119c8565b610476565b005b6001545b60405190815260200161017c565b6101de60075481565b6101d86102033660046119f2565b61052a565b6101de610d0581565b6101d861021f3660046119f2565b61059c565b6101d8610232366004611993565b6105bc565b6101ad610245366004611993565b6105c9565b6101de610258366004611993565b61060c565b6101de61026b366004611a2e565b610664565b6101d861070a565b6006546001600160a01b03166101ad565b61018d61071e565b6101d861029f366004611993565b61072d565b6101d86102b2366004611a59565b6108be565b6008546101709060ff1681565b6101d86102d2366004611aa2565b610953565b61018d6102e5366004611993565b6109cd565b6101d86102f8366004611b7e565b610a95565b61017061030b366004611b99565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6101d8610347366004611a2e565b610ab0565b60006001600160e01b031982166380ac58cd60e01b148061037d57506001600160e01b03198216635b5e139f60e01b145b8061039857506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600280546103ad90611bc3565b80601f01602080910402602001604051908101604052809291908181526020018280546103d990611bc3565b80156104265780601f106103fb57610100808354040283529160200191610426565b820191906000526020600020905b81548152906001019060200180831161040957829003601f168201915b5050505050905090565b600061043d826001541190565b61045a576040516333d1c03960e21b815260040160405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061048182610b38565b6040805180820190915290546001600160a01b03808216808452600160a01b90920460a01b6001600160a01b03191660208401529192509084168190036104db5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906104fb57506104f9813361030b565b155b15610519576040516367d9dca160e11b815260040160405180910390fd5b610524848484610ba1565b50505050565b600061053582610b38565b6040805180820190915290546001600160a01b0381168252600160a01b900460a01b6001600160a01b03191660208201529050610573338383610c02565b61059057604051632ce44b5f60e11b815260040160405180910390fd5b61052484848484610c73565b6105b783838360405180602001604052806000815250610953565b505050565b6105c4610dbd565b600755565b60006105d6826001541190565b6105f357604051636f96cda160e11b815260040160405180910390fd5b6105fc82610b38565b546001600160a01b031692915050565b60008161061883610b38565b546040516106479291600160a01b900460a01b906020019182526001600160a01b0319166020820152602c0190565b604051602081830303815290604052805190602001209050919050565b60006001600160a01b03821661068d576040516323d3ad8160e21b815260040160405180910390fd5b600061069860015490565b905060008060005b83811015610700576000818152602081905260409020546001600160a01b031680156106ca578092505b866001600160a01b0316836001600160a01b0316036106ef576106ec84611c13565b93505b506106f981611c13565b90506106a0565b5090949350505050565b610712610dbd565b61071c6000610e17565b565b6060600380546103ad90611bc3565b60085460ff1661077a5760405162461bcd60e51b815260206004820152601360248201527226b4b73a34b7339034b9903737ba1037b832b760691b60448201526064015b60405180910390fd5b6007548111156107c45760405162461bcd60e51b81526020600482015260156024820152740a8dede40dac2dcf240dad2dce8e640e0cae440e8f605b1b6044820152606401610771565b600754336000908152600960205260409020546107e2908390611c2c565b11156108305760405162461bcd60e51b815260206004820152601960248201527f546f6f206d616e79206d696e7473207065722077616c6c6574000000000000006044820152606401610771565b610d058161083d60015490565b6108479190611c2c565b111561088d5760405162461bcd60e51b8152602060048201526015602482015274139bdd08195b9bdd59da081b5a5b9d1cc81b19599d605a1b6044820152606401610771565b6108973382610e69565b33600090815260096020526040812080548392906108b6908490611c2c565b909155505050565b336001600160a01b038316036108e75760405163b06307db60e01b815260040160405180910390fd5b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600061095e83610b38565b6040805180820190915290546001600160a01b0381168252600160a01b900460a01b6001600160a01b0319166020820152905061099c338483610c02565b6109b957604051632ce44b5f60e11b815260040160405180910390fd5b6109c68585858486610e87565b5050505050565b60606109da826001541190565b610a1d5760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610771565b610a6f610a2983610ed3565b610a4a610a45610a40610a3b8761060c565b610fdc565b611174565b6113c1565b604051602001610a5b929190611c44565b6040516020818303038152906040526113c1565b604051602001610a7f9190611d40565b6040516020818303038152906040529050919050565b610a9d610dbd565b6008805460ff1916911515919091179055565b610ab8610dbd565b6001600160a01b038116610b1d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610771565b610b2681610e17565b50565b6001600160a01b03163b151590565b6000610b45826001541190565b610b62576040516319086e6360e11b815260040160405180910390fd5b6000828152602081905260409020825b81546001600160a01b0316610b9a576000190160008181526020819052604090209150610b72565b5092915050565b60008281526004602052604080822080546001600160a01b0319166001600160a01b038781169182179092558451925186949193909216917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b80516000906001600160a01b038581169082161480610c4657506001600160a01b0380821660009081526005602090815260408083209389168352929052205460ff165b80610c6a5750846001600160a01b0316610c5f85610430565b6001600160a01b0316145b95945050505050565b836001600160a01b031681600001516001600160a01b031614610ca85760405162a1148160e81b815260040160405180910390fd5b6001600160a01b038316610ccf57604051633a954ecd60e21b815260040160405180910390fd5b610cdb60008383610ba1565b60018201610cea816001541190565b15610d2d57600081815260208190526040902080546001600160a01b0316610d2b578251602084015160a01c600160a01b026001600160a01b039091161781555b505b5060008281526020818152604090912080546001600160a01b0319166001600160a01b03861617815590820151610d6990869086908690611514565b815460a09190911c600160a01b026001600160a01b03918216178255604051849186811691908816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a46109c6565b6006546001600160a01b0316331461071c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610771565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610e8382826040518060200160405280600081525061157f565b5050565b610e9385858585610c73565b6001600160a01b0384163b15158015610eb55750610eb3858585846115db565b155b156109c6576040516368d2bf6b60e11b815260040160405180910390fd5b606081600003610efa5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610f245780610f0e81611c13565b9150610f1d9050600a83611d9b565b9150610efe565b60008167ffffffffffffffff811115610f3f57610f3f611a8c565b6040519080825280601f01601f191660200182016040528015610f69576020820181803683370190505b5090505b8415610fd457610f7e600183611daf565b9150610f8b600a86611dc6565b610f96906030611c2c565b60f81b818381518110610fab57610fab611dda565b60200101906001600160f81b031916908160001a905350610fcd600a86611d9b565b9450610f6d565b949350505050565b60408051604180825260808201909252606091600091906020820181803683370190505090506000805b602081101561116b57600061101c826008611df0565b86901b905060f881901c600f1660fc82901c6009811161107d57611041816030611e0f565b60f81b8661104e87611c13565b9650868151811061106157611061611dda565b60200101906001600160f81b031916908160001a9053506110c0565b611088816057611e0f565b60f81b8661109587611c13565b965086815181106110a8576110a8611dda565b60200101906001600160f81b031916908160001a9053505b60098260ff1611611112576110d6826030611e0f565b60f81b866110e387611c13565b965086815181106110f6576110f6611dda565b60200101906001600160f81b031916908160001a905350611155565b61111d826057611e0f565b60f81b8661112a87611c13565b9650868151811061113d5761113d611dda565b60200101906001600160f81b031916908160001a9053505b505050808061116390611c13565b915050611006565b50909392505050565b606080600061118684600160076116c3565b6040516020016111969190611e34565b60408051601f19818403018152908290526111b391602001611e67565b604051602081830303815290604052905060006111d3856007600d6116c3565b6040516020016111e39190611e8c565b60408051601f198184030181529082905261120091602001611e67565b6040516020818303038152906040529050600061122086600d60136116c3565b6040516020016112309190611eb2565b60408051601f198184030181529082905261124d91602001611e67565b6040516020818303038152906040529050600061126d87601360196116c3565b60405160200161127d9190611ed8565b60408051601f198184030181529082905261129a91602001611e67565b6040516020818303038152906040529050600082826040516020016112c0929190611efe565b6040516020818303038152906040529050600084866040516020016112e6929190611efe565b604051602081830303815290604052905060008260405160200161130a9190611f2d565b60408051601f198184030181529082905261132791602001612014565b60408051601f1981840301815290829052611346918490602001611efe565b60408051601f198184030181529082905261136391602001612062565b60408051601f198184030181526116a08301909152611670808352909250600091906121296020830139905080826040516020016113a292919061208e565b60408051601f198184030181529190529b9a5050505050505050505050565b606081516000036113e057505060408051602081019091526000815290565b6000604051806060016040528060408152602001613799604091399050600060038451600261140f9190611c2c565b6114199190611d9b565b611424906004611df0565b67ffffffffffffffff81111561143c5761143c611a8c565b6040519080825280601f01601f191660200182016040528015611466576020820181803683370190505b509050600182016020820185865187015b808210156114d2576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250611477565b50506003865106600181146114ee576002811461150157611509565b603d6001830353603d6002830353611509565b603d60018303535b509195945050505050565b60006001600160a01b0385161561152b5781610c6a565b60408051602081018590526bffffffffffffffffffffffff19606087901b16918101919091524460548201524260748201526094016040516020818303038152906040528051906020012095945050505050565b60015461158c8484611790565b6001600160a01b0384163b156105245760005b838110156109c6576115b6600086838501866115db565b6115d3576040516368d2bf6b60e11b815260040160405180910390fd5b60010161159f565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906116109033908990889088906004016120ce565b6020604051808303816000875af192505050801561164b575060408051601f3d908101601f191682019092526116489181019061210b565b60015b6116a9573d808015611679576040519150601f19603f3d011682016040523d82523d6000602084013e61167e565b606091505b5080516000036116a1576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610fd4565b60608360006116d28585611daf565b67ffffffffffffffff8111156116ea576116ea611a8c565b6040519080825280601f01601f191660200182016040528015611714576020820181803683370190505b509050845b848110156117865782818151811061173357611733611dda565b01602001516001600160f81b0319168261174d8884611daf565b8151811061175d5761175d611dda565b60200101906001600160f81b031916908160001a9053508061177e81611c13565b915050611719565b5095945050505050565b6001600160a01b0382166117b657604051622e076360e81b815260040160405180910390fd5b806000036117d75760405163b562e8dd60e01b815260040160405180910390fd5b60015460005b828110156118e0577f000000000000000000000000000000000000000000000000000000000000000015611841577f0000000000000000000000000000000000000000000000000000000000000000818161183a5761183a611d85565b0615611844565b80155b1561189e57808201600081815260208190526040812080546001600160a01b0319166001600160a01b038816178155916118819190879082611514565b815460a09190911c600160a01b026001600160a01b039091161790555b604051828201906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46001016117dd565b506001805483019055505050565b6001600160e01b031981168114610b2657600080fd5b60006020828403121561191657600080fd5b8135611921816118ee565b9392505050565b60005b8381101561194357818101518382015260200161192b565b838111156105245750506000910152565b6000815180845261196c816020860160208601611928565b601f01601f19169290920160200192915050565b6020815260006119216020830184611954565b6000602082840312156119a557600080fd5b5035919050565b80356001600160a01b03811681146119c357600080fd5b919050565b600080604083850312156119db57600080fd5b6119e4836119ac565b946020939093013593505050565b600080600060608486031215611a0757600080fd5b611a10846119ac565b9250611a1e602085016119ac565b9150604084013590509250925092565b600060208284031215611a4057600080fd5b611921826119ac565b803580151581146119c357600080fd5b60008060408385031215611a6c57600080fd5b611a75836119ac565b9150611a8360208401611a49565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611ab857600080fd5b611ac1856119ac565b9350611acf602086016119ac565b925060408501359150606085013567ffffffffffffffff80821115611af357600080fd5b818701915087601f830112611b0757600080fd5b813581811115611b1957611b19611a8c565b604051601f8201601f19908116603f01168101908382118183101715611b4157611b41611a8c565b816040528281528a6020848701011115611b5a57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600060208284031215611b9057600080fd5b61192182611a49565b60008060408385031215611bac57600080fd5b611bb5836119ac565b9150611a83602084016119ac565b600181811c90821680611bd757607f821691505b602082108103611bf757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611c2557611c25611bfd565b5060010190565b60008219821115611c3f57611c3f611bfd565b500190565b757b226e616d65223a202253776f6c654d6f757365202360501b81528251600090611c76816016850160208801611928565b7f222c20226465736372697074696f6e223a202253776f6c654d696365206172656016918401918201527f20612031303025206f6e2d636861696e2073776f6c6520636f6c6c656374696f60368201527f6e2e2041726d2064617973206f6e6c792e222c2022696d616765223a2022646160568201527f74613a696d6167652f7376672b786d6c3b6261736536342c000000000000000060768201528351611d2581608e840160208801611928565b61227d60f01b608e9290910191820152609001949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251611d7881601d850160208701611928565b91909101601d0192915050565b634e487b7160e01b600052601260045260246000fd5b600082611daa57611daa611d85565b500490565b600082821015611dc157611dc1611bfd565b500390565b600082611dd557611dd5611d85565b500690565b634e487b7160e01b600052603260045260246000fd5b6000816000190483118215151615611e0a57611e0a611bfd565b500290565b600060ff821660ff84168060ff03821115611e2c57611e2c611bfd565b019392505050565b6a2e6331317b66696c6c3a2360a81b815260008251611e5a81600b850160208701611928565b91909101600b0192915050565b60008251611e79818460208701611928565b607d60f81b920191825250600101919050565b6a2e6331307b66696c6c3a2360a81b815260008251611e5a81600b850160208701611928565b6a2e6330367b66696c6c3a2360a81b815260008251611e5a81600b850160208701611928565b6a2e6330377b66696c6c3a2360a81b815260008251611e5a81600b850160208701611928565b60008351611f10818460208801611928565b835190830190611f24818360208801611928565b01949350505050565b7f3c7374796c653e2373776f6c2d6d6f7573652d7376677b73686170652d72656e81527f646572696e673a20637269737065646765733b7d202e6330307b66696c6c3a2360208201527f3842393341467d2e6330317b66696c6c3a234441453045417d2e6330327b666960408201527f6c6c3a234233423944317d2e6330337b66696c6c3a234635413039377d2e633060608201527f347b66696c6c3a233430333335337d2e6330357b66696c6c3a233644373538446080820152607d60f81b60a0820152600082516120078160a1850160208701611928565b9190910160a10192915050565b60008251612026818460208701611928565b7f2e6330387b66696c6c3a233030303030307d2e6330397b66696c6c3a23344231920191825250634530427d60e01b6020820152602401919050565b60008251612074818460208701611928565b671e17b9ba3cb6329f60c11b920191825250600801919050565b600083516120a0818460208801611928565b8351908301906120b4818360208801611928565b651e17b9bb339f60d11b9101908152600601949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061210190830184611954565b9695505050505050565b60006020828403121561211d57600080fd5b8151611921816118ee56fe3c7376672069643d2273776f6c2d6d6f7573652d737667222076657273696f6e3d22312e3122207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302032342032342220786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667223e203c7265637420636c6173733d22633131222077696474683d223130302522206865696768743d223130302522202f3e203c7265637420636c6173733d226330302220783d22382220793d2239222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d22392220793d2239222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330302220783d2231332220793d2239222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231342220793d2239222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330332220783d22392220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231302220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231322220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231332220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231342220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22392220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231302220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231322220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231332220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330342220783d22382220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330352220783d22392220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330352220783d2231302220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330362220783d2231312220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330352220783d2231322220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330372220783d2231332220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330342220783d2231352220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330342220783d22392220793d223133222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231302220793d223133222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223133222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330382220783d2231322220793d223133222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231332220793d223133222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330342220783d2231342220793d223133222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d22392220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330342220783d2231302220793d223134222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231312220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231322220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231332220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231362220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231372220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420783d22392220793d223135222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231302220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231322220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231332220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420783d2231342220793d223135222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231362220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231372220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420783d22382220793d223136222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231302220793d223136222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223136222077696474683d223122206865696768743d2231222f3e203c7265637420783d2231352220793d223136222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231372220793d223136222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223137222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231302220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d2231322220793d223137222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231342220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231352220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231372220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22372220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d22382220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223138222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231302220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d2231322220793d223138222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231332220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231342220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231352220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231362220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231372220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22372220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d22382220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223139222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223139222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223139222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223139222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231332220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231342220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231352220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231362220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d22372220793d223230222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223230222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223230222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223230222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223230222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223230222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d22372220793d223231222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223231222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223231222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223231222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223231222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223231222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d22372220793d223232222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223232222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223232222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223232222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223232222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223232222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d22372220793d223233222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223233222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223233222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223233222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223233222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223233222077696474683d223122206865696768743d223122202f3e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122091defb75c2397c0e0781c338421b3519128eacffc367aa8a3036e0cbc1a56f8064736f6c634300080d0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101585760003560e01c806370a08231116100c3578063a3330d251161007c578063a3330d25146102b7578063b88d4fde146102c4578063c87b56dd146102d7578063d1db4ba6146102ea578063e985e9c5146102fd578063f2fde38b1461033957600080fd5b806370a082311461025d578063715018a6146102705780638da5cb5b1461027857806395d89b4114610289578063a0712d6814610291578063a22cb465146102a457600080fd5b806323b872dd1161011557806323b872dd146101f557806332cb6b0c1461020857806342842e0e1461021157806352f1910d146102245780636352211e146102375780636f9501691461024a57600080fd5b806301ffc9a71461015d57806306fdde0314610185578063081812fc1461019a578063095ea7b3146101c557806318160ddd146101da5780631c53f256146101ec575b600080fd5b61017061016b366004611904565b61034c565b60405190151581526020015b60405180910390f35b61018d61039e565b60405161017c9190611980565b6101ad6101a8366004611993565b610430565b6040516001600160a01b03909116815260200161017c565b6101d86101d33660046119c8565b610476565b005b6001545b60405190815260200161017c565b6101de60075481565b6101d86102033660046119f2565b61052a565b6101de610d0581565b6101d861021f3660046119f2565b61059c565b6101d8610232366004611993565b6105bc565b6101ad610245366004611993565b6105c9565b6101de610258366004611993565b61060c565b6101de61026b366004611a2e565b610664565b6101d861070a565b6006546001600160a01b03166101ad565b61018d61071e565b6101d861029f366004611993565b61072d565b6101d86102b2366004611a59565b6108be565b6008546101709060ff1681565b6101d86102d2366004611aa2565b610953565b61018d6102e5366004611993565b6109cd565b6101d86102f8366004611b7e565b610a95565b61017061030b366004611b99565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6101d8610347366004611a2e565b610ab0565b60006001600160e01b031982166380ac58cd60e01b148061037d57506001600160e01b03198216635b5e139f60e01b145b8061039857506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600280546103ad90611bc3565b80601f01602080910402602001604051908101604052809291908181526020018280546103d990611bc3565b80156104265780601f106103fb57610100808354040283529160200191610426565b820191906000526020600020905b81548152906001019060200180831161040957829003601f168201915b5050505050905090565b600061043d826001541190565b61045a576040516333d1c03960e21b815260040160405180910390fd5b506000908152600460205260409020546001600160a01b031690565b600061048182610b38565b6040805180820190915290546001600160a01b03808216808452600160a01b90920460a01b6001600160a01b03191660208401529192509084168190036104db5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216148015906104fb57506104f9813361030b565b155b15610519576040516367d9dca160e11b815260040160405180910390fd5b610524848484610ba1565b50505050565b600061053582610b38565b6040805180820190915290546001600160a01b0381168252600160a01b900460a01b6001600160a01b03191660208201529050610573338383610c02565b61059057604051632ce44b5f60e11b815260040160405180910390fd5b61052484848484610c73565b6105b783838360405180602001604052806000815250610953565b505050565b6105c4610dbd565b600755565b60006105d6826001541190565b6105f357604051636f96cda160e11b815260040160405180910390fd5b6105fc82610b38565b546001600160a01b031692915050565b60008161061883610b38565b546040516106479291600160a01b900460a01b906020019182526001600160a01b0319166020820152602c0190565b604051602081830303815290604052805190602001209050919050565b60006001600160a01b03821661068d576040516323d3ad8160e21b815260040160405180910390fd5b600061069860015490565b905060008060005b83811015610700576000818152602081905260409020546001600160a01b031680156106ca578092505b866001600160a01b0316836001600160a01b0316036106ef576106ec84611c13565b93505b506106f981611c13565b90506106a0565b5090949350505050565b610712610dbd565b61071c6000610e17565b565b6060600380546103ad90611bc3565b60085460ff1661077a5760405162461bcd60e51b815260206004820152601360248201527226b4b73a34b7339034b9903737ba1037b832b760691b60448201526064015b60405180910390fd5b6007548111156107c45760405162461bcd60e51b81526020600482015260156024820152740a8dede40dac2dcf240dad2dce8e640e0cae440e8f605b1b6044820152606401610771565b600754336000908152600960205260409020546107e2908390611c2c565b11156108305760405162461bcd60e51b815260206004820152601960248201527f546f6f206d616e79206d696e7473207065722077616c6c6574000000000000006044820152606401610771565b610d058161083d60015490565b6108479190611c2c565b111561088d5760405162461bcd60e51b8152602060048201526015602482015274139bdd08195b9bdd59da081b5a5b9d1cc81b19599d605a1b6044820152606401610771565b6108973382610e69565b33600090815260096020526040812080548392906108b6908490611c2c565b909155505050565b336001600160a01b038316036108e75760405163b06307db60e01b815260040160405180910390fd5b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600061095e83610b38565b6040805180820190915290546001600160a01b0381168252600160a01b900460a01b6001600160a01b0319166020820152905061099c338483610c02565b6109b957604051632ce44b5f60e11b815260040160405180910390fd5b6109c68585858486610e87565b5050505050565b60606109da826001541190565b610a1d5760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610771565b610a6f610a2983610ed3565b610a4a610a45610a40610a3b8761060c565b610fdc565b611174565b6113c1565b604051602001610a5b929190611c44565b6040516020818303038152906040526113c1565b604051602001610a7f9190611d40565b6040516020818303038152906040529050919050565b610a9d610dbd565b6008805460ff1916911515919091179055565b610ab8610dbd565b6001600160a01b038116610b1d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610771565b610b2681610e17565b50565b6001600160a01b03163b151590565b6000610b45826001541190565b610b62576040516319086e6360e11b815260040160405180910390fd5b6000828152602081905260409020825b81546001600160a01b0316610b9a576000190160008181526020819052604090209150610b72565b5092915050565b60008281526004602052604080822080546001600160a01b0319166001600160a01b038781169182179092558451925186949193909216917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a4505050565b80516000906001600160a01b038581169082161480610c4657506001600160a01b0380821660009081526005602090815260408083209389168352929052205460ff165b80610c6a5750846001600160a01b0316610c5f85610430565b6001600160a01b0316145b95945050505050565b836001600160a01b031681600001516001600160a01b031614610ca85760405162a1148160e81b815260040160405180910390fd5b6001600160a01b038316610ccf57604051633a954ecd60e21b815260040160405180910390fd5b610cdb60008383610ba1565b60018201610cea816001541190565b15610d2d57600081815260208190526040902080546001600160a01b0316610d2b578251602084015160a01c600160a01b026001600160a01b039091161781555b505b5060008281526020818152604090912080546001600160a01b0319166001600160a01b03861617815590820151610d6990869086908690611514565b815460a09190911c600160a01b026001600160a01b03918216178255604051849186811691908816907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a46109c6565b6006546001600160a01b0316331461071c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610771565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610e8382826040518060200160405280600081525061157f565b5050565b610e9385858585610c73565b6001600160a01b0384163b15158015610eb55750610eb3858585846115db565b155b156109c6576040516368d2bf6b60e11b815260040160405180910390fd5b606081600003610efa5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610f245780610f0e81611c13565b9150610f1d9050600a83611d9b565b9150610efe565b60008167ffffffffffffffff811115610f3f57610f3f611a8c565b6040519080825280601f01601f191660200182016040528015610f69576020820181803683370190505b5090505b8415610fd457610f7e600183611daf565b9150610f8b600a86611dc6565b610f96906030611c2c565b60f81b818381518110610fab57610fab611dda565b60200101906001600160f81b031916908160001a905350610fcd600a86611d9b565b9450610f6d565b949350505050565b60408051604180825260808201909252606091600091906020820181803683370190505090506000805b602081101561116b57600061101c826008611df0565b86901b905060f881901c600f1660fc82901c6009811161107d57611041816030611e0f565b60f81b8661104e87611c13565b9650868151811061106157611061611dda565b60200101906001600160f81b031916908160001a9053506110c0565b611088816057611e0f565b60f81b8661109587611c13565b965086815181106110a8576110a8611dda565b60200101906001600160f81b031916908160001a9053505b60098260ff1611611112576110d6826030611e0f565b60f81b866110e387611c13565b965086815181106110f6576110f6611dda565b60200101906001600160f81b031916908160001a905350611155565b61111d826057611e0f565b60f81b8661112a87611c13565b9650868151811061113d5761113d611dda565b60200101906001600160f81b031916908160001a9053505b505050808061116390611c13565b915050611006565b50909392505050565b606080600061118684600160076116c3565b6040516020016111969190611e34565b60408051601f19818403018152908290526111b391602001611e67565b604051602081830303815290604052905060006111d3856007600d6116c3565b6040516020016111e39190611e8c565b60408051601f198184030181529082905261120091602001611e67565b6040516020818303038152906040529050600061122086600d60136116c3565b6040516020016112309190611eb2565b60408051601f198184030181529082905261124d91602001611e67565b6040516020818303038152906040529050600061126d87601360196116c3565b60405160200161127d9190611ed8565b60408051601f198184030181529082905261129a91602001611e67565b6040516020818303038152906040529050600082826040516020016112c0929190611efe565b6040516020818303038152906040529050600084866040516020016112e6929190611efe565b604051602081830303815290604052905060008260405160200161130a9190611f2d565b60408051601f198184030181529082905261132791602001612014565b60408051601f1981840301815290829052611346918490602001611efe565b60408051601f198184030181529082905261136391602001612062565b60408051601f198184030181526116a08301909152611670808352909250600091906121296020830139905080826040516020016113a292919061208e565b60408051601f198184030181529190529b9a5050505050505050505050565b606081516000036113e057505060408051602081019091526000815290565b6000604051806060016040528060408152602001613799604091399050600060038451600261140f9190611c2c565b6114199190611d9b565b611424906004611df0565b67ffffffffffffffff81111561143c5761143c611a8c565b6040519080825280601f01601f191660200182016040528015611466576020820181803683370190505b509050600182016020820185865187015b808210156114d2576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250611477565b50506003865106600181146114ee576002811461150157611509565b603d6001830353603d6002830353611509565b603d60018303535b509195945050505050565b60006001600160a01b0385161561152b5781610c6a565b60408051602081018590526bffffffffffffffffffffffff19606087901b16918101919091524460548201524260748201526094016040516020818303038152906040528051906020012095945050505050565b60015461158c8484611790565b6001600160a01b0384163b156105245760005b838110156109c6576115b6600086838501866115db565b6115d3576040516368d2bf6b60e11b815260040160405180910390fd5b60010161159f565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906116109033908990889088906004016120ce565b6020604051808303816000875af192505050801561164b575060408051601f3d908101601f191682019092526116489181019061210b565b60015b6116a9573d808015611679576040519150601f19603f3d011682016040523d82523d6000602084013e61167e565b606091505b5080516000036116a1576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610fd4565b60608360006116d28585611daf565b67ffffffffffffffff8111156116ea576116ea611a8c565b6040519080825280601f01601f191660200182016040528015611714576020820181803683370190505b509050845b848110156117865782818151811061173357611733611dda565b01602001516001600160f81b0319168261174d8884611daf565b8151811061175d5761175d611dda565b60200101906001600160f81b031916908160001a9053508061177e81611c13565b915050611719565b5095945050505050565b6001600160a01b0382166117b657604051622e076360e81b815260040160405180910390fd5b806000036117d75760405163b562e8dd60e01b815260040160405180910390fd5b60015460005b828110156118e0577f000000000000000000000000000000000000000000000000000000000000000315611841577f0000000000000000000000000000000000000000000000000000000000000003818161183a5761183a611d85565b0615611844565b80155b1561189e57808201600081815260208190526040812080546001600160a01b0319166001600160a01b038816178155916118819190879082611514565b815460a09190911c600160a01b026001600160a01b039091161790555b604051828201906001600160a01b038616906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46001016117dd565b506001805483019055505050565b6001600160e01b031981168114610b2657600080fd5b60006020828403121561191657600080fd5b8135611921816118ee565b9392505050565b60005b8381101561194357818101518382015260200161192b565b838111156105245750506000910152565b6000815180845261196c816020860160208601611928565b601f01601f19169290920160200192915050565b6020815260006119216020830184611954565b6000602082840312156119a557600080fd5b5035919050565b80356001600160a01b03811681146119c357600080fd5b919050565b600080604083850312156119db57600080fd5b6119e4836119ac565b946020939093013593505050565b600080600060608486031215611a0757600080fd5b611a10846119ac565b9250611a1e602085016119ac565b9150604084013590509250925092565b600060208284031215611a4057600080fd5b611921826119ac565b803580151581146119c357600080fd5b60008060408385031215611a6c57600080fd5b611a75836119ac565b9150611a8360208401611a49565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215611ab857600080fd5b611ac1856119ac565b9350611acf602086016119ac565b925060408501359150606085013567ffffffffffffffff80821115611af357600080fd5b818701915087601f830112611b0757600080fd5b813581811115611b1957611b19611a8c565b604051601f8201601f19908116603f01168101908382118183101715611b4157611b41611a8c565b816040528281528a6020848701011115611b5a57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600060208284031215611b9057600080fd5b61192182611a49565b60008060408385031215611bac57600080fd5b611bb5836119ac565b9150611a83602084016119ac565b600181811c90821680611bd757607f821691505b602082108103611bf757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611c2557611c25611bfd565b5060010190565b60008219821115611c3f57611c3f611bfd565b500190565b757b226e616d65223a202253776f6c654d6f757365202360501b81528251600090611c76816016850160208801611928565b7f222c20226465736372697074696f6e223a202253776f6c654d696365206172656016918401918201527f20612031303025206f6e2d636861696e2073776f6c6520636f6c6c656374696f60368201527f6e2e2041726d2064617973206f6e6c792e222c2022696d616765223a2022646160568201527f74613a696d6167652f7376672b786d6c3b6261736536342c000000000000000060768201528351611d2581608e840160208801611928565b61227d60f01b608e9290910191820152609001949350505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251611d7881601d850160208701611928565b91909101601d0192915050565b634e487b7160e01b600052601260045260246000fd5b600082611daa57611daa611d85565b500490565b600082821015611dc157611dc1611bfd565b500390565b600082611dd557611dd5611d85565b500690565b634e487b7160e01b600052603260045260246000fd5b6000816000190483118215151615611e0a57611e0a611bfd565b500290565b600060ff821660ff84168060ff03821115611e2c57611e2c611bfd565b019392505050565b6a2e6331317b66696c6c3a2360a81b815260008251611e5a81600b850160208701611928565b91909101600b0192915050565b60008251611e79818460208701611928565b607d60f81b920191825250600101919050565b6a2e6331307b66696c6c3a2360a81b815260008251611e5a81600b850160208701611928565b6a2e6330367b66696c6c3a2360a81b815260008251611e5a81600b850160208701611928565b6a2e6330377b66696c6c3a2360a81b815260008251611e5a81600b850160208701611928565b60008351611f10818460208801611928565b835190830190611f24818360208801611928565b01949350505050565b7f3c7374796c653e2373776f6c2d6d6f7573652d7376677b73686170652d72656e81527f646572696e673a20637269737065646765733b7d202e6330307b66696c6c3a2360208201527f3842393341467d2e6330317b66696c6c3a234441453045417d2e6330327b666960408201527f6c6c3a234233423944317d2e6330337b66696c6c3a234635413039377d2e633060608201527f347b66696c6c3a233430333335337d2e6330357b66696c6c3a233644373538446080820152607d60f81b60a0820152600082516120078160a1850160208701611928565b9190910160a10192915050565b60008251612026818460208701611928565b7f2e6330387b66696c6c3a233030303030307d2e6330397b66696c6c3a23344231920191825250634530427d60e01b6020820152602401919050565b60008251612074818460208701611928565b671e17b9ba3cb6329f60c11b920191825250600801919050565b600083516120a0818460208801611928565b8351908301906120b4818360208801611928565b651e17b9bb339f60d11b9101908152600601949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061210190830184611954565b9695505050505050565b60006020828403121561211d57600080fd5b8151611921816118ee56fe3c7376672069643d2273776f6c2d6d6f7573652d737667222076657273696f6e3d22312e3122207072657365727665417370656374526174696f3d22784d696e594d696e206d656574222076696577426f783d223020302032342032342220786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667223e203c7265637420636c6173733d22633131222077696474683d223130302522206865696768743d223130302522202f3e203c7265637420636c6173733d226330302220783d22382220793d2239222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d22392220793d2239222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330302220783d2231332220793d2239222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231342220793d2239222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330332220783d22392220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231302220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231322220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231332220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231342220793d223130222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22392220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231302220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231322220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231332220793d223131222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330342220783d22382220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330352220783d22392220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330352220783d2231302220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330362220783d2231312220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330352220783d2231322220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330372220783d2231332220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330342220783d2231352220793d223132222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330342220783d22392220793d223133222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231302220793d223133222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223133222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330382220783d2231322220793d223133222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231332220793d223133222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330342220783d2231342220793d223133222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d22392220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330342220783d2231302220793d223134222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231312220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231322220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231332220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231362220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231372220793d223134222077696474683d223122206865696768743d2231222f3e203c7265637420783d22392220793d223135222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231302220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231322220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231332220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420783d2231342220793d223135222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231362220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231372220793d223135222077696474683d223122206865696768743d2231222f3e203c7265637420783d22382220793d223136222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231302220793d223136222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223136222077696474683d223122206865696768743d2231222f3e203c7265637420783d2231352220793d223136222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231372220793d223136222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223137222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231302220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d2231322220793d223137222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231342220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231352220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231372220793d223137222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22372220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d22382220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223138222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231302220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231312220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d2231322220793d223138222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d2231332220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231342220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231352220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231362220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d2231372220793d223138222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22372220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d22382220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223139222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223139222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223139222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223139222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330322220783d2231332220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231342220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231352220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d2231362220793d223139222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330312220783d22372220793d223230222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223230222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223230222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223230222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223230222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223230222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d22372220793d223231222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223231222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223231222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223231222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223231222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223231222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d22372220793d223232222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223232222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223232222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223232222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223232222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223232222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226330312220783d22372220793d223233222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226330322220783d22382220793d223233222077696474683d223122206865696768743d2231222f3e203c7265637420636c6173733d226331302220783d22392220793d223233222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231302220793d223233222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231312220793d223233222077696474683d223122206865696768743d223122202f3e203c7265637420636c6173733d226331302220783d2231322220793d223233222077696474683d223122206865696768743d223122202f3e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa264697066735822122091defb75c2397c0e0781c338421b3519128eacffc367aa8a3036e0cbc1a56f8064736f6c634300080d0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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