Contract 0x15Cc16BfE6fAC624247490AA29B6D632Be549F00 3

 

Contract Overview

AnonymiceBreeding: BABYMICE Token
Balance:
0 Ether

EtherValue:
$0.00

Token:
Txn Hash
Method
Block
From
To
Value
0x44e6085f6de14f17216cb5d37be1643ddada2689363a68042d03f97a06ce6296Safe Transfer Fr...153652642022-08-18 13:27:4110 mins ago0x32ff901a1d6b5e4dde2df10e2207b854e2c07360 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍0010354 11.‍93734778
0x4c705bda9833a755b10daf0941c56c43c99411b93e08caefa8bef08c2a788730Set Approval For...153641562022-08-18 9:18:554 hrs 19 mins agoENS Name namdeew.eth IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍0002758 5.‍95866098
0x69844660afe529da7918aaa187d7b6950ffc8cfba217a3cc84554970a6665eb7Set Approval For...153638492022-08-18 8:02:395 hrs 35 mins ago0x6161f07909e3bf10f21bdfdc5b3f21485b4dac3e IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00043717 9.‍44494849
0x058be51c8b82ca1f48290b931938e30d45bd72436c5651a47a57e7cb4a3431ceSet Approval For...153637932022-08-18 7:47:495 hrs 50 mins agoENS Name ridgey.eth IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00033725 7.‍28613253
0x7db00ab6067f24bcb3a5854ffafedaf86c839d2f08dbdd82b6bd7d77ea49dd8fSet Approval For...153619332022-08-18 0:46:3012 hrs 51 mins ago0xb8c99218c4831320d7d3f00972ce80449a05969c IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00049145 10.‍61751226
0x1f0624c6beb57491b6f05dd1c69cf9fef45ec80e0d8f7278ff119e1f4a3e92ccSet Approval For...153618982022-08-18 0:39:0312 hrs 59 mins ago0x560321dfd878329093578864d7b877d5e6745258 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00056308 12.‍16507236
0xc61549d8228844859351d27ed964d225eaf164ec7593350d13f5ca7d37ef03c7Set Approval For...153603822022-08-17 18:47:4318 hrs 50 mins ago0xd3867f140836f17eb421354abd9d73deb1ac2e72 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00108878 23.‍47980396
0x622302cf76b683fdd6e79296be424a0d58f3efa09c5bbde041dd85f2dff0fce6Set Approval For...153592622022-08-17 14:33:5423 hrs 4 mins ago0xb91f79e79ff17099b91edde43f234273bf59b847 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍0008861 19.‍14378494
0x575e45948d4d7a94deae2314d2b2a62f826576d052797ca4a1eedb0417f69dc4Set Approval For...153588732022-08-17 13:02:121 day 35 mins agoENS Name icogains.eth IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00040271 8.‍6846957
0x737af64eecfb9a1a71870700a33bbaab05cf1e605f4d63a379bed0a116c453dbSet Approval For...153562182022-08-17 3:05:511 day 10 hrs ago0x14e7c0a83ee77a9c40109e477ad86ae147c49f28 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00122718 26.‍51252505
0xa598964f23b84c82aa15659283b1b23b0504fe4c0fc42a421885d641633a2c70Set Approval For...153500202022-08-16 3:35:092 days 10 hrs ago0xbeac51d7b236cd18f18b499bd97719bfd7907913 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00060104 12.‍98512464
0x2554dd1ae5e46deca5a8edc0cba92d1153cb9ff04ff1ccedd045a0c65e8cba96Set Approval For...153492102022-08-16 0:34:582 days 13 hrs agoENS Name jackb.eth IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00067638 14.‍61277686
0x2207d85d70a0f424a38c5af3bccc03bf7732b6e36f00c0b3607fae7ae76d34c0Transfer From153483392022-08-15 21:21:302 days 16 hrs ago0xd0980a0f458fef22e0419c2f32be1c90418cf39c IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00280281 28.‍92958868
0x9263a99f50f72c9e0d6556d779cc1444982650d292022c6937e0b9eacdddf189Transfer From153450972022-08-15 8:49:503 days 4 hrs ago0xb63347d5f92147e0517e7a21766256dfa8ce83a7 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00109446 13.‍06194562
0xe9f2c68fcce156843904970c840c92460455af844e1f7ea5dc75bf2b1f16e40aSet Approval For...153450942022-08-15 8:48:493 days 4 hrs ago0xe040fbbcf57b504805d9c73fd4e6f37b5890ff6e IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍0005787 12.‍50252654
0x5b925a1b184ed8f8098f4fa112b9b4cb1729b8f9625deda1296f0f94f13ea2bcSet Approval For...153416752022-08-14 19:43:123 days 17 hrs agoENS Name potatoz.eth IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍000966 20.‍86985494
0xa1981eea0c3443fbce93b062787c1992d6cecb183dbcbcdef45d9fbb5e9b43faSet Approval For...153411972022-08-14 17:55:513 days 19 hrs agoENS Name hxy.eth IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00092028 19.‍88206763
0x97559c53afefe041c8306f0910a6d849428b41c116d6bb29f083c76f588dd57fSet Approval For...153379202022-08-14 5:39:164 days 7 hrs ago0x50a21fac563f3e78a34ebb2899f3f256c6062ea7 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00028421 6.‍14028822
0x445385853524701f1ccabb4916186cea01cf6d993308df8520cd768e4bd11ba2Set Approval For...153354372022-08-13 20:11:154 days 17 hrs agoENS Name kotaa.eth IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00076317 16.‍48796662
0x61a28736159435a930e20d13b0602f8aca31ba907225b57837b2005a69bebffdSet Approval For...153345442022-08-13 16:50:214 days 20 hrs ago0x917aa1fe4ee8154ce8c4eeb8f4768ba615245799 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00061396 13.‍26425629
0x1da0eb1df1928ec40deb062959b595bef91ccd6d247560d6615b3b09db5d087aTransfer From153327282022-08-13 9:54:535 days 3 hrs agoENS Name micelab.eth IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍0007494 7.‍73508258
0xae7df3586296fca965473314220ac516fa1b8ea6a68be519896ce5eabe8bc7eaSet Approval For...153326612022-08-13 9:41:285 days 3 hrs agoENS Name micelab.eth IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍0005316 11.‍48488172
0xe1f01e7c473e991ce78fadd20224128c512574f1b872e0e77d885ef89197dfebSet Approval For...153294962022-08-12 21:48:565 days 15 hrs ago0x4eb1fe21bf749f6c5c2d3e7cfddc4fe1bc81be10 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00048424 10.‍4617358
0x9aad869fbb1f4cc4f2b16c89a8ba41c8ba41dbfcb689e44b7f1c6f3faa1e004cSet Approval For...153294182022-08-12 21:31:185 days 16 hrs ago0xce43e2b408c51392e03a7d227dbc8e7ba3f798b8 IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍0004225 9.‍12798875
0x0246211bcab8be2e538e3453645748555062dc182d788be639acbe213f23dab5Set Approval For...153286642022-08-12 18:47:415 days 18 hrs ago0x007f9d679769aa139b969eb524bb2d902e2c0fee IN  AnonymiceBreeding: BABYMICE Token0 Ether0.‍00131517 28.‍36200599
[ Download CSV Export 

OVERVIEW

The first 100% on-chain breeding NFT! Everything you see here is entirely on-chain, no external dependencies, no IPFS, no API. Just Ethereum.To breed a baby, you need 2 **[Anonymice Parents](https://opensea.io/collection/anonymice/)** and 50 CHEETH. Each parent can be staked...

View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AnonymiceBreeding

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 19 : 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 2 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 3 of 19 : 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 4 of 19 : 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 5 of 19 : 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 6 of 19 : 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 7 of 19 : 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 8 of 19 : 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 9 of 19 : 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 10 of 19 : 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 19 : 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 12 of 19 : 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 13 of 19 : 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 14 of 19 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 15 of 19 : AnonymiceBreeding.sol
// SPDX-License-Identifier: Anonymice License, Version 1.0

/*
Copyright 2021 Anonymice

Licensed under the Anonymice License, Version 1.0 (the “License”); you may not use this code except in compliance with the License.
You may obtain a copy of the License at https://doz7mjeufimufl7fa576j6kq5aijrwezk7tvdgvzrfr3d6njqwea.arweave.net/G7P2JJQqGUKv5Qd_5PlQ6BCY2JlX51GauYljsfmphYg

Unless required by applicable law or agreed to in writing, code distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
*/

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./ICheeth.sol";
import "./IAnonymice.sol";
import "./AnonymiceLibrary.sol";
import "./IAnonymiceBreedingDescriptor.sol";

contract AnonymiceBreeding is ERC721Enumerable, Ownable {
    /*
           _   _  ____  _   ___     ____  __ _____ _____ ______   ____  _____  ______ ______ _____ _____ _   _  _____ 
     /\   | \ | |/ __ \| \ | \ \   / /  \/  |_   _/ ____|  ____| |  _ \|  __ \|  ____|  ____|  __ \_   _| \ | |/ ____|
    /  \  |  \| | |  | |  \| |\ \_/ /| \  / | | || |    | |__    | |_) | |__) | |__  | |__  | |  | || | |  \| | |  __ 
   / /\ \ | . ` | |  | | . ` | \   / | |\/| | | || |    |  __|   |  _ <|  _  /|  __| |  __| | |  | || | | . ` | | |_ |
  / ____ \| |\  | |__| | |\  |  | |  | |  | |_| || |____| |____  | |_) | | \ \| |____| |____| |__| || |_| |\  | |__| |
 /_/    \_\_| \_|\____/|_| \_|  |_|  |_|  |_|_____\_____|______| |____/|_|  \_\______|______|_____/_____|_| \_|\_____|
                                                                                                                                                                                                                             
*/

    using AnonymiceLibrary for uint8;
    using Counters for Counters.Counter;

    //addresses
    address CHEETH_ADDRESS;
    address ANONYMICE_ADDRESS;
    address ANONYMICE_BREEDING_DESCRIPTOR_ADDRESS;
    address PUZZLE_ADDRESS;

    struct BreedingEvent {
        uint256 breedingEventId;
        uint256 parentId1;
        uint256 parentId2;
        uint256 childId;
        uint256 releaseBlock;
    }

    struct Incubator {
        uint256 parentId1;
        uint256 parentId2;
        uint256 childId;
        uint256 revealBlock;
    }

    mapping(uint256 => bool) public _breedingEventIdToActive;
    mapping(uint256 => uint256) public _breedingEventIdToIndex;

    mapping(address => BreedingEvent[]) public _addressToBreedingEvents;
    mapping(uint256 => bool) public _tokenToRevealed;
    mapping(uint256 => Incubator) public _tokenToIncubator;

    mapping(uint256 => string) internal tokenIdToHash;
    mapping(uint256 => bool) public _tokenIdToLegendary;
    mapping(uint256 => uint8) public _tokenIdToLegendaryNumber;
    mapping(uint256 => address) public _parentTokenIdToOwner;

    uint256 SEED_NONCE = 0;
    uint256 MAX_BABY_SUPPLY = 3550;
    uint256 BASE_CHEETH_COST = 50000000000000000000;
    uint256 CHEETH_COST_PER_BLOCK = 500000000000000;

    uint256 BLOCKS_TILL_REVEAL = 50000;
    uint256 BLOCKS_TILL_RELEASE = 50000;

    bool public BREEDING_LIVE = false;

    uint8 public legendariesMinted = 0;

    Counters.Counter private _currentBreedingEventId;

    //uint arrays
    uint16[][10] TIERS;

    uint16[9] LEGENDARY_TIERS = [100, 100, 100, 200, 200, 200, 300, 300, 300];

    constructor() ERC721("AnonymiceBreeding", "BABYMICE") {
        //Declare all the rarity tiers

        //Hat
        TIERS[0] = [50, 150, 200, 300, 850, 850, 850, 900, 150, 5700];
        //whiskers
        TIERS[1] = [200, 800, 1000, 3000, 5000];
        //Neck
        TIERS[2] = [300, 800, 900, 1000, 7000];
        //Earrings
        TIERS[3] = [50, 200, 300, 300, 9150];
        //Eyes
        TIERS[4] = [50, 100, 400, 450, 500, 700, 1800, 2000, 2000, 2000];
        //Mouth
        TIERS[5] = [1428, 1428, 1428, 1429, 1429, 1429, 1429];
        //Nose
        TIERS[6] = [2000, 2000, 2000, 2000, 2000];
        //Character
        TIERS[7] = [20, 70, 721, 1000, 1155, 1200, 1300, 1434, 1541, 1559];

        //Character traits adjusted for OG owners
        TIERS[8] = [30, 80, 721, 1000, 1155, 1200, 1300, 1434, 1541, 1539];
        TIERS[9] = [40, 90, 721, 1000, 1155, 1200, 1300, 1434, 1541, 1519];
    }

    function flipBreedingSwitch() public {
        //Only puzzle wallet may start breeding
        require(msg.sender == PUZZLE_ADDRESS, "This is not the puzzle address.");

        BREEDING_LIVE = true;
    }

    function initiateBreeding(uint256 _parentId1, uint256 _parentId2) public {
        require(BREEDING_LIVE == true, "Breeding is not live.");
        require(totalSupply() < MAX_BABY_SUPPLY, "Max supply reached!");

        //Require they are the owners of both parents.
        require(
            IAnonymice(ANONYMICE_ADDRESS).ownerOf(_parentId1) == msg.sender &&
                IAnonymice(ANONYMICE_ADDRESS).ownerOf(_parentId2) == msg.sender
        , "You do not own both Anonymice.");

        //Burn cheeth
        ICheeth(CHEETH_ADDRESS).burnFrom(msg.sender, BASE_CHEETH_COST);

        //Transfer parent 1
        IAnonymice(ANONYMICE_ADDRESS).transferFrom(
            msg.sender,
            address(this),
            _parentId1
        );

        //Tranfer parent 2
        IAnonymice(ANONYMICE_ADDRESS).transferFrom(
            msg.sender,
            address(this),
            _parentId2
        );

        //Set this babies tokenId to the total supply
        uint256 _tokenId = totalSupply();

        _currentBreedingEventId.increment();

        uint256 _thisBreedingEventId = _currentBreedingEventId.current();

        //Add this breeding event to their mapping.
        _addressToBreedingEvents[msg.sender].push(
            BreedingEvent(
                _thisBreedingEventId,
                _parentId1,
                _parentId2,
                _tokenId,
                block.number + BLOCKS_TILL_RELEASE
            )
        );

        _breedingEventIdToActive[_thisBreedingEventId] = true;
        _breedingEventIdToIndex[_thisBreedingEventId] = _addressToBreedingEvents[msg.sender].length - 1;

        //Set this token to this breeding event.
        _tokenToIncubator[_tokenId] = Incubator(
            _parentId1,
            _parentId2,
            _tokenId,
            block.number + BLOCKS_TILL_REVEAL
        );

        //Map this tokenId as unrevealed
        _tokenToRevealed[_tokenId] = false;

        //Set the owner of these tokens
        _parentTokenIdToOwner[_parentId1] = msg.sender;
        _parentTokenIdToOwner[_parentId2] = msg.sender;

        //Mint them their unrevealed baby
        _mint(msg.sender, _tokenId);
    }

    function speedUpParentRelease(
        uint256 _breedingEventId,
        uint256 _cheethAmount
    ) public {
        require(_breedingEventIdToActive[_breedingEventId], "Breeding event not active.");
        uint256 thisBreedingEventIndex = _breedingEventIdToIndex[_breedingEventId];

        //Pull this breeding event
        BreedingEvent memory thisBreedingEvent = _addressToBreedingEvents[
            msg.sender
        ][thisBreedingEventIndex];

        
        require(thisBreedingEvent.breedingEventId == _breedingEventId, "Breeding event in mapping not equal to breeding event sent.");

        //Must be before the release time.
        require(block.number < thisBreedingEvent.releaseBlock, "Block number is greater than reveal block.");

        uint256 blocksToRemove = _cheethAmount / CHEETH_COST_PER_BLOCK;
        uint256 newReleaseBlock;

        if (blocksToRemove > thisBreedingEvent.releaseBlock) {
            newReleaseBlock = block.number;
        } else {
            newReleaseBlock = thisBreedingEvent.releaseBlock - blocksToRemove;
        }

        //Set the new release time.
        _addressToBreedingEvents[msg.sender][thisBreedingEventIndex]
            .releaseBlock = newReleaseBlock;

        //Burn cheeth
        ICheeth(CHEETH_ADDRESS).burnFrom(msg.sender, _cheethAmount);
    }

    function speedUpChildReveal(uint256 _tokenId, uint256 _cheethAmount)
        public
    {
        //Require it to be unrevealed
        require(_tokenToRevealed[_tokenId] == false, "This is already revealed");

        //Require that they own it
        require(ownerOf(_tokenId) == msg.sender, "You do not own this baby.");

        //Must be before the reveal time.
        require(block.number < _tokenToIncubator[_tokenId].revealBlock, "Block number is greater than reveal block.");

        uint256 blocksToRemove = _cheethAmount / CHEETH_COST_PER_BLOCK;
        uint256 newRevealBlock;

        if (blocksToRemove > _tokenToIncubator[_tokenId].revealBlock) {
            newRevealBlock = block.number;
        } else {
            newRevealBlock =
                _tokenToIncubator[_tokenId].revealBlock -
                blocksToRemove;
        }

        //Set the new reveal time.
        _tokenToIncubator[_tokenId].revealBlock = newRevealBlock;

        //Burn cheeth
        ICheeth(CHEETH_ADDRESS).burnFrom(msg.sender, _cheethAmount);
    }

    function _removeBreedingEvent(uint256 _breedingEventIndex) internal {
        uint256 _maxIndex = _addressToBreedingEvents[msg.sender].length - 1;


        uint256 idForItemToMove = _addressToBreedingEvents[msg.sender][_maxIndex].breedingEventId;
        uint256 idForItemToRemove = _addressToBreedingEvents[msg.sender][_breedingEventIndex].breedingEventId;

        
        if(_breedingEventIndex == _maxIndex){
            //Remove the final element
            _addressToBreedingEvents[msg.sender].pop();
            
            //Set the new index for the item that got removed;
            _breedingEventIdToIndex[idForItemToRemove] = 0;

            //Set this breeding event to finished.
            _breedingEventIdToActive[idForItemToRemove] = false;
            return;
        }
        
        //Replace this breeding event with the final one.
        _addressToBreedingEvents[msg.sender][_breedingEventIndex] = _addressToBreedingEvents[msg.sender][_maxIndex];

        //Set the new index for the final item that got moved
        _breedingEventIdToIndex[idForItemToMove] = _breedingEventIndex;
        
        //Remove the final element
        _addressToBreedingEvents[msg.sender].pop();

        //Set the new index for the item that got removed;
        _breedingEventIdToIndex[idForItemToRemove] = 0;

        //Set this breeding event to finished.
        _breedingEventIdToActive[idForItemToRemove] = false;

    }

    function pullParentsByBreedingEventId(uint256 _breedingEventId) public {
        require(_breedingEventIdToActive[_breedingEventId], "Breeding event no longer active.");

        uint256 thisBreedingEventIndex = _breedingEventIdToIndex[_breedingEventId];

        require(_addressToBreedingEvents[msg.sender][thisBreedingEventIndex].breedingEventId == _breedingEventId, "Breeding event ID does not match Breeding event ID found in mapping.");

        pullParentsByBreedingEventIndex(thisBreedingEventIndex);
    }

    function pullParentsByBreedingEventIndex(uint256 _breedingEventIndex)
        public
    {
        //Pull this breeding event
        BreedingEvent memory thisBreedingEvent = _addressToBreedingEvents[
            msg.sender
        ][_breedingEventIndex];

        //Must be beyond the time to pull parents.
        require(block.number >= thisBreedingEvent.releaseBlock, "Block number is less than release block.");

        //Transfer parent 1
        IAnonymice(ANONYMICE_ADDRESS).transferFrom(
            address(this),
            msg.sender,
            thisBreedingEvent.parentId1
        );

        //Tranfer parent 2
        IAnonymice(ANONYMICE_ADDRESS).transferFrom(
            address(this),
            msg.sender,
            thisBreedingEvent.parentId2
        );

        //Set the owner to the zero address
        _parentTokenIdToOwner[thisBreedingEvent.parentId1] = address(0x0);
        _parentTokenIdToOwner[thisBreedingEvent.parentId2] = address(0x0);

        _removeBreedingEvent(_breedingEventIndex);
    }

    /**
     * @dev Converts a digit from 0 - 10000 into its corresponding rarity based on the given rarity tier.
     * @param _randinput The input from 0 - 10000 to use for rarity gen.
     * @param _rarityTier The tier to use.
     */
    function rarityGen(uint256 _randinput, uint8 _rarityTier)
        internal
        view
        returns (string memory)
    {
        uint16 currentLowerBound = 0;
        for (uint8 i = 0; i < TIERS[_rarityTier].length; i++) {
            uint16 thisPercentage = TIERS[_rarityTier][i];
            if (
                _randinput >= currentLowerBound &&
                _randinput < currentLowerBound + thisPercentage
            ) return i.toString();
            currentLowerBound = currentLowerBound + thisPercentage;
        }

        revert("Rarity gen failed");
    }

    function generateRandomNumber(uint256 _tokenId, uint256 limit)
        internal
        returns (uint256)
    {
        SEED_NONCE++;

        return
            uint256(
                keccak256(
                    abi.encodePacked(
                        block.timestamp,
                        block.difficulty,
                        _tokenId,
                        msg.sender,
                        SEED_NONCE
                    )
                )
            ) % limit;
    }

    function generateChildHash(
        uint256 _tokenId,
        string memory _parentHash1,
        string memory _parentHash2,
        uint8 _OGParentCount
    ) internal returns (string memory) {
        //Genetic traits - 1,4,5,6,7
        //Accessory traits - 0,2,3
        bytes memory childHashBytes;
        _OGParentCount;

        for (uint8 i = 0; i < 9; i++) {
            uint256 geneticDecider = generateRandomNumber(_tokenId, 100);
            string memory appendString;

            if (i == 0) {
                //Burned
                appendString = "0";
                childHashBytes = abi.encodePacked(childHashBytes, appendString);
                continue;
            }

            if (i == 1 || i == 5) {
                //Hat
                //Eyes
                if (geneticDecider >= 0 && geneticDecider < 5)
                    appendString = AnonymiceLibrary.substring(
                        _parentHash1,
                        i,
                        i + 1
                    );
                if (geneticDecider >= 5 && geneticDecider < 10)
                    appendString = AnonymiceLibrary.substring(
                        _parentHash2,
                        i,
                        i + 1
                    );
                if (geneticDecider >= 10 && geneticDecider <= 99)
                    appendString = rarityGen(
                        generateRandomNumber(_tokenId, 10000),
                        i - 1
                    );
                childHashBytes = abi.encodePacked(childHashBytes, appendString);
                continue;
            }

            if (i == 2 || i == 6 || i == 7) {
                //Whiskers
                //Mouth
                //Nose
                if (geneticDecider >= 0 && geneticDecider < 40)
                    appendString = AnonymiceLibrary.substring(
                        _parentHash1,
                        i,
                        i + 1
                    );
                if (geneticDecider >= 40 && geneticDecider < 80)
                    appendString = AnonymiceLibrary.substring(
                        _parentHash2,
                        i,
                        i + 1
                    );
                if (geneticDecider >= 80 && geneticDecider <= 100)
                    appendString = rarityGen(
                        generateRandomNumber(_tokenId, 10000),
                        i - 1
                    );
                childHashBytes = abi.encodePacked(childHashBytes, appendString);
                continue;
            }

            if (i == 3 || i == 4) {
                //Neck
                //Earrings
                if (geneticDecider >= 0 && geneticDecider < 15)
                    appendString = AnonymiceLibrary.substring(
                        _parentHash1,
                        i,
                        i + 1
                    );

                if (geneticDecider >= 15 && geneticDecider < 30)
                    appendString = AnonymiceLibrary.substring(
                        _parentHash2,
                        i,
                        i + 1
                    );

                if (geneticDecider >= 30 && geneticDecider <= 100)
                    appendString = rarityGen(
                        generateRandomNumber(_tokenId, 10000),
                        i - 1
                    );
                childHashBytes = abi.encodePacked(childHashBytes, appendString);
                continue;
            }

            if (i == 8) {
                //Character
                string memory parent1Character = AnonymiceLibrary.substring(
                    _parentHash1,
                    i,
                    i + 1
                );

                string memory parent2Character = AnonymiceLibrary.substring(
                    _parentHash2,
                    i,
                    i + 1
                );

                uint8 parent1Chance;
                uint8 parent2Chance;

                //If parent 1 character is glitched or irradiated, give child a 5% chance
                keccak256(abi.encodePacked(parent1Character)) ==
                    keccak256("0") ||
                    keccak256(abi.encodePacked(parent1Character)) ==
                    keccak256("1")
                    ? parent1Chance = 5
                    : parent1Chance = 40;

                //If parent 2 character is glitched or irradiated, give child a 5% chance
                keccak256(abi.encodePacked(parent2Character)) ==
                    keccak256("0") ||
                    keccak256(abi.encodePacked(parent2Character)) ==
                    keccak256("1")
                    ? parent2Chance = 5
                    : parent2Chance = 40;

                if (geneticDecider >= 0 && geneticDecider < parent1Chance)
                    appendString = AnonymiceLibrary.substring(
                        _parentHash1,
                        i,
                        i + 1
                    );

                if (
                    geneticDecider >= parent1Chance &&
                    geneticDecider < parent1Chance + parent2Chance
                )
                    appendString = AnonymiceLibrary.substring(
                        _parentHash2,
                        i,
                        i + 1
                    );

                if (
                    geneticDecider >= parent1Chance + parent2Chance &&
                    geneticDecider <= 100
                ) {
                    if (_OGParentCount == 0)
                        appendString = rarityGen(
                            generateRandomNumber(_tokenId, 10000),
                            i - 1
                        );
                    if (_OGParentCount == 1)
                        appendString = rarityGen(
                            generateRandomNumber(_tokenId, 10000),
                            i
                        );
                    if (_OGParentCount == 2)
                        appendString = rarityGen(
                            generateRandomNumber(_tokenId, 10000),
                            i + 1
                        );
                }

                childHashBytes = abi.encodePacked(childHashBytes, appendString);
                continue;
            }
        }

        return string(childHashBytes);

        //Hat - a
        //whiskers - g
        //Neck - a
        //Earrings - a
        //Eyes - g
        //Mouth - g
        //Nose - g
        //Character - g
    }

    function revealBaby(uint256 _tokenId) public {
        //Require this to not be a contract
        require(msg.sender == tx.origin, "Contracts not allowed to reveal");

        //Require that they own it
        require(ownerOf(_tokenId) == msg.sender, "You do not own this baby.");

        //It must be revealable right now
        require(block.number >= _tokenToIncubator[_tokenId].revealBlock, "Block number is less than the reveal block.");

        //It must be unrevealed
        require(_tokenToRevealed[_tokenId] == false, "Token is already revealed");

        if (legendariesMinted < 9) {
            uint256 legendaryDecider = generateRandomNumber(
                _tokenId,
                LEGENDARY_TIERS[legendariesMinted]
            );

            if (legendaryDecider == 0) {
                //This is a legendary
                _tokenIdToLegendary[_tokenId] = true;

                legendariesMinted++;

                //It will assign this legendary
                _tokenIdToLegendaryNumber[_tokenId] = legendariesMinted;

                //Make it view as revealed
                _tokenToRevealed[_tokenId] = true;
                return;
            }
        }

        uint8 _OGParentCount;

        if (_tokenToIncubator[_tokenId].parentId1 < 2000) _OGParentCount++;
        if (_tokenToIncubator[_tokenId].parentId2 < 2000) _OGParentCount++;

        //This will not be a legendary
        _tokenIdToLegendary[_tokenId] = false;

        //Set its hash as to what is generated
        tokenIdToHash[_tokenId] = generateChildHash(
            _tokenId,
            IAnonymice(ANONYMICE_ADDRESS)._tokenIdToHash(
                _tokenToIncubator[_tokenId].parentId1
            ),
            IAnonymice(ANONYMICE_ADDRESS)._tokenIdToHash(
                _tokenToIncubator[_tokenId].parentId2
            ),
            _OGParentCount
        );

        //Make it view as revealed
        _tokenToRevealed[_tokenId] = true;
    }

    function setAddresses(
        address _descriptorAddress,
        address _anonymiceAddress,
        address _cheethAddress,
        address _puzzleAddress
    ) public onlyOwner {
        ANONYMICE_BREEDING_DESCRIPTOR_ADDRESS = _descriptorAddress;
        CHEETH_ADDRESS = _cheethAddress;
        ANONYMICE_ADDRESS = _anonymiceAddress;
        PUZZLE_ADDRESS = _puzzleAddress;
    }

    function getBreedingEventsLengthByAddress(address breeder)
        public
        view
        returns (uint256)
    {
        return _addressToBreedingEvents[breeder].length;
    }

    /**
     * @dev Returns a hash for a given tokenId
     * @param _tokenId The tokenId to return the hash for.
     */
    function _tokenIdToHash(uint256 _tokenId)
        public
        view
        returns (string memory)
    {
        string memory tokenHash = tokenIdToHash[_tokenId];
        //If this is a burned token, override the previous hash
        if (ownerOf(_tokenId) == 0x000000000000000000000000000000000000dEaD) {
            tokenHash = string(
                abi.encodePacked(
                    "1",
                    AnonymiceLibrary.substring(tokenHash, 1, 9)
                )
            );
        }

        return tokenHash;
    }

    function tokenURI(uint256 _tokenId)
        public
        view
        override
        returns (string memory)
    {
        return
            IAnonymiceBreedingDescriptor(ANONYMICE_BREEDING_DESCRIPTOR_ADDRESS)
                .tokenURI(_tokenId);
    }
}

File 16 of 19 : AnonymiceLibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

library AnonymiceLibrary {
    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;
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        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);
    }

    function parseInt(string memory _a)
        internal
        pure
        returns (uint8 _parsedInt)
    {
        bytes memory bresult = bytes(_a);
        uint8 mint = 0;
        for (uint8 i = 0; i < bresult.length; i++) {
            if (
                (uint8(uint8(bresult[i])) >= 48) &&
                (uint8(uint8(bresult[i])) <= 57)
            ) {
                mint *= 10;
                mint += uint8(bresult[i]) - 48;
            }
        }
        return mint;
    }

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

    function 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;
    }
}

