ETH Price: $3,348.90 (-1.34%)

Token

TwoBitBears (TBB)
 

Overview

Max Total Supply

5,000 TBB

Holders

1,732

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
ddtofla.eth
Balance
2 TBB
0xf2720886171cc174e014db3c38b449615aa574a0
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

A series of 5000 Hyper-Realistic Algorithmically Generated Crypto Collectable Bears Minted on the Ethereum Blockchain.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
TwoBitBears

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 18 : TwoBitBears.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "base64-sol/base64.sol";
import "./BearComposition.sol";
import "./IBearDetail.sol";

contract TwoBitBears is ERC721Enumerable, IBearDetail, Ownable, ReentrancyGuard {

    /*
                           #(###                                                
                          ###.,,#   ###########      ####                       
                           ## ,,##################%#* .(###                     
                             ########################,,*##                      
                           /##########################                          
                          ########@####################          * **           
                         ##############(/(######%@######        #,#,#*%         
                        #########@@#,,@  &@,,#&@@#######*      ##*,,,%#.        
                        ##########,,,,@&&&@,,,##########%      ###*,*#%#        
                        .########(,,,,,,@,,,,,,#########      #########,        
                          ########*****@@@*,***########*     ##########         
                            ,%######********(######%#%   (############          
                            %%%%%%#%############%#%%%%###############           
                        ###%%%%%%%%%%%%%%%%%%%%%%%%%%%%############             
                     #####%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%########               
                   ######%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%                    
                 #######%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#                     
               #######(%%%%%%%%%%%%************(%%%%%%%%%%%                     
             .########%%%%%%%%%%**,,,,,,,,,,,******%%%%%%%%%                    
            ##########%%%%%%%%*,,,,,,,,,,,,,,,*******%%%%%%%%                   
           (#########%%%%%%%/*,,,,,,,,,,,,,,,,,*******#%%%%%%                   
           (#########%%%%%%*,,,,,,,,,,,,,,,,,,,,*******%%%%%%#                  
           *#**%####%%%%%%%*,,,,,,,,,,,,.,,,,,,,,*******#%%%%%                  
             * **   %%%%%%*,,,,,,,,,,,......,,,,,*******%%%%%%                  
                    %%%%%%*,,,,,,,,,,,,,.,,,,,,,,*******%%%%%%                  
                    %%%%%%%*,,,,,,,,,,,,,,,,,,,,********#%%%%%                  
                     %%%%%%(**,,,,,,,,,,,,,************#%%%%%                   
                     *%%%%%%#***,,,,,,,***************%%%%%%%                   
                      %%%%%%%%%*********************%%%%%%%%                    
                       %%%%%%%%%%%#(************%%%%%%%%%%%#                    
                        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                     
                        ####%%%%%%%%%%%%%%%%%%%%%%%%%%%###                      
                         #########%%%%%%  %%%%%%#########                       
                          ############%%  %%############(                       
                           #############  (#############                        
                          ,,############,,,############,.                       
                     ,,/####(##########,,,,*########(######,,,                  
                        ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.                     
    */

    using Counters for Counters.Counter;
    using Strings for uint256;

    uint8 public constant decimals = 0;

    /// @dev Counter for token Ids
    Counters.Counter private _tokenIds;

    /// @dev Price for one bear
    uint256 public constant bearPrice = 0.05 ether;

    /// @dev Maximum bears that will be minted
    uint256 private constant _maxTokens = 5000;

    /// @dev Maximum quantity of bears that will be minted at once
    uint256 public constant maximumMintQuantity = 10;

    uint256 private _seed;
    bool private _reveal;

    // Mapping of TokenIds to generated Bear Detail
    mapping(uint256 => IBearDetail.Detail) private _tokenIdToBearDetails;

    mapping(uint256 => string) private _giftTokenURIs;

    string[4] private _species = ["Brown Bear", "Black Bear", "Polar Bear", "Panda Bear"];
    string[4] private _moods = ["Happy", "Hungry", "Sleepy", "Grumpy"];
    string[18] private _names = ["Deafbeef", "Benyamin", "Tropo", "Karkai", "Beanie", "Itzel", "Hunter", "Fvck", "GFunk", "Pak", "xCopy", "Deeze", "Robness", "Gargamel", "Cole", "Farokh", "Snofro", "Squarci"];
    string[18] private _families = ["Winkelmann", "Hirst", "Watkinson", "Hall", "Rainaud", "Sachs", "Pleasr", "Vee", "Aversano", "Furie", "Stark", "Hofmann", "Nines", "Bellini", "Aoki", "Davis", "Cherniak", "Timpers"];

    constructor() ERC721("TwoBitBears", "TBB") {
        _seed = uint256(keccak256(abi.encodePacked(msg.sender, blockhash(block.number-1), block.timestamp)));
        _reveal = false;
    }

    function createBear(uint256 quantity) public payable nonReentrant {
        require(quantity > 0 && quantity <= maximumMintQuantity, "Quantity is invalid");
        require(msg.value >= bearPrice * quantity, "Ether sent is not correct");
        require(_tokenIds.current() + quantity <= _maxTokens, "Maximum Bears exceeded");

        _seed = uint256(keccak256(abi.encodePacked(_seed >> 1, msg.sender, blockhash(block.number-1), block.timestamp)));
        for (uint256 i = 0; i < quantity; i++) {
            uint256 tokenId = _tokenIds.current();
            _safeMint(msg.sender, tokenId);
            _tokenIds.increment();
            _tokenIdToBearDetails[tokenId] = _createDetailFromRandom(_seed, tokenId);
            if (i + 1 < quantity) {
                _seed = uint256(keccak256(abi.encodePacked(_seed >> 1)));
            }
        }
    }

    /// @inheritdoc IBearDetail
    function details(uint256 tokenId) external view override returns (Detail memory detail) {
        require(_exists(tokenId) && tokenId < _maxTokens, "Nonexistent token");
        detail = _tokenIdToBearDetails[tokenId];
    }

    function giftBear(uint256 tokenId, string memory tokenUri) public onlyOwner {
        require(tokenId >= _maxTokens && tokenId < _maxTokens + 20, "Invalid gift tokenId");
        if (bytes(_giftTokenURIs[tokenId]).length == 0) {
            _safeMint(msg.sender, tokenId);
        }
        _giftTokenURIs[tokenId] = tokenUri;
    }

    function revealBears() public onlyOwner {
        _reveal = true;
    }

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

        if (bytes(_giftTokenURIs[tokenId]).length > 0) {
            return _giftTokenURIs[tokenId];
        }
        if (_reveal == false) {
            return string(abi.encodePacked(
                _baseURI(),
                Base64.encode(abi.encodePacked(
                    '{"name":"Rendering Bear #', (tokenId + 1).toString(), '...","description":"Unrevealed","image":"ipfs://QmTBgvAvbYFM5S3UK2VLCLSFiBbvAvto6hERNmQghXSENR"}'
                ))
            ));
        }

        return _tokenUriForDetail(_tokenIdToBearDetails[tokenId], tokenId);
    }

    function _tokenUriForDetail(Detail memory detail, uint256 tokenId) private view returns (string memory) {
        return string(abi.encodePacked(
            _baseURI(),
            Base64.encode(abi.encodePacked(
                '{"name":"',
                    _nameFromDetail(detail, tokenId),
                '","description":"',
                    _moods[detail.moodIndex], ' ', _species[detail.speciesIndex],
                '","attributes":[{"',
                    _attributesFromDetail(detail),
                '"}],"image":"',
                    "data:image/svg+xml;base64,", Base64.encode(BearComposition.createSvg(detail)),
                '"}'
            ))
        ));
    }

    /// @notice Send funds from sales to the team
    function withdrawAll() public payable onlyOwner {
        uint256 amount = address(this).balance;
        payable(0xB87A5d10d52c415FfE213D4a2242eD69761024B6).transfer(amount / 2);
        payable(0x6Ba003943E62BeA4D1c416E5663a5fA746749Fd6).transfer(amount / 2);
    }

    function _baseURI() internal pure virtual override returns (string memory) {
        return "data:application/json;base64,";
    }

    function _createDetailFromRandom(uint256 random, uint256 tokenId) private view returns (Detail memory) {
        bytes memory randomPieces = abi.encodePacked(random);
        uint256 increment = (tokenId % 20) + 1;
        uint256 speciesIndex = BearComposition.fourIndexFromRandom(uint8(randomPieces[9 + increment]));
        return Detail(
            block.timestamp,
            uint8(uint8(randomPieces[2 + increment]) % _names.length),
            uint8(BearComposition.fourIndexFromRandom(uint8(randomPieces[increment]))),
            uint8(uint8(randomPieces[8 + increment]) % _families.length),
            uint8(speciesIndex),
            BearComposition.colorTopFromRandom(randomPieces, 6 + increment, 3 + increment, 4 + increment, speciesIndex),
            BearComposition.colorBottomFromRandom(randomPieces, 5 + increment, 7 + increment, 1 + increment, speciesIndex)
        );
    }

    function _attributesFromDetail(Detail memory detail) private view returns (string memory) {
        return string(abi.encodePacked(
            'trait_type":"Species","value":"', _species[detail.speciesIndex],
            '"},{"trait_type":"Mood","value":"', _moods[detail.moodIndex],
            '"},{"trait_type":"Name","value":"', _names[detail.nameIndex],
            '"},{"trait_type":"Family","value":"', _families[detail.familyIndex],
            '"},{"trait_type":"Realistic Head Fur","value":"', BearComposition.svgColor(detail.topColor),
            '"},{"trait_type":"Realistic Body Fur","value":"', BearComposition.svgColor(detail.bottomColor)
        ));
    }

    function _nameFromDetail(Detail memory detail, uint256 tokenId) private view returns (string memory) {
        return string(abi.encodePacked(_names[detail.nameIndex], ' ', _families[detail.familyIndex], ' the ', _moods[detail.moodIndex], ' ', _species[detail.speciesIndex], ' #', (tokenId + 1).toString()));
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 3 of 18 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 4 of 18 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 18 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 7 of 18 : base64.sol
// SPDX-License-Identifier: MIT

/// @title Base64
/// @author Brecht Devos - <[email protected]>
/// @notice Provides a function for encoding some bytes in base64
library Base64 {
    string internal constant TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

    function encode(bytes memory data) internal pure returns (string memory) {
        if (data.length == 0) return '';
        
        // load the table into memory
        string memory table = TABLE;

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

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

        assembly {
            // set the actual output length
            mstore(result, encodedLen)
            
            // prepare the lookup table
            let tablePtr := add(table, 1)
            
            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))
            
            // result ptr, jump over length
            let resultPtr := add(result, 32)
            
            // run over the input, 3 bytes at a time
            for {} lt(dataPtr, endPtr) {}
            {
               dataPtr := add(dataPtr, 3)
               
               // read 3 bytes
               let input := mload(dataPtr)
               
               // write 4 characters
               mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F)))))
               resultPtr := add(resultPtr, 1)
               mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F)))))
               resultPtr := add(resultPtr, 1)
               mstore(resultPtr, shl(248, mload(add(tablePtr, and(shr( 6, input), 0x3F)))))
               resultPtr := add(resultPtr, 1)
               mstore(resultPtr, shl(248, mload(add(tablePtr, and(        input,  0x3F)))))
               resultPtr := add(resultPtr, 1)
            }
            
            // padding with '='
            switch mod(mload(data), 3)
            case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) }
            case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) }
        }
        
        return result;
    }
}