File 17 of 19 : IAnonymice.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface IAnonymice is IERC721Enumerable {
    function _tokenIdToHash(uint256 _tokenId)
        external
        view
        returns (string memory);

    function hashToSVG(string memory _hash)
        external
        view
        returns (string memory);
}

File 18 of 19 : IAnonymiceBreedingDescriptor.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface IAnonymiceBreedingDescriptor is IERC721Enumerable {
    function tokenIdToMetadata(uint256 _tokenId)
        external
        view
        returns (string memory);

    function tokenIdToSVG(uint256 _tokenId)
        external
        view
        returns (string memory);

    function tokenURI(uint256 _tokenId)
        external
        view
        returns (string memory);
}

File 19 of 19 : ICheeth.sol
// contracts/ICheeth.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";


interface ICheeth is IERC20 {
    function burnFrom(address account, uint256 amount) external;
}

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

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":[],"name":"BREEDING_LIVE","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_addressToBreedingEvents","outputs":[{"internalType":"uint256","name":"breedingEventId","type":"uint256"},{"internalType":"uint256","name":"parentId1","type":"uint256"},{"internalType":"uint256","name":"parentId2","type":"uint256"},{"internalType":"uint256","name":"childId","type":"uint256"},{"internalType":"uint256","name":"releaseBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_breedingEventIdToActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_breedingEventIdToIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_parentTokenIdToOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"_tokenIdToHash","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tokenIdToLegendary","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tokenIdToLegendaryNumber","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tokenToIncubator","outputs":[{"internalType":"uint256","name":"parentId1","type":"uint256"},{"internalType":"uint256","name":"parentId2","type":"uint256"},{"internalType":"uint256","name":"childId","type":"uint256"},{"internalType":"uint256","name":"revealBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tokenToRevealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flipBreedingSwitch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"breeder","type":"address"}],"name":"getBreedingEventsLengthByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_parentId1","type":"uint256"},{"internalType":"uint256","name":"_parentId2","type":"uint256"}],"name":"initiateBreeding","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":"legendariesMinted","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_breedingEventId","type":"uint256"}],"name":"pullParentsByBreedingEventId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_breedingEventIndex","type":"uint256"}],"name":"pullParentsByBreedingEventIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"revealBaby","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":"_descriptorAddress","type":"address"},{"internalType":"address","name":"_anonymiceAddress","type":"address"},{"internalType":"address","name":"_cheethAddress","type":"address"},{"internalType":"address","name":"_puzzleAddress","type":"address"}],"name":"setAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_cheethAmount","type":"uint256"}],"name":"speedUpChildReveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_breedingEventId","type":"uint256"},{"internalType":"uint256","name":"_cheethAmount","type":"uint256"}],"name":"speedUpParentRelease","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"}]

6000601855610dde6019556802b5e3af16b1880000601a556601c6bf52634000601b5561c350601c819055601d55601e805461ffff191690556101a06040526064608081815260a082905260c09190915260c860e08190526101008190526101205261012c610140819052610160819052610180526200008490602a906009620004d6565b503480156200009257600080fd5b506040805180820182526011815270416e6f6e796d6963654272656564696e6760781b602080830191825283518085019094526008845267424142594d49434560c01b908401528151919291620000ec9160009162000573565b5080516200010290600190602084019062000573565b5050506200011f620001196200048060201b60201c565b62000484565b6040805161014081018252603281526096602080830182905260c89383019390935261012c60608301526103526080830181905260a0830181905260c083015261038460e0830152610100820152611644610120820152620001849190600a620005f0565b506040805160a08101825260c8815261032060208201526103e891810191909152610bb860608201526113886080820152620001c5906021906005620005f0565b506040805160a08101825261012c81526103206020820152610384918101919091526103e86060820152611b58608082015262000207906022906005620005f0565b506040805160a0810182526032815260c8602082015261012c91810182905260608101919091526123be608082015262000246906023906005620005f0565b5060408051610140810182526032815260646020820152610190918101919091526101c260608201526101f460808201526102bc60a082015261070860c08201526107d060e082018190526101008201819052610120820152620002af90602490600a620005f0565b506040805160e0810182526105948082526020820181905291810191909152610595606082018190526080820181905260a0820181905260c0820152620002fb906025906007620005f0565b506040805160a0810182526107d08082526020820181905291810182905260608101829052608081019190915262000338906026906005620005f0565b50604080516101408101825260148152604660208201526102d1918101919091526103e8606082015261048360808201526104b060a082015261051460c082015261059a60e0820152610605610100820152610617610120820152620003a390602790600a620005f0565b506040805161014081018252601e8152605060208201526102d1918101919091526103e8606082015261048360808201526104b060a082015261051460c082015261059a60e08201526106056101008201526106036101208201526200040e90602890600a620005f0565b50604080516101408101825260288152605a60208201526102d1918101919091526103e8606082015261048360808201526104b060a082015261051460c082015261059a60e08201526106056101008201526105ef6101208201526200047990602990600a620005f0565b50620006af565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600183019183908215620005615791602002820160005b838211156200052f57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302620004ed565b80156200055f5782816101000a81549061ffff02191690556002016020816001010492830192600103026200052f565b505b506200056f9291506200065b565b5090565b828054620005819062000672565b90600052602060002090601f016020900481019282620005a5576000855562000561565b82601f10620005c057805160ff191683800117855562000561565b8280016001018555821562000561579182015b8281111562000561578251825591602001919060010190620005d3565b82805482825590600052602060002090600f0160109004810192821562000561579160200282016000838211156200052f57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302620004ed565b5b808211156200056f57600081556001016200065c565b6002810460018216806200068757607f821691505b60208210811415620006a957634e487b7160e01b600052602260045260246000fd5b50919050565b613e8980620006bf6000396000f3fe608060405234801561001057600080fd5b506004361061023c5760003560e01c806367fa2bff1161013b578063b309df1f116100b8578063e985e9c51161007c578063e985e9c5146104e7578063ef11e1b9146104fa578063f2fde38b1461050d578063f413c62314610520578063f58338a7146105335761023c565b8063b309df1f14610488578063b88d4fde1461049b578063c87b56dd146104ae578063d98237d1146104c1578063defd6b02146104d45761023c565b80638da5cb5b116100ff5780638da5cb5b1461042e57806395d89b4114610436578063a22cb4651461043e578063a3b576ae14610451578063af37e2ab146104755761023c565b806367fa2bff146103e557806368f882c9146103f857806370a0823114610400578063715018a61461041357806371bf55d41461041b5761023c565b806323b872dd116101c95780634a945f8d1161018d5780634a945f8d146103815780634b7cb14e146103945780634f6ccce71461039c57806351bb3a9e146103af5780636352211e146103d25761023c565b806323b872dd14610315578063276b5d7f146103285780632f745c591461034857806342842e0e1461035b57806349b8feef1461036e5761023c565b806306fdde031161021057806306fdde03146102b2578063081812fc146102ba578063095ea7b3146102da57806318160ddd146102ed5780631d2f4e01146103025761023c565b80625ea3071461024157806301b22ab11461026a57806301ffc9a71461027f578063033c16931461029f575b600080fd5b61025461024f366004613197565b61053b565b604051610261919061333f565b60405180910390f35b61027d6102783660046131af565b610634565b005b61029261028d3660046130ec565b61079f565b6040516102619190613334565b61027d6102ad366004613197565b6107c4565b610254610b48565b6102cd6102c8366004613197565b610bda565b60405161026191906132a6565b61027d6102e83660046130c1565b610c1d565b6102f5610cb5565b6040516102619190613be1565b610292610310366004613197565b610cbb565b61027d610323366004612fa9565b610cd0565b61033b610336366004613197565b610d08565b6040516102619190613c28565b6102f56103563660046130c1565b610d1d565b61027d610369366004612fa9565b610d72565b61029261037c366004613197565b610d8d565b61027d61038f366004612f4e565b610da2565b610292610e30565b6102f56103aa366004613197565b610e39565b6103c26103bd366004613197565b610e94565b6040516102619493929190613bea565b6102cd6103e0366004613197565b610ebb565b6102cd6103f3366004613197565b610ef0565b61033b610f0b565b6102f561040e366004612ede565b610f19565b61027d610f5d565b61027d6104293660046131af565b610fa8565b6102cd611418565b610254611427565b61027d61044c366004613090565b611436565b61046461045f3660046130c1565b611504565b604051610261959493929190613c05565b61027d6104833660046131af565b611552565b61027d610496366004613197565b611740565b61027d6104a9366004612fe9565b6118f4565b6102546104bc366004613197565b61192d565b61027d6104cf366004613197565b6119b2565b6102926104e2366004613197565b611a58565b6102926104f5366004612f16565b611a6d565b6102f5610508366004612ede565b611a9b565b61027d61051b366004612ede565b611ab6565b6102f561052e366004613197565b611b24565b61027d611b36565b60008181526014602052604081208054606092919061055990613d5c565b80601f016020809104026020016040519081016040528092919081815260200182805461058590613d5c565b80156105d25780601f106105a7576101008083540402835291602001916105d2565b820191906000526020600020905b8154815290600101906020018083116105b557829003601f168201915b505050505090506105e283610ebb565b6001600160a01b031661dead6001600160a01b0316141561062c5761060a8160016009611b6f565b60405160200161061a9190613247565b60405160208183030381529060405290505b90505b919050565b60008281526012602052604090205460ff161561066c5760405162461bcd60e51b8152600401610663906134ce565b60405180910390fd5b3361067683610ebb565b6001600160a01b03161461069c5760405162461bcd60e51b815260040161066390613505565b60008281526013602052604090206003015443106106cc5760405162461bcd60e51b8152600401610663906135ee565b6000601b54826106dc9190613ce2565b60008481526013602052604081206003015491925090821115610700575043610720565b60008481526013602052604090206003015461071d908390613cf6565b90505b60008481526013602052604090819020600301829055600b54905163079cc67960e41b81526001600160a01b03909116906379cc679090610767903390879060040161331b565b600060405180830381600087803b15801561078157600080fd5b505af1158015610795573d6000803e3d6000fd5b5050505050505050565b60006001600160e01b0319821663780e9d6360e01b148061062c575061062c82611c66565b3332146107e35760405162461bcd60e51b815260040161066390613baa565b336107ed82610ebb565b6001600160a01b0316146108135760405162461bcd60e51b815260040161066390613505565b6000818152601360205260409020600301544310156108445760405162461bcd60e51b8152600401610663906138aa565b60008181526012602052604090205460ff16156108735760405162461bcd60e51b8152600401610663906135b7565b601e54600961010090910460ff16101561097857601e546000906108df908390602a90610100900460ff16600981106108bc57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff1661ffff16611ca6565b905080610976576000828152601560205260409020805460ff19166001908117909155601e8054610100900460ff169161091883613db2565b825460ff91821661010093840a9081029083021990911617909255601e546000868152601660209081526040808320805460ff199081169690950490961694909417909455601290935291208054909116600117905550610b459050565b505b6000818152601360205260408120546107d0111561099e578061099a81613db2565b9150505b6000828152601360205260409020600101546107d011156109c757806109c381613db2565b9150505b6000828152601560209081526040808320805460ff19169055600c54601390925291829020549151625ea30760e01b8152610b069285926001600160a01b031691625ea30791610a1991600401613be1565b60006040518083038186803b158015610a3157600080fd5b505afa158015610a45573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a6d9190810190613124565b600c5460008681526013602052604090819020600101549051625ea30760e01b81526001600160a01b0390921691625ea30791610aac91600401613be1565b60006040518083038186803b158015610ac457600080fd5b505afa158015610ad8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b009190810190613124565b84611d02565b60008381526014602090815260409091208251610b299391929190910190612e45565b50506000818152601260205260409020805460ff191660011790555b50565b606060008054610b5790613d5c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8390613d5c565b8015610bd05780601f10610ba557610100808354040283529160200191610bd0565b820191906000526020600020905b815481529060010190602001808311610bb357829003601f168201915b5050505050905090565b6000610be582612220565b610c015760405162461bcd60e51b8152600401610663906137e0565b506000908152600460205260409020546001600160a01b031690565b6000610c2882610ebb565b9050806001600160a01b0316836001600160a01b03161415610c5c5760405162461bcd60e51b8152600401610663906139f3565b806001600160a01b0316610c6e61223d565b6001600160a01b03161480610c8a5750610c8a816104f561223d565b610ca65760405162461bcd60e51b815260040161066390613684565b610cb08383612241565b505050565b60085490565b600f6020526000908152604090205460ff1681565b610ce1610cdb61223d565b826122af565b610cfd5760405162461bcd60e51b815260040161066390613a34565b610cb083838361232c565b60166020526000908152604090205460ff1681565b6000610d2883610f19565b8210610d465760405162461bcd60e51b815260040161066390613389565b506001600160a01b03821660009081526006602090815260408083208484529091529020545b92915050565b610cb0838383604051806020016040528060008152506118f4565b60126020526000908152604090205460ff1681565b610daa61223d565b6001600160a01b0316610dbb611418565b6001600160a01b031614610de15760405162461bcd60e51b81526004016106639061382c565b600d80546001600160a01b03199081166001600160a01b0396871617909155600b8054821693861693909317909255600c8054831693851693909317909255600e805490911691909216179055565b601e5460ff1681565b6000610e43610cb5565b8210610e615760405162461bcd60e51b815260040161066390613afa565b60088281548110610e8257634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60136020526000908152604090208054600182015460028301546003909301549192909184565b6000818152600260205260408120546001600160a01b03168061062c5760405162461bcd60e51b81526004016106639061372b565b6017602052600090815260409020546001600160a01b031681565b601e54610100900460ff1681565b60006001600160a01b038216610f415760405162461bcd60e51b8152600401610663906136e1565b506001600160a01b031660009081526003602052604090205490565b610f6561223d565b6001600160a01b0316610f76611418565b6001600160a01b031614610f9c5760405162461bcd60e51b81526004016106639061382c565b610fa66000612459565b565b601e5460ff161515600114610fcf5760405162461bcd60e51b815260040161066390613b7b565b601954610fda610cb5565b10610ff75760405162461bcd60e51b815260040161066390613a85565b600c546040516331a9108f60e11b815233916001600160a01b031690636352211e90611027908690600401613be1565b60206040518083038186803b15801561103f57600080fd5b505afa158015611053573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110779190612efa565b6001600160a01b03161480156111135750600c546040516331a9108f60e11b815233916001600160a01b031690636352211e906110b8908590600401613be1565b60206040518083038186803b1580156110d057600080fd5b505afa1580156110e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111089190612efa565b6001600160a01b0316145b61112f5760405162461bcd60e51b815260040161066390613352565b600b54601a5460405163079cc67960e41b81526001600160a01b03909216916379cc6790916111639133919060040161331b565b600060405180830381600087803b15801561117d57600080fd5b505af1158015611191573d6000803e3d6000fd5b5050600c546040516323b872dd60e01b81526001600160a01b0390911692506323b872dd91506111c9903390309087906004016132ba565b600060405180830381600087803b1580156111e357600080fd5b505af11580156111f7573d6000803e3d6000fd5b5050600c546040516323b872dd60e01b81526001600160a01b0390911692506323b872dd915061122f903390309086906004016132ba565b600060405180830381600087803b15801561124957600080fd5b505af115801561125d573d6000803e3d6000fd5b50505050600061126b610cb5565b9050611277601f6124ab565b6000611283601f6124b4565b905060116000336001600160a01b03166001600160a01b031681526020019081526020016000206040518060a00160405280838152602001868152602001858152602001848152602001601d54436112db9190613ca5565b90528154600181810184556000938452602080852084516005909402019283558084015183830155604080850151600285015560608501516003850155608090940151600490930192909255848452600f8252828420805460ff19168217905533845260119091529120546113509190613cf6565b60106000838152602001908152602001600020819055506040518060800160405280858152602001848152602001838152602001601c54436113929190613ca5565b905260008381526013602090815260408083208451815584830151600182015584820151600282015560609094015160039094019390935560128152828220805460ff19169055868252601790528181208054336001600160a01b03199182168117909255868352929091208054909216811790915561141290836124b8565b50505050565b600a546001600160a01b031690565b606060018054610b5790613d5c565b61143e61223d565b6001600160a01b0316826001600160a01b0316141561146f5760405162461bcd60e51b815260040161066390613580565b806005600061147c61223d565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556114c061223d565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516114f89190613334565b60405180910390a35050565b6011602052816000526040600020818154811061152057600080fd5b600091825260209091206005909102018054600182015460028301546003840154600490940154929550909350919085565b6000828152600f602052604090205460ff166115805760405162461bcd60e51b8152600401610663906139bc565b600082815260106020908152604080832054338452601190925282208054919291839081106115bf57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505090508381600001511461162f5760405162461bcd60e51b8152600401610663906138f5565b806080015143106116525760405162461bcd60e51b8152600401610663906135ee565b6000601b54846116629190613ce2565b90506000826080015182111561167957504361168c565b8183608001516116899190613cf6565b90505b3360009081526011602052604090208054829190869081106116be57634e487b7160e01b600052603260045260246000fd5b600091825260209091206004600590920201810191909155600b5460405163079cc67960e41b81526001600160a01b03909116916379cc6790916117069133918a910161331b565b600060405180830381600087803b15801561172057600080fd5b505af1158015611734573d6000803e3d6000fd5b50505050505050505050565b33600090815260116020526040812080548390811061176f57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481525050905080608001514310156117e05760405162461bcd60e51b815260040161066390613ab2565b600c5460208201516040516323b872dd60e01b81526001600160a01b03909216916323b872dd9161181791309133916004016132ba565b600060405180830381600087803b15801561183157600080fd5b505af1158015611845573d6000803e3d6000fd5b5050600c5460408085015190516323b872dd60e01b81526001600160a01b0390921693506323b872dd925061188091309133916004016132ba565b600060405180830381600087803b15801561189a57600080fd5b505af11580156118ae573d6000803e3d6000fd5b50505060208083015160009081526017909152604080822080546001600160a01b0319908116909155818501518352912080549091169055506118f082612597565b5050565b6119056118ff61223d565b836122af565b6119215760405162461bcd60e51b815260040161066390613a34565b61141284848484612820565b600d5460405163c87b56dd60e01b81526060916001600160a01b03169063c87b56dd9061195e908590600401613be1565b60006040518083038186803b15801561197657600080fd5b505afa15801561198a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261062c9190810190613124565b6000818152600f602052604090205460ff166119e05760405162461bcd60e51b815260040161066390613b46565b6000818152601060209081526040808320543384526011909252909120805483919083908110611a2057634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016000015414611a4f5760405162461bcd60e51b815260040161066390613952565b6118f081611740565b60156020526000908152604090205460ff1681565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6001600160a01b031660009081526011602052604090205490565b611abe61223d565b6001600160a01b0316611acf611418565b6001600160a01b031614611af55760405162461bcd60e51b81526004016106639061382c565b6001600160a01b038116611b1b5760405162461bcd60e51b815260040161066390613426565b610b4581612459565b60106020526000908152604090205481565b600e546001600160a01b03163314611b605760405162461bcd60e51b815260040161066390613774565b601e805460ff19166001179055565b6060836000611b7e8585613cf6565b67ffffffffffffffff811115611ba457634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611bce576020820181803683370190505b509050845b84811015611c5c57828181518110611bfb57634e487b7160e01b600052603260045260246000fd5b01602001516001600160f81b03191682611c158884613cf6565b81518110611c3357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535080611c5481613d97565b915050611bd3565b5095945050505050565b60006001600160e01b031982166380ac58cd60e01b1480611c9757506001600160e01b03198216635b5e139f60e01b145b8061062c575061062c82612853565b6018805460009182611cb783613d97565b91905055508142448533601854604051602001611cd8959493929190613270565b6040516020818303038152906040528051906020012060001c611cfb9190613dd2565b9392505050565b60608060005b60098160ff161015612214576000611d21886064611ca6565b9050606060ff8316611d7457604051806040016040528060018152602001600360fc1b81525090508381604051602001611d5c9291906131fc565b60405160208183030381529060405293505050612202565b8260ff1660011480611d8957508260ff166005145b15611e2d576005821015611db557611db28860ff8516611daa866001613cbd565b60ff16611b6f565b90505b60058210158015611dc65750600a82105b15611de157611dde8760ff8516611daa866001613cbd565b90505b600a8210158015611df3575060638211155b15611e1a57611e17611e078a612710611ca6565b611e12600186613d0d565b61286c565b90505b8381604051602001611d5c9291906131fc565b8260ff1660021480611e4257508260ff166006145b80611e5057508260ff166007145b15611ec3576028821015611e7457611e718860ff8516611daa866001613cbd565b90505b60288210158015611e855750605082105b15611ea057611e9d8760ff8516611daa866001613cbd565b90505b60508210158015611df3575060648211611e1a57611e17611e078a612710611ca6565b8260ff1660031480611ed857508260ff166004145b15611f4b57600f821015611efc57611ef98860ff8516611daa866001613cbd565b90505b600f8210158015611f0d5750601e82105b15611f2857611f258760ff8516611daa866001613cbd565b90505b601e8210158015611df3575060648211611e1a57611e17611e078a612710611ca6565b8260ff16600814156121ff576000611f6c8960ff8616611daa876001613cbd565b90506000611f838960ff8716611daa886001613cbd565b90506000807f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d84604051602001611fba919061322b565b60405160208183030381529060405280519060200120148061202157507fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc684604051602001612009919061322b565b60405160208183030381529060405280519060200120145b61202f576028915081612035565b60059150815b507f044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d83604051602001612068919061322b565b6040516020818303038152906040528051906020012014806120cf57507fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6836040516020016120b7919061322b565b60405160208183030381529060405280519060200120145b6120dc57506028806120e1565b506005805b508160ff16861015612103576121008c60ff8916611daa8a6001613cbd565b94505b8160ff168610158015612121575061211b8183613cbd565b60ff1686105b1561213c576121398b60ff8916611daa8a6001613cbd565b94505b6121468183613cbd565b60ff168610158015612159575060648611155b156121d05760ff8a16612183576121806121758e612710611ca6565b611e1260018a613d0d565b94505b8960ff16600114156121a7576121a461219e8e612710611ca6565b8861286c565b94505b8960ff16600214156121d0576121cd6121c28e612710611ca6565b611e12896001613cbd565b94505b87856040516020016121e39291906131fc565b6040516020818303038152906040529750505050505050612202565b50505b8061220c81613db2565b915050611d08565b5090505b949350505050565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061227682610ebb565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006122ba82612220565b6122d65760405162461bcd60e51b815260040161066390613638565b60006122e183610ebb565b9050806001600160a01b0316846001600160a01b0316148061231c5750836001600160a01b031661231184610bda565b6001600160a01b0316145b8061221857506122188185611a6d565b826001600160a01b031661233f82610ebb565b6001600160a01b0316146123655760405162461bcd60e51b815260040161066390613861565b6001600160a01b03821661238b5760405162461bcd60e51b81526004016106639061353c565b612396838383612985565b6123a1600082612241565b6001600160a01b03831660009081526003602052604081208054600192906123ca908490613cf6565b90915550506001600160a01b03821660009081526003602052604081208054600192906123f8908490613ca5565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80546001019055565b5490565b6001600160a01b0382166124de5760405162461bcd60e51b8152600401610663906137ab565b6124e781612220565b156125045760405162461bcd60e51b815260040161066390613497565b61251060008383612985565b6001600160a01b0382166000908152600360205260408120805460019290612539908490613ca5565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b336000908152601160205260408120546125b390600190613cf6565b33600090815260116020526040812080549293509091839081106125e757634e487b7160e01b600052603260045260246000fd5b600091825260208083206005909202909101543383526011909152604082208054919350908590811061262a57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600001549050828414156126cf5733600090815260116020526040902080548061267257634e487b7160e01b600052603160045260246000fd5b6000828152602080822060056000199094019384020182815560018101839055600281018390556003810183905560040182905591909255918152601082526040808220829055600f90925220805460ff1916905550610b459050565b3360009081526011602052604090208054849081106126fe57634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160116000336001600160a01b03166001600160a01b03168152602001908152602001600020858154811061275057634e487b7160e01b600052603260045260246000fd5b60009182526020808320845460059093020191825560018085015490830155600280850154908301556003808501549083015560049384015493909101929092558381526010825260408082208790553382526011909252208054806127c657634e487b7160e01b600052603160045260246000fd5b6000828152602080822060056000199094019384020182815560018101839055600281018390556003810183905560040182905591909255918152601082526040808220829055600f90925220805460ff19169055505050565b61282b84848461232c565b61283784848484612a0e565b6114125760405162461bcd60e51b8152600401610663906133d4565b6001600160e01b031981166301ffc9a760e01b14919050565b60606000805b60208460ff16600a811061289657634e487b7160e01b600052603260045260246000fd5b015460ff8216101561296c57600060208560ff16600a81106128c857634e487b7160e01b600052603260045260246000fd5b018260ff16815481106128eb57634e487b7160e01b600052603260045260246000fd5b90600052602060002090601091828204019190066002029054906101000a900461ffff1690508261ffff168610158015612931575061292a8184613c88565b61ffff1686105b1561294c576129428260ff16612b26565b9350505050610d6c565b6129568184613c88565b925050808061296490613db2565b915050612872565b5060405162461bcd60e51b81526004016106639061346c565b612990838383610cb0565b6001600160a01b0383166129ac576129a781612c41565b6129cf565b816001600160a01b0316836001600160a01b0316146129cf576129cf8382612c85565b6001600160a01b0382166129eb576129e681612d22565b610cb0565b826001600160a01b0316826001600160a01b031614610cb057610cb08282612dfb565b6000612a22846001600160a01b0316612e3f565b15612b1e57836001600160a01b031663150b7a02612a3e61223d565b8786866040518563ffffffff1660e01b8152600401612a6094939291906132de565b602060405180830381600087803b158015612a7a57600080fd5b505af1925050508015612aaa575060408051601f3d908101601f19168201909252612aa791810190613108565b60015b612b04573d808015612ad8576040519150601f19603f3d011682016040523d82523d6000602084013e612add565b606091505b508051612afc5760405162461bcd60e51b8152600401610663906133d4565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612218565b506001612218565b606081612b4b57506040805180820190915260018152600360fc1b602082015261062f565b8160005b8115612b755780612b5f81613d97565b9150612b6e9050600a83613ce2565b9150612b4f565b60008167ffffffffffffffff811115612b9e57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612bc8576020820181803683370190505b5090505b841561221857612bdd600183613cf6565b9150612bea600a86613dd2565b612bf5906030613ca5565b60f81b818381518110612c1857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612c3a600a86613ce2565b9450612bcc565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b60006001612c9284610f19565b612c9c9190613cf6565b600083815260076020526040902054909150808214612cef576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612d3490600190613cf6565b60008381526009602052604081205460088054939450909284908110612d6a57634e487b7160e01b600052603260045260246000fd5b906000526020600020015490508060088381548110612d9957634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ddf57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000612e0683610f19565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b3b151590565b828054612e5190613d5c565b90600052602060002090601f016020900481019282612e735760008555612eb9565b82601f10612e8c57805160ff1916838001178555612eb9565b82800160010185558215612eb9579182015b82811115612eb9578251825591602001919060010190612e9e565b50612ec5929150612ec9565b5090565b5b80821115612ec55760008155600101612eca565b600060208284031215612eef578081fd5b8135611cfb81613e28565b600060208284031215612f0b578081fd5b8151611cfb81613e28565b60008060408385031215612f28578081fd5b8235612f3381613e28565b91506020830135612f4381613e28565b809150509250929050565b60008060008060808587031215612f63578182fd5b8435612f6e81613e28565b93506020850135612f7e81613e28565b92506040850135612f8e81613e28565b91506060850135612f9e81613e28565b939692955090935050565b600080600060608486031215612fbd578283fd5b8335612fc881613e28565b92506020840135612fd881613e28565b929592945050506040919091013590565b60008060008060808587031215612ffe578384fd5b843561300981613e28565b9350602085013561301981613e28565b925060408501359150606085013567ffffffffffffffff81111561303b578182fd5b8501601f8101871361304b578182fd5b803561305e61305982613c60565b613c36565b818152886020838501011115613072578384fd5b81602084016020830137908101602001929092525092959194509250565b600080604083850312156130a2578182fd5b82356130ad81613e28565b915060208301358015158114612f43578182fd5b600080604083850312156130d3578182fd5b82356130de81613e28565b946020939093013593505050565b6000602082840312156130fd578081fd5b8135611cfb81613e3d565b600060208284031215613119578081fd5b8151611cfb81613e3d565b600060208284031215613135578081fd5b815167ffffffffffffffff81111561314b578182fd5b8201601f8101841361315b578182fd5b805161316961305982613c60565b81815285602083850101111561317d578384fd5b61318e826020830160208601613d30565b95945050505050565b6000602082840312156131a8578081fd5b5035919050565b600080604083850312156131c1578182fd5b50508035926020909101359150565b600081518084526131e8816020860160208601613d30565b601f01601f19169290920160200192915050565b6000835161320e818460208801613d30565b835190830190613222818360208801613d30565b01949350505050565b6000825161323d818460208701613d30565b9190910192915050565b6000603160f81b82528251613263816001850160208701613d30565b9190910160010192915050565b94855260208501939093526040840191909152606090811b6bffffffffffffffffffffffff191690830152607482015260940190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613311908301846131d0565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b600060208252611cfb60208301846131d0565b6020808252601e908201527f596f7520646f206e6f74206f776e20626f746820416e6f6e796d6963652e0000604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526011908201527014985c9a5d1e4819d95b8819985a5b1959607a1b604082015260600190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526018908201527f5468697320697320616c72656164792072657665616c65640000000000000000604082015260600190565b60208082526019908201527f596f7520646f206e6f74206f776e207468697320626162792e00000000000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b60208082526019908201527f546f6b656e20697320616c72656164792072657665616c656400000000000000604082015260600190565b6020808252602a908201527f426c6f636b206e756d6265722069732067726561746572207468616e2072657660408201526932b0b610313637b1b59760b11b606082015260800190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252601f908201527f54686973206973206e6f74207468652070757a7a6c6520616464726573732e00604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b6020808252602b908201527f426c6f636b206e756d626572206973206c657373207468616e2074686520726560408201526a3b32b0b610313637b1b59760a91b606082015260800190565b6020808252603b908201527f4272656564696e67206576656e7420696e206d617070696e67206e6f7420657160408201527f75616c20746f206272656564696e67206576656e742073656e742e0000000000606082015260800190565b60208082526044908201527f4272656564696e67206576656e7420494420646f6573206e6f74206d6174636860408201527f204272656564696e67206576656e7420494420666f756e6420696e206d61707060608201526334b7339760e11b608082015260a00190565b6020808252601a908201527f4272656564696e67206576656e74206e6f74206163746976652e000000000000604082015260600190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601390820152724d617820737570706c7920726561636865642160681b604082015260600190565b60208082526028908201527f426c6f636b206e756d626572206973206c657373207468616e2072656c6561736040820152673290313637b1b59760c11b606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b6020808252818101527f4272656564696e67206576656e74206e6f206c6f6e676572206163746976652e604082015260600190565b602080825260159082015274213932b2b234b7339034b9903737ba103634bb329760591b604082015260600190565b6020808252601f908201527f436f6e747261637473206e6f7420616c6c6f77656420746f2072657665616c00604082015260600190565b90815260200190565b93845260208401929092526040830152606082015260800190565b948552602085019390935260408401919091526060830152608082015260a00190565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715613c5857613c58613e12565b604052919050565b600067ffffffffffffffff821115613c7a57613c7a613e12565b50601f01601f191660200190565b600061ffff80831681851680830382111561322257613222613de6565b60008219821115613cb857613cb8613de6565b500190565b600060ff821660ff84168060ff03821115613cda57613cda613de6565b019392505050565b600082613cf157613cf1613dfc565b500490565b600082821015613d0857613d08613de6565b500390565b600060ff821660ff841680821015613d2757613d27613de6565b90039392505050565b60005b83811015613d4b578181015183820152602001613d33565b838111156114125750506000910152565b600281046001821680613d7057607f821691505b60208210811415613d9157634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613dab57613dab613de6565b5060010190565b600060ff821660ff811415613dc957613dc9613de6565b60010192915050565b600082613de157613de1613dfc565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b4557600080fd5b6001600160e01b031981168114610b4557600080fdfea2646970667358221220ff898507f185db45678accb5f03ca5329ffc74c1d091ceec77b43caabba444b264736f6c63430008000033

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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