File 8 of 18 : BearComposition.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;

import "@openzeppelin/contracts/utils/Strings.sol";
import "./IBearDetail.sol";

/// @title BearComposition
library BearComposition {

    using Strings for uint256;

    function fourIndexFromRandom(uint8 random) internal pure returns (uint256) {
        uint8 spread = random % 100;
        if (spread >= 46) {
            return 0; // 54% is Brown/Happy
        } else if (spread >= 16) {
            return 1; // 30% is Black/Hungry
        } else if (spread >= 1) {
            return 2; // 15% is Polar/Sleepy
        }
        return 3; // 1% is Panda/Grumpy
    }

    function colorBottomFromRandom(bytes memory source, uint256 indexRed, uint256 indexGreen, uint256 indexBlue, uint256 speciesIndex) internal pure returns (IBearDetail.Color memory) {
        return randomizeColors(
            _colorBottomFloorForSpecies(speciesIndex),
            _colorBottomCeilingForSpecies(speciesIndex),
            IBearDetail.Color(uint8(source[indexRed]), uint8(source[indexGreen]), uint8(source[indexBlue]))
        );
    }

    function colorTopFromRandom(bytes memory source, uint256 indexRed, uint256 indexGreen, uint256 indexBlue, uint256 speciesIndex) internal pure returns (IBearDetail.Color memory) {
        return randomizeColors(
            _colorTopFloorForSpecies(speciesIndex),
            _colorTopCeilingForSpecies(speciesIndex),
            IBearDetail.Color(uint8(source[indexRed]), uint8(source[indexGreen]), uint8(source[indexBlue]))
        );
    }

    function _colorBottomFloorForSpecies(uint256 index) private pure returns (IBearDetail.Color memory) {
        if (index == 0) { // Brown
            return IBearDetail.Color(64, 38, 14);
        } else if (index == 1) { // Black
            return IBearDetail.Color(34, 34, 37);
        } else if (index == 2) { // Polar
            return IBearDetail.Color(177, 182, 180);
        } else { // Panda
            return IBearDetail.Color(0, 0, 0);
        }
    }

    function _colorBottomCeilingForSpecies(uint256 index) private pure returns (IBearDetail.Color memory) {
        if (index == 0) { // Brown
            return IBearDetail.Color(119, 81, 45);
        } else if (index == 1) { // Black
            return IBearDetail.Color(72, 72, 77);
        } else if (index == 2) { // Polar
            return IBearDetail.Color(223, 231, 230);
        } else { // Panda
            return IBearDetail.Color(18, 18, 19);
        }
    }

    function _colorTopFloorForSpecies(uint256 index) private pure returns (IBearDetail.Color memory) {
        if (index == 0) { // Brown
            return IBearDetail.Color(141, 93, 51);
        } else if (index == 1) { // Black
            return IBearDetail.Color(56, 56, 64);
        } else if (index == 2) { // Polar
            return IBearDetail.Color(208, 229, 226);
        } else { // Panda
            return IBearDetail.Color(221, 221, 222);
        }
    }

    function _colorTopCeilingForSpecies(uint256 index) private pure returns (IBearDetail.Color memory) {
        if (index == 0) { // Brown
            return IBearDetail.Color(193, 162, 134);
        } else if (index == 1) { // Black
            return IBearDetail.Color(87, 92, 109);
        } else if (index == 2) { // Polar
            return IBearDetail.Color(235, 240, 239);
        } else { // Panda
            return IBearDetail.Color(226, 225, 232);
        }
    }
    
    function randomizeColors(IBearDetail.Color memory floor, IBearDetail.Color memory ceiling, IBearDetail.Color memory random) private pure returns (IBearDetail.Color memory color) {
        uint256 percent = (uint256(random.red) + uint256(random.green) + uint256(random.blue)) % 100;
        color.red = floor.red + uint8(uint256(ceiling.red + (random.red % 2) - floor.red) * percent / 100);
        color.green = floor.green + uint8(uint256(ceiling.green + (random.green % 2) - floor.green) * percent / 100);
        color.blue = floor.blue + uint8(uint256(ceiling.blue + (random.blue % 2) - floor.blue) * percent / 100);
    }

    function createSvg(IBearDetail.Detail memory detail) internal pure returns (bytes memory) {
        return abi.encodePacked(
            svgOpen(1080, 1080),
            "<path id='Head' d='M405 540 L675 540 675 270 405 270 Z' fill='",
            svgColor(detail.topColor),
            "'/><path id='Torso' d='M405 810 L675 810 675 540 405 540 Z' fill='",
            svgColor(detail.bottomColor),
            "'/></svg>"
        );
    }

    function svgColor(IBearDetail.Color memory color) internal pure returns (string memory) {
        return string(abi.encodePacked("rgb(", uint256(color.red).toString(), ",", uint256(color.green).toString(), ",", uint256(color.blue).toString(), ")"));
    }
    
    function svgOpen(uint256 width, uint256 height) private pure returns (string memory) {
        return string(abi.encodePacked("<svg viewBox='0 0 ", width.toString(), " ", height.toString(), "' xmlns='http://www.w3.org/2000/svg' version='1.1'>"));
    }
}

File 9 of 18 : IBearDetail.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;

/// @title TwoBitBears NFT Detail Interface
interface IBearDetail {

    struct Color {
        uint8 red;
        uint8 green;
        uint8 blue;
    }

    struct Detail {
        uint256 timestamp;
        uint8 nameIndex;
        uint8 moodIndex;
        uint8 familyIndex;
        uint8 speciesIndex;
        Color topColor;
        Color bottomColor;
    }
    
    /// @notice Returns the details associated with a given token ID.
    /// @dev Throws if the token ID is not valid.
    /// @param tokenId The ID of the token that represents the Bear
    /// @return detail memory
    function details(uint256 tokenId) external view returns (Detail memory detail);
}

File 10 of 18 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 11 of 18 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

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

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

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

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

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

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

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

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

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

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

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

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

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

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

File 12 of 18 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

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

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

File 13 of 18 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 15 of 18 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 16 of 18 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 17 of 18 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bearPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"createBear","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"details","outputs":[{"components":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint8","name":"nameIndex","type":"uint8"},{"internalType":"uint8","name":"moodIndex","type":"uint8"},{"internalType":"uint8","name":"familyIndex","type":"uint8"},{"internalType":"uint8","name":"speciesIndex","type":"uint8"},{"components":[{"internalType":"uint8","name":"red","type":"uint8"},{"internalType":"uint8","name":"green","type":"uint8"},{"internalType":"uint8","name":"blue","type":"uint8"}],"internalType":"struct IBearDetail.Color","name":"topColor","type":"tuple"},{"components":[{"internalType":"uint8","name":"red","type":"uint8"},{"internalType":"uint8","name":"green","type":"uint8"},{"internalType":"uint8","name":"blue","type":"uint8"}],"internalType":"struct IBearDetail.Color","name":"bottomColor","type":"tuple"}],"internalType":"struct IBearDetail.Detail","name":"detail","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"tokenUri","type":"string"}],"name":"giftBear","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maximumMintQuantity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealBears","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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"payable","type":"function"}]

600a61010081815269213937bbb7102132b0b960b11b61012052608090815261014082815269213630b1b5902132b0b960b11b6101605260a052610180828152692837b630b9102132b0b960b11b6101a05260c0526102006040526101c0918252692830b73230902132b0b960b11b6101e05260e0919091526200008890601190600462000701565b506040805160c08101825260056080820190815264486170707960d81b60a083015281528151808301835260068082526548756e67727960d01b602083810191909152808401929092528351808501855281815265536c6565707960d01b818401528385015283518085019094528352654772756d707960d01b9083015260608101919091526200011e90601590600462000701565b50604080516102808101825260086102408201818152672232b0b33132b2b360c11b610260840152825282518084018452818152672132b73cb0b6b4b760c11b602082810191909152808401919091528351808501855260058082526454726f706f60d81b8284015284860191909152845180860186526006808252654b61726b616960d01b82850152606086019190915285518087018752818152654265616e696560d01b8185015260808601528551808701875282815264125d1e995b60da1b8185015260a08601528551808701875281815265243ab73a32b960d11b8185015260c0860152855180870187526004808252634676636b60e01b8286015260e087019190915286518088018852838152644746756e6b60d81b8186015261010087015286518088018852600381526250616b60e81b81860152610120870152865180880188528381526478436f707960d81b8186015261014087015286518088018852928352644465657a6560d81b8385015261016086019290925285518087018752600780825266526f626e65737360c81b82860152610180870191909152865180880188529485526711d85c99d85b595b60c21b858501526101a08601949094528551808701875291825263436f6c6560e01b828401526101c0850191909152845180860186528181526508cc2e4ded6d60d31b818401526101e08501528451808601865290815265536e6f66726f60d01b818301526102008401528351808501909452908352665371756172636960c81b908301526102208101919091526200037190601990601262000758565b506040805161028081018252600a6102408201908152692bb4b735b2b636b0b73760b11b610260830152815281518083018352600580825264121a5c9cdd60da1b602083810191909152808401929092528351808501855260098152682bb0ba35b4b739b7b760b91b81840152838501528351808501855260048082526312185b1b60e21b8285015260608501919091528451808601865260078082526614985a5b985d5960ca1b8286015260808601919091528551808701875283815264536163687360d81b8186015260a0860152855180870187526006815265283632b0b9b960d11b8186015260c086015285518087018752600381526256656560e81b8186015260e0860152855180870187526008808252674176657273616e6f60c01b828701526101008701919091528651808801885284815264467572696560d81b818701526101208701528651808801885284815264537461726b60d81b8187015261014087015286518088018852828152662437b336b0b73760c91b8187015261016087015286518088018852848152644e696e657360d81b81870152610180870152865180880188528281526642656c6c696e6960c81b818701526101a08701528651808801885292835263416f6b6960e01b838601526101c08601929092528551808701875292835264446176697360d81b838501526101e08501929092528451808601865290815267436865726e69616b60c01b81840152610200840152835180850190945283526654696d7065727360c81b90830152610220810191909152620005c590602b90601262000758565b50348015620005d357600080fd5b50604080518082018252600b81526a54776f426974426561727360a81b6020808301918252835180850190945260038452622a212160e91b90840152815191929162000622916000916200079d565b508051620006389060019060208401906200079d565b505050620006556200064f620006ab60201b60201c565b620006af565b6001600b81905533906200066a9043620008ca565b40426040516020016200068093929190620008a5565b60408051601f198184030181529190528051602090910120600d55600e805460ff191690556200092b565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b826004810192821562000746579160200282015b82811115620007465782518051620007359184916020909101906200079d565b509160200191906001019062000715565b506200075492915062000828565b5090565b826012810192821562000746579160200282015b828111156200074657825180516200078c9184916020909101906200079d565b50916020019190600101906200076c565b828054620007ab90620008ee565b90600052602060002090601f016020900481019282620007cf57600085556200081a565b82601f10620007ea57805160ff19168380011785556200081a565b828001600101855582156200081a579182015b828111156200081a578251825591602001919060010190620007fd565b506200075492915062000849565b80821115620007545760006200083f828262000860565b5060010162000828565b5b808211156200075457600081556001016200084a565b5080546200086e90620008ee565b6000825580601f10620008825750620008a2565b601f016020900490600052602060002090810190620008a2919062000849565b50565b60609390931b6001600160601b03191683526014830191909152603482015260540190565b600082821015620008e957634e487b7160e01b81526011600452602481fd5b500390565b6002810460018216806200090357607f821691505b602082108114156200092557634e487b7160e01b600052602260045260246000fd5b50919050565b613a40806200093b6000396000f3fe60806040526004361061019c5760003560e01c806370a08231116100ec578063a005ec7a1161008a578063c32ae14711610064578063c32ae1471461045f578063c87b56dd14610472578063e985e9c514610492578063f2fde38b146104b25761019c565b8063a005ec7a146103f2578063a22cb4651461041f578063b88d4fde1461043f5761019c565b80638b559191116100c65780638b559191146103935780638da5cb5b146103a8578063918c3ebc146103bd57806395d89b41146103dd5761019c565b806370a0823114610356578063715018a614610376578063853828b61461038b5761019c565b806323b872dd1161015957806342842e0e1161013357806342842e0e146102e15780634f6ccce7146103015780635d9ff0ad146103215780636352211e146103365761019c565b806323b872dd1461027f5780632f745c591461029f578063313ce567146102bf5761019c565b806301ffc9a7146101a157806306fdde03146101d7578063081812fc146101f9578063095ea7b314610226578063180c42a21461024857806318160ddd1461026a575b600080fd5b3480156101ad57600080fd5b506101c16101bc36600461296a565b6104d2565b6040516101ce9190613198565b60405180910390f35b3480156101e357600080fd5b506101ec6104ff565b6040516101ce91906131a3565b34801561020557600080fd5b506102196102143660046129a2565b610591565b6040516101ce9190613151565b34801561023257600080fd5b50610246610241366004612941565b6105dd565b005b34801561025457600080fd5b5061025d610675565b6040516101ce919061311b565b34801561027657600080fd5b5061025d61067a565b34801561028b57600080fd5b5061024661029a366004612853565b610680565b3480156102ab57600080fd5b5061025d6102ba366004612941565b6106b8565b3480156102cb57600080fd5b506102d461070a565b6040516101ce91906137f6565b3480156102ed57600080fd5b506102466102fc366004612853565b61070f565b34801561030d57600080fd5b5061025d61031c3660046129a2565b61072a565b34801561032d57600080fd5b5061025d610785565b34801561034257600080fd5b506102196103513660046129a2565b610790565b34801561036257600080fd5b5061025d610371366004612800565b6107c5565b34801561038257600080fd5b50610246610809565b610246610854565b34801561039f57600080fd5b5061024661092f565b3480156103b457600080fd5b5061021961097d565b3480156103c957600080fd5b506102466103d83660046129ba565b61098c565b3480156103e957600080fd5b506101ec610a4e565b3480156103fe57600080fd5b5061041261040d3660046129a2565b610a5d565b6040516101ce9190613788565b34801561042b57600080fd5b5061024661043a366004612907565b610b4d565b34801561044b57600080fd5b5061024661045a36600461288e565b610c1b565b61024661046d3660046129a2565b610c5a565b34801561047e57600080fd5b506101ec61048d3660046129a2565b610ed4565b34801561049e57600080fd5b506101c16104ad366004612821565b6110e9565b3480156104be57600080fd5b506102466104cd366004612800565b611117565b60006001600160e01b0319821663780e9d6360e01b14806104f757506104f782611188565b90505b919050565b60606000805461050e906138e6565b80601f016020809104026020016040519081016040528092919081815260200182805461053a906138e6565b80156105875780601f1061055c57610100808354040283529160200191610587565b820191906000526020600020905b81548152906001019060200180831161056a57829003601f168201915b5050505050905090565b600061059c826111c8565b6105c15760405162461bcd60e51b81526004016105b890613544565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006105e882610790565b9050806001600160a01b0316836001600160a01b0316141561061c5760405162461bcd60e51b81526004016105b89061360e565b806001600160a01b031661062e6111e5565b6001600160a01b0316148061064a575061064a816104ad6111e5565b6106665760405162461bcd60e51b81526004016105b8906133f4565b61067083836111e9565b505050565b600a81565b60085490565b61069161068b6111e5565b82611257565b6106ad5760405162461bcd60e51b81526004016105b8906136b4565b6106708383836112dc565b60006106c3836107c5565b82106106e15760405162461bcd60e51b81526004016105b8906131e3565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600081565b61067083838360405180602001604052806000815250610c1b565b600061073461067a565b82106107525760405162461bcd60e51b81526004016105b890613705565b6008828154811061077357634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b66b1a2bc2ec5000081565b6000818152600260205260408120546001600160a01b0316806104f75760405162461bcd60e51b81526004016105b8906134c6565b60006001600160a01b0382166107ed5760405162461bcd60e51b81526004016105b89061347c565b506001600160a01b031660009081526003602052604090205490565b6108116111e5565b6001600160a01b031661082261097d565b6001600160a01b0316146108485760405162461bcd60e51b81526004016105b890613590565b6108526000611409565b565b61085c6111e5565b6001600160a01b031661086d61097d565b6001600160a01b0316146108935760405162461bcd60e51b81526004016105b890613590565b4773b87a5d10d52c415ffe213d4a2242ed69761024b66108fc6108b760028461384d565b6040518115909202916000818181858888f193505050501580156108df573d6000803e3d6000fd5b50736ba003943e62bea4d1c416e5663a5fa746749fd66108fc61090360028461384d565b6040518115909202916000818181858888f1935050505015801561092b573d6000803e3d6000fd5b5050565b6109376111e5565b6001600160a01b031661094861097d565b6001600160a01b03161461096e5760405162461bcd60e51b81526004016105b890613590565b600e805460ff19166001179055565b600a546001600160a01b031690565b6109946111e5565b6001600160a01b03166109a561097d565b6001600160a01b0316146109cb5760405162461bcd60e51b81526004016105b890613590565b61138882101580156109e857506109e56113886014613810565b82105b610a045760405162461bcd60e51b81526004016105b890613686565b60008281526010602052604090208054610a1d906138e6565b15159050610a2f57610a2f338361145b565b6000828152601060209081526040909120825161067092840190612677565b60606001805461050e906138e6565b610a656126fb565b610a6e826111c8565b8015610a7b575061138882105b610a975760405162461bcd60e51b81526004016105b890613451565b506000908152600f6020908152604091829020825160e08101845281548152600182015460ff8082168386015261010080830482168488015262010000808404831660608087019190915263010000009094048316608086015287518085018952600287015480851682528381048516828a01528290048416818a015260a0860152875193840188526003909501548083168452908104821695830195909552929093049091169282019290925260c082015290565b610b556111e5565b6001600160a01b0316826001600160a01b03161415610b865760405162461bcd60e51b81526004016105b890613371565b8060056000610b936111e5565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155610bd76111e5565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610c0f9190613198565b60405180910390a35050565b610c2c610c266111e5565b83611257565b610c485760405162461bcd60e51b81526004016105b8906136b4565b610c5484848484611475565b50505050565b6002600b541415610c7d5760405162461bcd60e51b81526004016105b890613751565b6002600b558015801590610c925750600a8111155b610cae5760405162461bcd60e51b81526004016105b8906131b6565b610cbf8166b1a2bc2ec50000613861565b341015610cde5760405162461bcd60e51b81526004016105b89061364f565b61138881610cec600c6114a8565b610cf69190613810565b1115610d145760405162461bcd60e51b81526004016105b8906132fd565b6001600d54901c33600143610d299190613880565b4042604051602001610d3e9493929190613124565b60408051601f198184030181529190528051602090910120600d5560005b81811015610ecb576000610d70600c6114a8565b9050610d7c338261145b565b610d86600c6114ac565b610d92600d54826114b5565b6000828152600f602090815260409182902083518155838201516001808301805487870151606089015160808a015160ff1993841660ff9788161761ff001990811661010094891685021762ff00001990811662010000948a1685021763ff00000019166301000000938a16939093029290921790955560a08b0151805160028a018054838d0151938e0151908816928b16929092178816928a168602929092178316908916840217905560c0909a01518051600390980180549982015191909a01519890931696861696909617909216908416909102179095169216021790558390610e80908490613810565b1015610eb857600d54604051610e9c9160011c9060200161311b565b60408051601f198184030181529190528051602090910120600d555b5080610ec381613921565b915050610d5c565b50506001600b55565b6060610edf826111c8565b610efb5760405162461bcd60e51b81526004016105b890613451565b60008281526010602052604081208054610f14906138e6565b90501115610fba5760008281526010602052604090208054610f35906138e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610f61906138e6565b8015610fae5780601f10610f8357610100808354040283529160200191610fae565b820191906000526020600020905b815481529060010190602001808311610f9157829003601f168201915b505050505090506104fa565b600e5460ff1661102d57610fcc611674565b611006610fe2610fdd856001613810565b6116ab565b604051602001610ff29190612e42565b6040516020818303038152906040526117c6565b604051602001611017929190612b17565b60405160208183030381529060405290506104fa565b6000828152600f6020908152604091829020825160e08101845281548152600182015460ff8082168386015261010080830482168488015262010000808404831660608087019190915263010000009094048316608086015287518085018952600287015480851682528381048516828a01528290048416818a015260a0860152875193840188526003909501548083168452908104821695830195909552929093049091169282019290925260c08201526104f7908361193d565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61111f6111e5565b6001600160a01b031661113061097d565b6001600160a01b0316146111565760405162461bcd60e51b81526004016105b890613590565b6001600160a01b03811661117c5760405162461bcd60e51b81526004016105b890613280565b61118581611409565b50565b60006001600160e01b031982166380ac58cd60e01b14806111b957506001600160e01b03198216635b5e139f60e01b145b806104f757506104f7826119fc565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061121e82610790565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611262826111c8565b61127e5760405162461bcd60e51b81526004016105b8906133a8565b600061128983610790565b9050806001600160a01b0316846001600160a01b031614806112c45750836001600160a01b03166112b984610591565b6001600160a01b0316145b806112d457506112d481856110e9565b949350505050565b826001600160a01b03166112ef82610790565b6001600160a01b0316146113155760405162461bcd60e51b81526004016105b8906135c5565b6001600160a01b03821661133b5760405162461bcd60e51b81526004016105b89061332d565b611346838383611a15565b6113516000826111e9565b6001600160a01b038316600090815260036020526040812080546001929061137a908490613880565b90915550506001600160a01b03821660009081526003602052604081208054600192906113a8908490613810565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61092b828260405180602001604052806000815250611a9e565b6114808484846112dc565b61148c84848484611ad1565b610c545760405162461bcd60e51b81526004016105b89061322e565b5490565b80546001019055565b6114bd6126fb565b6000836040516020016114d0919061311b565b60408051601f19818403018152919052905060006114ef60148561393c565b6114fa906001613810565b905060006115388361150d846009613810565b8151811061152b57634e487b7160e01b600052603260045260246000fd5b016020015160f81c611bec565b90506040518060e0016040528042815260200160128585600261155b9190613810565b8151811061157957634e487b7160e01b600052603260045260246000fd5b016020015161158b919060f81c61393c565b60ff1681526020016115b685858151811061152b57634e487b7160e01b600052603260045260246000fd5b60ff1681526020016012856115cc866008613810565b815181106115ea57634e487b7160e01b600052603260045260246000fd5b01602001516115fc919060f81c61393c565b60ff9081168252831660208201526040016116388561161c866006613810565b611627876003613810565b611632886004613810565b87611c44565b81526020016116688561164c866005613810565b611657876007613810565b611662886001613810565b87611d07565b90529695505050505050565b60408051808201909152601d81527f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000602082015290565b6060816116d057506040805180820190915260018152600360fc1b60208201526104fa565b8160005b81156116fa57806116e481613921565b91506116f39050600a8361384d565b91506116d4565b60008167ffffffffffffffff81111561172357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561174d576020820181803683370190505b5090505b84156112d457611762600183613880565b915061176f600a8661393c565b61177a906030613810565b60f81b81838151811061179d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506117bf600a8661384d565b9450611751565b60608151600014156117e757506040805160208101909152600081526104fa565b60006040518060600160405280604081526020016139cb60409139905060006003845160026118169190613810565b611820919061384d565b61182b906004613861565b9050600061183a826020613810565b67ffffffffffffffff81111561186057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561188a576020820181803683370190505b509050818152600183018586518101602084015b818310156118f85760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b9382019390935260040161189e565b60038951066001811461191257600281146119235761192f565b613d3d60f01b60011983015261192f565b603d60f81b6000198301525b509398975050505050505050565b6060611947611674565b6119d46119548585611d24565b6015866040015160ff166004811061197c57634e487b7160e01b600052603260045260246000fd5b016011876080015160ff16600481106119a557634e487b7160e01b600052603260045260246000fd5b016119af88611dec565b6119c06119bb8a611ed7565b6117c6565b604051602001610ff2959493929190612cc4565b6040516020016119e5929190612b17565b604051602081830303815290604052905092915050565b6001600160e01b031981166301ffc9a760e01b14919050565b611a20838383610670565b6001600160a01b038316611a3c57611a3781611f11565b611a5f565b816001600160a01b0316836001600160a01b031614611a5f57611a5f8382611f55565b6001600160a01b038216611a7b57611a7681611ff2565b610670565b826001600160a01b0316826001600160a01b0316146106705761067082826120cb565b611aa8838361210f565b611ab56000848484611ad1565b6106705760405162461bcd60e51b81526004016105b89061322e565b6000611ae5846001600160a01b03166121ee565b15611be157836001600160a01b031663150b7a02611b016111e5565b8786866040518563ffffffff1660e01b8152600401611b239493929190613165565b602060405180830381600087803b158015611b3d57600080fd5b505af1925050508015611b6d575060408051601f3d908101601f19168201909252611b6a91810190612986565b60015b611bc7573d808015611b9b576040519150601f19603f3d011682016040523d82523d6000602084013e611ba0565b606091505b508051611bbf5760405162461bcd60e51b81526004016105b89061322e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506112d4565b506001949350505050565b600080611bfa606484613950565b9050602e8160ff1610611c115760009150506104fa565b60108160ff1610611c265760019150506104fa565b60018160ff1610611c3b5760029150506104fa565b50600392915050565b611c4c612744565b611cfd611c58836121f4565b611c618461229f565b60405180606001604052808a8a81518110611c8c57634e487b7160e01b600052603260045260246000fd5b0160209081015160f81c82528b519101908b908a908110611cbd57634e487b7160e01b600052603260045260246000fd5b0160209081015160f81c82528b519101908b9089908110611cee57634e487b7160e01b600052603260045260246000fd5b016020015160f81c905261234e565b9695505050505050565b611d0f612744565b611cfd611d1b836124b5565b611c6184612561565b60606019836020015160ff1660128110611d4e57634e487b7160e01b600052603260045260246000fd5b01602b846060015160ff1660128110611d7757634e487b7160e01b600052603260045260246000fd5b016015856040015160ff1660048110611da057634e487b7160e01b600052603260045260246000fd5b016011866080015160ff1660048110611dc957634e487b7160e01b600052603260045260246000fd5b01611dd8610fdd876001613810565b6040516020016119e5959493929190612c4b565b60606011826080015160ff1660048110611e1657634e487b7160e01b600052603260045260246000fd5b016015836040015160ff1660048110611e3f57634e487b7160e01b600052603260045260246000fd5b016019846020015160ff1660128110611e6857634e487b7160e01b600052603260045260246000fd5b01602b856060015160ff1660128110611e9157634e487b7160e01b600052603260045260246000fd5b01611e9f8660a0015161260e565b611eac8760c0015161260e565b604051602001611ec196959493929190612efa565b6040516020818303038152906040529050919050565b6060611ee561043880612652565b611ef28360a0015161260e565b611eff8460c0015161260e565b604051602001611ec193929190612b46565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b60006001611f62846107c5565b611f6c9190613880565b600083815260076020526040902054909150808214611fbf576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061200490600190613880565b6000838152600960205260408120546008805493945090928490811061203a57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061206957634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806120af57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006120d6836107c5565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b0382166121355760405162461bcd60e51b81526004016105b89061350f565b61213e816111c8565b1561215b5760405162461bcd60e51b81526004016105b8906132c6565b61216760008383611a15565b6001600160a01b0382166000908152600360205260408120805460019290612190908490613810565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b3b151590565b6121fc612744565b81612225575060408051606081018252608d8152605d60208201526033918101919091526104fa565b816001141561224f57506040805160608101825260388082526020820152808201919091526104fa565b816002141561227c57506040805160608101825260d0815260e5602082015260e2918101919091526104fa565b506040805160608101825260dd808252602082015260de918101919091526104fa565b6122a7612744565b816122d057506040805160608101825260c1815260a260208201526086918101919091526104fa565b81600114156122fd57506040805160608101825260578152605c6020820152606d918101919091526104fa565b816002141561232a57506040805160608101825260eb815260f0602082015260ef918101919091526104fa565b506040805160608101825260e2815260e1602082015260e8918101919091526104fa565b612356612744565b60006064836040015160ff16846020015160ff16856000015160ff1661237c9190613810565b6123869190613810565b612390919061393c565b90506064818660000151600286600001516123ab9190613950565b87516123b79190613828565b6123c19190613897565b60ff166123ce9190613861565b6123d8919061384d565b85516123e49190613828565b60ff16825260208086015190840151606491839161240490600290613950565b87602001516124139190613828565b61241d9190613897565b60ff1661242a9190613861565b612434919061384d565b85602001516124439190613828565b60ff16602083015260408086015190840151606491839161246690600290613950565b87604001516124759190613828565b61247f9190613897565b60ff1661248c9190613861565b612496919061384d565b85604001516124a59190613828565b60ff166040830152509392505050565b6124bd612744565b816124e557506040805160608101825281815260266020820152600e918101919091526104fa565b8160011415612511575060408051606081018252602280825260208201526025918101919091526104fa565b816002141561253e57506040805160608101825260b1815260b6602082015260b4918101919091526104fa565b5060408051606081018252600080825260208201819052918101919091526104fa565b612569612744565b816125925750604080516060810182526077815260516020820152602d918101919091526104fa565b81600114156125be57506040805160608101825260488082526020820152604d918101919091526104fa565b81600214156125eb57506040805160608101825260df815260e7602082015260e6918101919091526104fa565b5060408051606081018252601280825260208201526013918101919091526104fa565b6060612620826000015160ff166116ab565b612630836020015160ff166116ab565b612640846040015160ff166116ab565b604051602001611ec193929190612dca565b606061265d836116ab565b612666836116ab565b6040516020016119e592919061307b565b828054612683906138e6565b90600052602060002090601f0160209004810192826126a557600085556126eb565b82601f106126be57805160ff19168380011785556126eb565b828001600101855582156126eb579182015b828111156126eb5782518255916020019190600101906126d0565b506126f7929150612764565b5090565b6040805160e08101825260008082526020820181905291810182905260608101829052608081019190915260a08101612732612744565b815260200161273f612744565b905290565b604080516060810182526000808252602082018190529181019190915290565b5b808211156126f75760008155600101612765565b600067ffffffffffffffff808411156127945761279461399e565b604051601f8501601f1916810160200182811182821017156127b8576127b861399e565b6040528481529150818385018610156127d057600080fd5b8484602083013760006020868301015250509392505050565b80356001600160a01b03811681146104fa57600080fd5b600060208284031215612811578081fd5b61281a826127e9565b9392505050565b60008060408385031215612833578081fd5b61283c836127e9565b915061284a602084016127e9565b90509250929050565b600080600060608486031215612867578081fd5b612870846127e9565b925061287e602085016127e9565b9150604084013590509250925092565b600080600080608085870312156128a3578081fd5b6128ac856127e9565b93506128ba602086016127e9565b925060408501359150606085013567ffffffffffffffff8111156128dc578182fd5b8501601f810187136128ec578182fd5b6128fb87823560208401612779565b91505092959194509250565b60008060408385031215612919578182fd5b612922836127e9565b915060208301358015158114612936578182fd5b809150509250929050565b60008060408385031215612953578182fd5b61295c836127e9565b946020939093013593505050565b60006020828403121561297b578081fd5b813561281a816139b4565b600060208284031215612997578081fd5b815161281a816139b4565b6000602082840312156129b3578081fd5b5035919050565b600080604083850312156129cc578182fd5b82359150602083013567ffffffffffffffff8111156129e9578182fd5b8301601f810185136129f9578182fd5b612a0885823560208401612779565b9150509250929050565b60008151808452612a2a8160208601602086016138ba565b601f01601f19169290920160200192915050565b60008151612a508185602086016138ba565b9290920192915050565b805460009060028104600180831680612a7457607f831692505b6020808410821415612a9457634e487b7160e01b86526022600452602486fd5b818015612aa85760018114612ab957612ae6565b60ff19861689528489019650612ae6565b612ac288613804565b60005b86811015612ade5781548b820152908501908301612ac5565b505084890196505b50505050505092915050565b60ff815116825260ff602082015116602083015260ff60408201511660408301525050565b60008351612b298184602088016138ba565b835190830190612b3d8183602088016138ba565b01949350505050565b60008451612b588184602089016138ba565b80830190507f3c706174682069643d27486561642720643d274d34303520353430204c36373581527f2035343020363735203237302034303520323730205a272066696c6c3d27000060208201528451612bb981603e8401602089016138ba565b7f272f3e3c706174682069643d27546f72736f2720643d274d3430352038313020603e92909101918201527f4c3637352038313020363735203534302034303520353430205a272066696c6c605e820152613d2760f01b607e8201528351612c288160808401602088016138ba565b6813979f1e17b9bb339f60b91b6080929091019182015260890195945050505050565b6000612c578288612a5a565b600160fd1b808252612c6c6001830189612a5a565b9150640103a3432960dd1b8252612c866005830188612a5a565b9081529050612c986001820186612a5a565b905061202360f01b81528351612cb58160028401602088016138ba565b01600201979650505050505050565b683d913730b6b2911d1160b91b81528551600090612ce9816009850160208b016138ba565b701116113232b9b1b934b83a34b7b7111d1160791b600991840191820152612d14601a820188612a5a565b9050600160fd1b8152612d2a6001820187612a5a565b7111161130ba3a3934b13aba32b9911d2dbd9160711b81528551909150612d588160128401602089016138ba565b6c113eae961134b6b0b3b2911d1160991b601292909101918201527f646174613a696d6167652f7376672b786d6c3b6261736536342c000000000000601f8201528351612dac8160398401602088016138ba565b61227d60f01b91016039810191909152603b01979650505050505050565b6000630e4cec4560e31b82528451612de98160048501602089016138ba565b8083019050600b60fa1b8060048301528551612e0c816005850160208a016138ba565b60059201918201528351612e278160068401602088016138ba565b602960f81b6006929091019182015260070195945050505050565b60007f7b226e616d65223a2252656e646572696e67204265617220230000000000000082528251612e7a8160198501602087016138ba565b7f2e2e2e222c226465736372697074696f6e223a22556e72657665616c6564222c60199390910192830152507f22696d616765223a22697066733a2f2f516d5442677641766259464d3553335560398201527f4b32564c434c5346694262764176746f366845524e6d5167685853454e52227d6059820152607901919050565b60007f74726169745f74797065223a2253706563696573222c2276616c7565223a22008252612f2c601f830189612a5a565b7f227d2c7b2274726169745f74797065223a224d6f6f64222c2276616c7565223a8152601160f91b6020808301829052612f69602184018b612a5a565b92507f227d2c7b2274726169745f74797065223a224e616d65222c2276616c7565223a83528181840152612fa0602184018a612a5a565b7f227d2c7b2274726169745f74797065223a2246616d696c79222c2276616c7565815262111d1160e91b828201529250612fdd6023840189612a5a565b92507f227d2c7b2274726169745f74797065223a225265616c6973746963204865616483526e10233ab91116113b30b63ab2911d1160891b91508181840152865161302e81602f8601848b016138ba565b602f818501019350507f227d2c7b2274726169745f74797065223a225265616c697374696320426f647983528181840152505061306e602f820185612a3e565b9998505050505050505050565b60007101e39bb33903b34b2bba137bc1e93981018160751b825283516130a88160128501602088016138ba565b600160fd1b60129184019182015283516130c98160138401602088016138ba565b7f2720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f601392909101918201527239bb3393903b32b939b4b7b71e93989718939f60691b6033820152604601949350505050565b90815260200190565b93845260609290921b6bffffffffffffffffffffffff191660208401526034830152605482015260740190565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611cfd90830184612a12565b901515815260200190565b60006020825261281a6020830184612a12565b602080825260139082015272145d585b9d1a5d1e481a5cc81a5b9d985b1a59606a1b604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526016908201527513585e1a5b5d5b481099585c9cc8195e18d95959195960521b604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252601190820152702737b732bc34b9ba32b73a103a37b5b2b760791b604082015260600190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526019908201527f45746865722073656e74206973206e6f7420636f727265637400000000000000604082015260600190565b602080825260149082015273125b9d985b1a590819da599d081d1bdad95b925960621b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000610160820190508251825260ff602084015116602083015260ff604084015116604083015260ff606084015116606083015260ff608084015116608083015260a08301516137db60a0840182612af2565b5060c08301516137ef610100840182612af2565b5092915050565b60ff91909116815260200190565b60009081526020902090565b6000821982111561382357613823613972565b500190565b600060ff821660ff84168060ff0382111561384557613845613972565b019392505050565b60008261385c5761385c613988565b500490565b600081600019048311821515161561387b5761387b613972565b500290565b60008282101561389257613892613972565b500390565b600060ff821660ff8416808210156138b1576138b1613972565b90039392505050565b60005b838110156138d55781810151838201526020016138bd565b83811115610c545750506000910152565b6002810460018216806138fa57607f821691505b6020821081141561391b57634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561393557613935613972565b5060010190565b60008261394b5761394b613988565b500690565b600060ff83168061396357613963613988565b8060ff84160691505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461118557600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212209bfbb366c9eb234afbd7006c75a356fd69f769ff341cba0125bc43a1269c01ed64736f6c63430008000033

Deployed Bytecode

0x60806040526004361061019c5760003560e01c806370a08231116100ec578063a005ec7a1161008a578063c32ae14711610064578063c32ae1471461045f578063c87b56dd14610472578063e985e9c514610492578063f2fde38b146104b25761019c565b8063a005ec7a146103f2578063a22cb4651461041f578063b88d4fde1461043f5761019c565b80638b559191116100c65780638b559191146103935780638da5cb5b146103a8578063918c3ebc146103bd57806395d89b41146103dd5761019c565b806370a0823114610356578063715018a614610376578063853828b61461038b5761019c565b806323b872dd1161015957806342842e0e1161013357806342842e0e146102e15780634f6ccce7146103015780635d9ff0ad146103215780636352211e146103365761019c565b806323b872dd1461027f5780632f745c591461029f578063313ce567146102bf5761019c565b806301ffc9a7146101a157806306fdde03146101d7578063081812fc146101f9578063095ea7b314610226578063180c42a21461024857806318160ddd1461026a575b600080fd5b3480156101ad57600080fd5b506101c16101bc36600461296a565b6104d2565b6040516101ce9190613198565b60405180910390f35b3480156101e357600080fd5b506101ec6104ff565b6040516101ce91906131a3565b34801561020557600080fd5b506102196102143660046129a2565b610591565b6040516101ce9190613151565b34801561023257600080fd5b50610246610241366004612941565b6105dd565b005b34801561025457600080fd5b5061025d610675565b6040516101ce919061311b565b34801561027657600080fd5b5061025d61067a565b34801561028b57600080fd5b5061024661029a366004612853565b610680565b3480156102ab57600080fd5b5061025d6102ba366004612941565b6106b8565b3480156102cb57600080fd5b506102d461070a565b6040516101ce91906137f6565b3480156102ed57600080fd5b506102466102fc366004612853565b61070f565b34801561030d57600080fd5b5061025d61031c3660046129a2565b61072a565b34801561032d57600080fd5b5061025d610785565b34801561034257600080fd5b506102196103513660046129a2565b610790565b34801561036257600080fd5b5061025d610371366004612800565b6107c5565b34801561038257600080fd5b50610246610809565b610246610854565b34801561039f57600080fd5b5061024661092f565b3480156103b457600080fd5b5061021961097d565b3480156103c957600080fd5b506102466103d83660046129ba565b61098c565b3480156103e957600080fd5b506101ec610a4e565b3480156103fe57600080fd5b5061041261040d3660046129a2565b610a5d565b6040516101ce9190613788565b34801561042b57600080fd5b5061024661043a366004612907565b610b4d565b34801561044b57600080fd5b5061024661045a36600461288e565b610c1b565b61024661046d3660046129a2565b610c5a565b34801561047e57600080fd5b506101ec61048d3660046129a2565b610ed4565b34801561049e57600080fd5b506101c16104ad366004612821565b6110e9565b3480156104be57600080fd5b506102466104cd366004612800565b611117565b60006001600160e01b0319821663780e9d6360e01b14806104f757506104f782611188565b90505b919050565b60606000805461050e906138e6565b80601f016020809104026020016040519081016040528092919081815260200182805461053a906138e6565b80156105875780601f1061055c57610100808354040283529160200191610587565b820191906000526020600020905b81548152906001019060200180831161056a57829003601f168201915b5050505050905090565b600061059c826111c8565b6105c15760405162461bcd60e51b81526004016105b890613544565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006105e882610790565b9050806001600160a01b0316836001600160a01b0316141561061c5760405162461bcd60e51b81526004016105b89061360e565b806001600160a01b031661062e6111e5565b6001600160a01b0316148061064a575061064a816104ad6111e5565b6106665760405162461bcd60e51b81526004016105b8906133f4565b61067083836111e9565b505050565b600a81565b60085490565b61069161068b6111e5565b82611257565b6106ad5760405162461bcd60e51b81526004016105b8906136b4565b6106708383836112dc565b60006106c3836107c5565b82106106e15760405162461bcd60e51b81526004016105b8906131e3565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b600081565b61067083838360405180602001604052806000815250610c1b565b600061073461067a565b82106107525760405162461bcd60e51b81526004016105b890613705565b6008828154811061077357634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b66b1a2bc2ec5000081565b6000818152600260205260408120546001600160a01b0316806104f75760405162461bcd60e51b81526004016105b8906134c6565b60006001600160a01b0382166107ed5760405162461bcd60e51b81526004016105b89061347c565b506001600160a01b031660009081526003602052604090205490565b6108116111e5565b6001600160a01b031661082261097d565b6001600160a01b0316146108485760405162461bcd60e51b81526004016105b890613590565b6108526000611409565b565b61085c6111e5565b6001600160a01b031661086d61097d565b6001600160a01b0316146108935760405162461bcd60e51b81526004016105b890613590565b4773b87a5d10d52c415ffe213d4a2242ed69761024b66108fc6108b760028461384d565b6040518115909202916000818181858888f193505050501580156108df573d6000803e3d6000fd5b50736ba003943e62bea4d1c416e5663a5fa746749fd66108fc61090360028461384d565b6040518115909202916000818181858888f1935050505015801561092b573d6000803e3d6000fd5b5050565b6109376111e5565b6001600160a01b031661094861097d565b6001600160a01b03161461096e5760405162461bcd60e51b81526004016105b890613590565b600e805460ff19166001179055565b600a546001600160a01b031690565b6109946111e5565b6001600160a01b03166109a561097d565b6001600160a01b0316146109cb5760405162461bcd60e51b81526004016105b890613590565b61138882101580156109e857506109e56113886014613810565b82105b610a045760405162461bcd60e51b81526004016105b890613686565b60008281526010602052604090208054610a1d906138e6565b15159050610a2f57610a2f338361145b565b6000828152601060209081526040909120825161067092840190612677565b60606001805461050e906138e6565b610a656126fb565b610a6e826111c8565b8015610a7b575061138882105b610a975760405162461bcd60e51b81526004016105b890613451565b506000908152600f6020908152604091829020825160e08101845281548152600182015460ff8082168386015261010080830482168488015262010000808404831660608087019190915263010000009094048316608086015287518085018952600287015480851682528381048516828a01528290048416818a015260a0860152875193840188526003909501548083168452908104821695830195909552929093049091169282019290925260c082015290565b610b556111e5565b6001600160a01b0316826001600160a01b03161415610b865760405162461bcd60e51b81526004016105b890613371565b8060056000610b936111e5565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155610bd76111e5565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610c0f9190613198565b60405180910390a35050565b610c2c610c266111e5565b83611257565b610c485760405162461bcd60e51b81526004016105b8906136b4565b610c5484848484611475565b50505050565b6002600b541415610c7d5760405162461bcd60e51b81526004016105b890613751565b6002600b558015801590610c925750600a8111155b610cae5760405162461bcd60e51b81526004016105b8906131b6565b610cbf8166b1a2bc2ec50000613861565b341015610cde5760405162461bcd60e51b81526004016105b89061364f565b61138881610cec600c6114a8565b610cf69190613810565b1115610d145760405162461bcd60e51b81526004016105b8906132fd565b6001600d54901c33600143610d299190613880565b4042604051602001610d3e9493929190613124565b60408051601f198184030181529190528051602090910120600d5560005b81811015610ecb576000610d70600c6114a8565b9050610d7c338261145b565b610d86600c6114ac565b610d92600d54826114b5565b6000828152600f602090815260409182902083518155838201516001808301805487870151606089015160808a015160ff1993841660ff9788161761ff001990811661010094891685021762ff00001990811662010000948a1685021763ff00000019166301000000938a16939093029290921790955560a08b0151805160028a018054838d0151938e0151908816928b16929092178816928a168602929092178316908916840217905560c0909a01518051600390980180549982015191909a01519890931696861696909617909216908416909102179095169216021790558390610e80908490613810565b1015610eb857600d54604051610e9c9160011c9060200161311b565b60408051601f198184030181529190528051602090910120600d555b5080610ec381613921565b915050610d5c565b50506001600b55565b6060610edf826111c8565b610efb5760405162461bcd60e51b81526004016105b890613451565b60008281526010602052604081208054610f14906138e6565b90501115610fba5760008281526010602052604090208054610f35906138e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610f61906138e6565b8015610fae5780601f10610f8357610100808354040283529160200191610fae565b820191906000526020600020905b815481529060010190602001808311610f9157829003601f168201915b505050505090506104fa565b600e5460ff1661102d57610fcc611674565b611006610fe2610fdd856001613810565b6116ab565b604051602001610ff29190612e42565b6040516020818303038152906040526117c6565b604051602001611017929190612b17565b60405160208183030381529060405290506104fa565b6000828152600f6020908152604091829020825160e08101845281548152600182015460ff8082168386015261010080830482168488015262010000808404831660608087019190915263010000009094048316608086015287518085018952600287015480851682528381048516828a01528290048416818a015260a0860152875193840188526003909501548083168452908104821695830195909552929093049091169282019290925260c08201526104f7908361193d565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61111f6111e5565b6001600160a01b031661113061097d565b6001600160a01b0316146111565760405162461bcd60e51b81526004016105b890613590565b6001600160a01b03811661117c5760405162461bcd60e51b81526004016105b890613280565b61118581611409565b50565b60006001600160e01b031982166380ac58cd60e01b14806111b957506001600160e01b03198216635b5e139f60e01b145b806104f757506104f7826119fc565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061121e82610790565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611262826111c8565b61127e5760405162461bcd60e51b81526004016105b8906133a8565b600061128983610790565b9050806001600160a01b0316846001600160a01b031614806112c45750836001600160a01b03166112b984610591565b6001600160a01b0316145b806112d457506112d481856110e9565b949350505050565b826001600160a01b03166112ef82610790565b6001600160a01b0316146113155760405162461bcd60e51b81526004016105b8906135c5565b6001600160a01b03821661133b5760405162461bcd60e51b81526004016105b89061332d565b611346838383611a15565b6113516000826111e9565b6001600160a01b038316600090815260036020526040812080546001929061137a908490613880565b90915550506001600160a01b03821660009081526003602052604081208054600192906113a8908490613810565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61092b828260405180602001604052806000815250611a9e565b6114808484846112dc565b61148c84848484611ad1565b610c545760405162461bcd60e51b81526004016105b89061322e565b5490565b80546001019055565b6114bd6126fb565b6000836040516020016114d0919061311b565b60408051601f19818403018152919052905060006114ef60148561393c565b6114fa906001613810565b905060006115388361150d846009613810565b8151811061152b57634e487b7160e01b600052603260045260246000fd5b016020015160f81c611bec565b90506040518060e0016040528042815260200160128585600261155b9190613810565b8151811061157957634e487b7160e01b600052603260045260246000fd5b016020015161158b919060f81c61393c565b60ff1681526020016115b685858151811061152b57634e487b7160e01b600052603260045260246000fd5b60ff1681526020016012856115cc866008613810565b815181106115ea57634e487b7160e01b600052603260045260246000fd5b01602001516115fc919060f81c61393c565b60ff9081168252831660208201526040016116388561161c866006613810565b611627876003613810565b611632886004613810565b87611c44565b81526020016116688561164c866005613810565b611657876007613810565b611662886001613810565b87611d07565b90529695505050505050565b60408051808201909152601d81527f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000602082015290565b6060816116d057506040805180820190915260018152600360fc1b60208201526104fa565b8160005b81156116fa57806116e481613921565b91506116f39050600a8361384d565b91506116d4565b60008167ffffffffffffffff81111561172357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561174d576020820181803683370190505b5090505b84156112d457611762600183613880565b915061176f600a8661393c565b61177a906030613810565b60f81b81838151811061179d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506117bf600a8661384d565b9450611751565b60608151600014156117e757506040805160208101909152600081526104fa565b60006040518060600160405280604081526020016139cb60409139905060006003845160026118169190613810565b611820919061384d565b61182b906004613861565b9050600061183a826020613810565b67ffffffffffffffff81111561186057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561188a576020820181803683370190505b509050818152600183018586518101602084015b818310156118f85760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b9382019390935260040161189e565b60038951066001811461191257600281146119235761192f565b613d3d60f01b60011983015261192f565b603d60f81b6000198301525b509398975050505050505050565b6060611947611674565b6119d46119548585611d24565b6015866040015160ff166004811061197c57634e487b7160e01b600052603260045260246000fd5b016011876080015160ff16600481106119a557634e487b7160e01b600052603260045260246000fd5b016119af88611dec565b6119c06119bb8a611ed7565b6117c6565b604051602001610ff2959493929190612cc4565b6040516020016119e5929190612b17565b604051602081830303815290604052905092915050565b6001600160e01b031981166301ffc9a760e01b14919050565b611a20838383610670565b6001600160a01b038316611a3c57611a3781611f11565b611a5f565b816001600160a01b0316836001600160a01b031614611a5f57611a5f8382611f55565b6001600160a01b038216611a7b57611a7681611ff2565b610670565b826001600160a01b0316826001600160a01b0316146106705761067082826120cb565b611aa8838361210f565b611ab56000848484611ad1565b6106705760405162461bcd60e51b81526004016105b89061322e565b6000611ae5846001600160a01b03166121ee565b15611be157836001600160a01b031663150b7a02611b016111e5565b8786866040518563ffffffff1660e01b8152600401611b239493929190613165565b602060405180830381600087803b158015611b3d57600080fd5b505af1925050508015611b6d575060408051601f3d908101601f19168201909252611b6a91810190612986565b60015b611bc7573d808015611b9b576040519150601f19603f3d011682016040523d82523d6000602084013e611ba0565b606091505b508051611bbf5760405162461bcd60e51b81526004016105b89061322e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506112d4565b506001949350505050565b600080611bfa606484613950565b9050602e8160ff1610611c115760009150506104fa565b60108160ff1610611c265760019150506104fa565b60018160ff1610611c3b5760029150506104fa565b50600392915050565b611c4c612744565b611cfd611c58836121f4565b611c618461229f565b60405180606001604052808a8a81518110611c8c57634e487b7160e01b600052603260045260246000fd5b0160209081015160f81c82528b519101908b908a908110611cbd57634e487b7160e01b600052603260045260246000fd5b0160209081015160f81c82528b519101908b9089908110611cee57634e487b7160e01b600052603260045260246000fd5b016020015160f81c905261234e565b9695505050505050565b611d0f612744565b611cfd611d1b836124b5565b611c6184612561565b60606019836020015160ff1660128110611d4e57634e487b7160e01b600052603260045260246000fd5b01602b846060015160ff1660128110611d7757634e487b7160e01b600052603260045260246000fd5b016015856040015160ff1660048110611da057634e487b7160e01b600052603260045260246000fd5b016011866080015160ff1660048110611dc957634e487b7160e01b600052603260045260246000fd5b01611dd8610fdd876001613810565b6040516020016119e5959493929190612c4b565b60606011826080015160ff1660048110611e1657634e487b7160e01b600052603260045260246000fd5b016015836040015160ff1660048110611e3f57634e487b7160e01b600052603260045260246000fd5b016019846020015160ff1660128110611e6857634e487b7160e01b600052603260045260246000fd5b01602b856060015160ff1660128110611e9157634e487b7160e01b600052603260045260246000fd5b01611e9f8660a0015161260e565b611eac8760c0015161260e565b604051602001611ec196959493929190612efa565b6040516020818303038152906040529050919050565b6060611ee561043880612652565b611ef28360a0015161260e565b611eff8460c0015161260e565b604051602001611ec193929190612b46565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b60006001611f62846107c5565b611f6c9190613880565b600083815260076020526040902054909150808214611fbf576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061200490600190613880565b6000838152600960205260408120546008805493945090928490811061203a57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061206957634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806120af57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006120d6836107c5565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6001600160a01b0382166121355760405162461bcd60e51b81526004016105b89061350f565b61213e816111c8565b1561215b5760405162461bcd60e51b81526004016105b8906132c6565b61216760008383611a15565b6001600160a01b0382166000908152600360205260408120805460019290612190908490613810565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b3b151590565b6121fc612744565b81612225575060408051606081018252608d8152605d60208201526033918101919091526104fa565b816001141561224f57506040805160608101825260388082526020820152808201919091526104fa565b816002141561227c57506040805160608101825260d0815260e5602082015260e2918101919091526104fa565b506040805160608101825260dd808252602082015260de918101919091526104fa565b6122a7612744565b816122d057506040805160608101825260c1815260a260208201526086918101919091526104fa565b81600114156122fd57506040805160608101825260578152605c6020820152606d918101919091526104fa565b816002141561232a57506040805160608101825260eb815260f0602082015260ef918101919091526104fa565b506040805160608101825260e2815260e1602082015260e8918101919091526104fa565b612356612744565b60006064836040015160ff16846020015160ff16856000015160ff1661237c9190613810565b6123869190613810565b612390919061393c565b90506064818660000151600286600001516123ab9190613950565b87516123b79190613828565b6123c19190613897565b60ff166123ce9190613861565b6123d8919061384d565b85516123e49190613828565b60ff16825260208086015190840151606491839161240490600290613950565b87602001516124139190613828565b61241d9190613897565b60ff1661242a9190613861565b612434919061384d565b85602001516124439190613828565b60ff16602083015260408086015190840151606491839161246690600290613950565b87604001516124759190613828565b61247f9190613897565b60ff1661248c9190613861565b612496919061384d565b85604001516124a59190613828565b60ff166040830152509392505050565b6124bd612744565b816124e557506040805160608101825281815260266020820152600e918101919091526104fa565b8160011415612511575060408051606081018252602280825260208201526025918101919091526104fa565b816002141561253e57506040805160608101825260b1815260b6602082015260b4918101919091526104fa565b5060408051606081018252600080825260208201819052918101919091526104fa565b612569612744565b816125925750604080516060810182526077815260516020820152602d918101919091526104fa565b81600114156125be57506040805160608101825260488082526020820152604d918101919091526104fa565b81600214156125eb57506040805160608101825260df815260e7602082015260e6918101919091526104fa565b5060408051606081018252601280825260208201526013918101919091526104fa565b6060612620826000015160ff166116ab565b612630836020015160ff166116ab565b612640846040015160ff166116ab565b604051602001611ec193929190612dca565b606061265d836116ab565b612666836116ab565b6040516020016119e592919061307b565b828054612683906138e6565b90600052602060002090601f0160209004810192826126a557600085556126eb565b82601f106126be57805160ff19168380011785556126eb565b828001600101855582156126eb579182015b828111156126eb5782518255916020019190600101906126d0565b506126f7929150612764565b5090565b6040805160e08101825260008082526020820181905291810182905260608101829052608081019190915260a08101612732612744565b815260200161273f612744565b905290565b604080516060810182526000808252602082018190529181019190915290565b5b808211156126f75760008155600101612765565b600067ffffffffffffffff808411156127945761279461399e565b604051601f8501601f1916810160200182811182821017156127b8576127b861399e565b6040528481529150818385018610156127d057600080fd5b8484602083013760006020868301015250509392505050565b80356001600160a01b03811681146104fa57600080fd5b600060208284031215612811578081fd5b61281a826127e9565b9392505050565b60008060408385031215612833578081fd5b61283c836127e9565b915061284a602084016127e9565b90509250929050565b600080600060608486031215612867578081fd5b612870846127e9565b925061287e602085016127e9565b9150604084013590509250925092565b600080600080608085870312156128a3578081fd5b6128ac856127e9565b93506128ba602086016127e9565b925060408501359150606085013567ffffffffffffffff8111156128dc578182fd5b8501601f810187136128ec578182fd5b6128fb87823560208401612779565b91505092959194509250565b60008060408385031215612919578182fd5b612922836127e9565b915060208301358015158114612936578182fd5b809150509250929050565b60008060408385031215612953578182fd5b61295c836127e9565b946020939093013593505050565b60006020828403121561297b578081fd5b813561281a816139b4565b600060208284031215612997578081fd5b815161281a816139b4565b6000602082840312156129b3578081fd5b5035919050565b600080604083850312156129cc578182fd5b82359150602083013567ffffffffffffffff8111156129e9578182fd5b8301601f810185136129f9578182fd5b612a0885823560208401612779565b9150509250929050565b60008151808452612a2a8160208601602086016138ba565b601f01601f19169290920160200192915050565b60008151612a508185602086016138ba565b9290920192915050565b805460009060028104600180831680612a7457607f831692505b6020808410821415612a9457634e487b7160e01b86526022600452602486fd5b818015612aa85760018114612ab957612ae6565b60ff19861689528489019650612ae6565b612ac288613804565b60005b86811015612ade5781548b820152908501908301612ac5565b505084890196505b50505050505092915050565b60ff815116825260ff602082015116602083015260ff60408201511660408301525050565b60008351612b298184602088016138ba565b835190830190612b3d8183602088016138ba565b01949350505050565b60008451612b588184602089016138ba565b80830190507f3c706174682069643d27486561642720643d274d34303520353430204c36373581527f2035343020363735203237302034303520323730205a272066696c6c3d27000060208201528451612bb981603e8401602089016138ba565b7f272f3e3c706174682069643d27546f72736f2720643d274d3430352038313020603e92909101918201527f4c3637352038313020363735203534302034303520353430205a272066696c6c605e820152613d2760f01b607e8201528351612c288160808401602088016138ba565b6813979f1e17b9bb339f60b91b6080929091019182015260890195945050505050565b6000612c578288612a5a565b600160fd1b808252612c6c6001830189612a5a565b9150640103a3432960dd1b8252612c866005830188612a5a565b9081529050612c986001820186612a5a565b905061202360f01b81528351612cb58160028401602088016138ba565b01600201979650505050505050565b683d913730b6b2911d1160b91b81528551600090612ce9816009850160208b016138ba565b701116113232b9b1b934b83a34b7b7111d1160791b600991840191820152612d14601a820188612a5a565b9050600160fd1b8152612d2a6001820187612a5a565b7111161130ba3a3934b13aba32b9911d2dbd9160711b81528551909150612d588160128401602089016138ba565b6c113eae961134b6b0b3b2911d1160991b601292909101918201527f646174613a696d6167652f7376672b786d6c3b6261736536342c000000000000601f8201528351612dac8160398401602088016138ba565b61227d60f01b91016039810191909152603b01979650505050505050565b6000630e4cec4560e31b82528451612de98160048501602089016138ba565b8083019050600b60fa1b8060048301528551612e0c816005850160208a016138ba565b60059201918201528351612e278160068401602088016138ba565b602960f81b6006929091019182015260070195945050505050565b60007f7b226e616d65223a2252656e646572696e67204265617220230000000000000082528251612e7a8160198501602087016138ba565b7f2e2e2e222c226465736372697074696f6e223a22556e72657665616c6564222c60199390910192830152507f22696d616765223a22697066733a2f2f516d5442677641766259464d3553335560398201527f4b32564c434c5346694262764176746f366845524e6d5167685853454e52227d6059820152607901919050565b60007f74726169745f74797065223a2253706563696573222c2276616c7565223a22008252612f2c601f830189612a5a565b7f227d2c7b2274726169745f74797065223a224d6f6f64222c2276616c7565223a8152601160f91b6020808301829052612f69602184018b612a5a565b92507f227d2c7b2274726169745f74797065223a224e616d65222c2276616c7565223a83528181840152612fa0602184018a612a5a565b7f227d2c7b2274726169745f74797065223a2246616d696c79222c2276616c7565815262111d1160e91b828201529250612fdd6023840189612a5a565b92507f227d2c7b2274726169745f74797065223a225265616c6973746963204865616483526e10233ab91116113b30b63ab2911d1160891b91508181840152865161302e81602f8601848b016138ba565b602f818501019350507f227d2c7b2274726169745f74797065223a225265616c697374696320426f647983528181840152505061306e602f820185612a3e565b9998505050505050505050565b60007101e39bb33903b34b2bba137bc1e93981018160751b825283516130a88160128501602088016138ba565b600160fd1b60129184019182015283516130c98160138401602088016138ba565b7f2720786d6c6e733d27687474703a2f2f7777772e77332e6f72672f323030302f601392909101918201527239bb3393903b32b939b4b7b71e93989718939f60691b6033820152604601949350505050565b90815260200190565b93845260609290921b6bffffffffffffffffffffffff191660208401526034830152605482015260740190565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611cfd90830184612a12565b901515815260200190565b60006020825261281a6020830184612a12565b602080825260139082015272145d585b9d1a5d1e481a5cc81a5b9d985b1a59606a1b604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526016908201527513585e1a5b5d5b481099585c9cc8195e18d95959195960521b604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252601190820152702737b732bc34b9ba32b73a103a37b5b2b760791b604082015260600190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526019908201527f45746865722073656e74206973206e6f7420636f727265637400000000000000604082015260600190565b602080825260149082015273125b9d985b1a590819da599d081d1bdad95b925960621b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000610160820190508251825260ff602084015116602083015260ff604084015116604083015260ff606084015116606083015260ff608084015116608083015260a08301516137db60a0840182612af2565b5060c08301516137ef610100840182612af2565b5092915050565b60ff91909116815260200190565b60009081526020902090565b6000821982111561382357613823613972565b500190565b600060ff821660ff84168060ff0382111561384557613845613972565b019392505050565b60008261385c5761385c613988565b500490565b600081600019048311821515161561387b5761387b613972565b500290565b60008282101561389257613892613972565b500390565b600060ff821660ff8416808210156138b1576138b1613972565b90039392505050565b60005b838110156138d55781810151838201526020016138bd565b83811115610c545750506000910152565b6002810460018216806138fa57607f821691505b6020821081141561391b57634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561393557613935613972565b5060010190565b60008261394b5761394b613988565b500690565b600060ff83168061396357613963613988565b8060ff84160691505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461118557600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa26469706673582212209bfbb366c9eb234afbd7006c75a356fd69f769ff341cba0125bc43a1269c01ed64736f6c63430008000033

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

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