ETH Price: $2,512.53 (-0.04%)

ERC20 ***
 

Overview

TokenID

5903

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
KamonToken

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 1000 runs

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

/*
 * Kamon NFT (ERC721). The mint function takes IAssetStore.AssetInfo as a parameter.
 * It registers the specified asset to the AssetStore and mint a token which represents
 * the "minter" of the asset (who paid the gas fee), along with two additional bonus tokens.
 * 
 * It uses ERC721A as the base contract, which is quite efficent to mint multiple tokens
 * with a single transaction. 
 *
 * Once minted, the asset will beome available to other smart contract developers,
 * for free, either CC0, CC-BY-SA(Attribution-ShareAlike), Appache, MIT or similar.
 * 
 * Created by Satoshi Nakajima (@snakajima)
 */

pragma solidity ^0.8.6;

import { Ownable } from '@openzeppelin/contracts/access/Ownable.sol';
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "erc721a/contracts/ERC721A.sol";
import { IAssetStoreRegistry, IAssetStore } from './interfaces/IAssetStore.sol';
import { IAssetStoreToken } from './interfaces/IAssetStoreToken.sol';
import { Base64 } from 'base64-sol/base64.sol';
import "@openzeppelin/contracts/utils/Strings.sol";
import { IProxyRegistry } from './external/opensea/IProxyRegistry.sol';

contract KamonToken is Ownable, ERC721A, IAssetStoreToken {
  using Strings for uint256;
  using Strings for uint16;

  IAssetStoreRegistry public immutable registry;
  IAssetStore public immutable assetStore;

  uint256 constant _tokensPerAsset = 10;
  mapping(uint256 => uint256) assetIds; // tokenId / _tokensPerAsset => assetId

  // description
  string public description = "This is one of effts to create (On-Chain Asset Store)[https://assetstore.wtf]. "
  " All kamon vectors were created and copyrighted by (Hakko Daiodo)[http://hakko-daiodo.com].";

  // developer address.
  address public developer;

  // OpenSea's Proxy Registry
  IProxyRegistry public immutable proxyRegistry;

  /*
   * @notice both _registry and _assetStore points to the AssetStore.
   */
  constructor(
    IAssetStoreRegistry _registry, 
    IAssetStore _assetStore,
    address _developer,
    IProxyRegistry _proxyRegistry
  ) ERC721A("Kamon Symbols by Hakko Daiodo", "KAMON") {
    registry = _registry;
    assetStore = _assetStore;
    developer = _developer;
    proxyRegistry = _proxyRegistry;
  }

  function _isPrimary(uint256 _tokenId) internal pure returns(bool) {
    return _tokenId % _tokensPerAsset == 0;
  }

  /*
   * It registers the specified asset to the AssetStore and
   * mint three tokens to the msg.sender, and one additional
   * token to either the affiliator, the developer or the owner.npnkda
   */
  function mintWithAsset(IAssetStoreRegistry.AssetInfo memory _assetInfo, uint256 _affiliate) external {
    _assetInfo.group = "Hakko Daiodo (CC-BY equivalent)";
    uint256 assetId = registry.registerAsset(_assetInfo);
    uint256 tokenId = _nextTokenId(); 

    assetIds[tokenId / _tokensPerAsset] = assetId;
    _mint(msg.sender, _tokensPerAsset - 1);

    // Specified affliate token must be one of the primary tokens and not owned by the minter.
    if (_affiliate > 0 && _isPrimary(_affiliate) && ownerOf(_affiliate) != msg.sender) {
      _mint(ownerOf(_affiliate), 1);
    } else if ((tokenId / _tokensPerAsset) % 2 == 0) {
      // 1 in 20 tokens of non-affiliated mints go to the developer
      _mint(developer, 1);
    } else {
      // the rest goes to the owner for distribution
      _mint(owner(), 1);
    }
  }
  /*
   * @notice get next tokenId.
   */
  function getCurrentToken() external view returns (uint256) {                  
    return _nextTokenId();
  }

  /**
    * @notice Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings.
    */
  function isApprovedForAll(address owner, address operator) public view override returns (bool) {
      // Whitelist OpenSea proxy contract for easy trading.
      if (proxyRegistry.proxies(owner) == operator) {
          return true;
      }
      return super.isApprovedForAll(owner, operator);
  }

  string constant SVGHeader = '<svg viewBox="0 0 1024 1024'
      '"  xmlns="http://www.w3.org/2000/svg">\n'
      '<defs>\n';

  /*
   * A function of IAssetStoreToken interface.
   * It generates SVG with the specified style, using the given "SVG Part".
   */
  function generateSVG(string memory _svgPart, uint256 _style, string memory _tag) public pure override returns (string memory) {
    // Constants of non-value type not yet implemented by Solidity
    string[10] memory backColors = [
      "black", "white", "#EFE8AC", "#EFE5AF", "#5B3319", "#BF2E16", "#0963AD", "#3D5943", "black", "url(#gold)" 
    ];
    string[10] memory frontColors = [
      "white", "black", "#0D95A0", "#58456B", "#EFE8AC", "#EFE8AC", "#FFFFFF", "#FFFFFF", "url(#gold)", "black"
    ];

    bytes memory assetTag = abi.encodePacked('#', _tag);
    uint index = _style % _tokensPerAsset;
    bytes memory image = abi.encodePacked(
      SVGHeader,
      _svgPart);
    if (index >= 8) {
      image = abi.encodePacked(
        image, 
        '<linearGradient id="gold" x1="0.2" x2="0" y1="0" y2="1">\n'
        '  <stop offset="0%" stop-color="#CCAB09"/>\n'
        ' <stop offset="50%" stop-color="#FFF186" />\n'
        ' <stop offset="100%" stop-color="#CCAB09"/>\n'
        '</linearGradient>\n');
    }
    image =  abi.encodePacked(
      image,
      '</defs>\n'
      ' <rect x="0" y="0" width="100%" height="100%" fill="',backColors[index],'" />\n'
      ' <use href="', assetTag, '" fill="',frontColors[index],'" />\n'
      '</svg>\n');
    return string(image);
  }

  /*
   * A function of IAssetStoreToken interface.
   * It returns the assetId, which this token uses.
   */
  function assetIdOfToken(uint256 _tokenId) public view override returns(uint256) {
    require(_exists(_tokenId), 'KamonToken.assetIdOfToken: nonexistent token');
    return assetIds[_tokenId / _tokensPerAsset];
  }

  /*
   * A function of IAssetStoreToken interface.
   * Each 16-bit represents the number of possible styles, allowing various combinations.
   */
  function styles() external pure override returns(uint256) {
    return _tokensPerAsset;
  }

  function _generateTraits(uint256 _tokenId, IAssetStore.AssetAttributes memory _attr) internal view returns (bytes memory) {
    return abi.encodePacked(
      '{'
        '"trait_type":"Primary",'
        '"value":"', _isPrimary(_tokenId) ? 'Yes':'No', '"' 
      '},{'
        '"trait_type":"Group",'
        '"value":"', _attr.group, '"' 
      '},{'
        '"trait_type":"Category",'
        '"value":"', _attr.category, '"' 
      '},{'
        '"trait_type":"Name",'
        '"value":"', _attr.name, '"' 
      '},{'
        '"trait_type":"Minter",'
        '"value":"', (bytes(_attr.minter).length > 0)?
              assetStore.getStringValidator().sanitizeJason(_attr.minter) : bytes('(anonymous)'), '"' 
      '}'
    );
  }

  function setDescription(string memory _description) external onlyOwner {
      description = _description;
  }

  /**
    * @notice A distinct Uniform Resource Identifier (URI) for a given asset.
    * @dev See {IERC721Metadata-tokenURI}.
    */
  function tokenURI(uint256 _tokenId) public view override returns (string memory) {
    require(_exists(_tokenId), 'KamonToken.tokenURI: nonexistent token');
    uint256 assetId = assetIdOfToken(_tokenId);
    IAssetStore.AssetAttributes memory attr = assetStore.getAttributes(assetId);
    string memory svgPart = assetStore.generateSVGPart(assetId, attr.tag);
    bytes memory image = bytes(generateSVG(svgPart, _tokenId % _tokensPerAsset, attr.tag));

    return string(
      abi.encodePacked(
        'data:application/json;base64,',
        Base64.encode(
          bytes(
            abi.encodePacked(
              '{"name":"', attr.name, 
                '","description":"', description, 
                '","attributes":[', _generateTraits(_tokenId, attr), 
                '],"image":"data:image/svg+xml;base64,', 
                Base64.encode(image), 
              '"}')
          )
        )
      )
    );
  }  

  function tokensPerAsset() public pure returns(uint256) {
    return _tokensPerAsset;
  }
}

File 2 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev 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 {
        _transferOwnership(address(0));
    }

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

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

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

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 overridden 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 {
        _setApprovalForAll(_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 || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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);

        _afterTokenTransfer(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);

        _afterTokenTransfer(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 from incorrect owner");
        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);

        _afterTokenTransfer(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 Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

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

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

File 4 of 18 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';

/**
 * @dev ERC721 token receiver interface.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard,
 * including the Metadata extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at `_startTokenId()`
 * (defaults to 0, e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Mask of an entry in packed address data.
    uint256 private constant BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with `_mintERC2309`.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to `_mintERC2309`
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The tokenId of the next token to be minted.
    uint256 private _currentIndex;

    // The number of tokens burned.
    uint256 private _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See `_packedOwnershipOf` implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

    // 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;

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see `_totalMinted`.
     */
    function totalSupply() public view override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view returns (uint256) {
        // Counter underflow is impossible as _currentIndex does not decrement,
        // and it is initialized to `_startTokenId()`
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view returns (uint256) {
        return _burnCounter;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes of the XOR of
        // all function selectors in the interface. See: https://eips.ethereum.org/EIPS/eip-165
        // e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> BITPOS_NUMBER_MINTED) & BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> BITPOS_NUMBER_BURNED) & BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return uint64(_packedAddressData[owner] >> BITPOS_AUX);
    }

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & BITMASK_AUX_COMPLEMENT) | (auxCasted << BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & BITMASK_BURNED == 0) {
                        // Invariant:
                        // There will always be an ownership that has an address and is not burned
                        // before an ownership that does not have an address and is not burned.
                        // Hence, curr will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed is zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> BITPOS_START_TIMESTAMP);
        ownership.burned = packed & BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> BITPOS_EXTRA_DATA);
    }

    /**
     * Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, BITMASK_ADDRESS)
            // `owner | (block.timestamp << BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @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) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
    }

    /**
     * @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, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << BITPOS_NEXT_INITIALIZED`.
            result := shl(BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = ownerOf(tokenId);

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

        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        if (operator == _msgSenderERC721A()) revert ApproveToCaller();

        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), 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-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 {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

    /**
     * @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`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, '');
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     *   {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _mint(address to, uint256 quantity) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            uint256 tokenId = startTokenId;
            uint256 end = startTokenId + quantity;
            do {
                emit Transfer(address(0), to, tokenId++);
            } while (tokenId < end);

            _currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        mapping(uint256 => address) storage tokenApprovalsPtr = _tokenApprovals;
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId]`.
        assembly {
            // Compute the slot.
            mstore(0x00, tokenId)
            mstore(0x20, tokenApprovalsPtr.slot)
            approvedAddressSlot := keccak256(0x00, 0x40)
            // Load the slot's value from storage.
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    /**
     * @dev Returns whether the `approvedAddress` is equals to `from` or `msgSender`.
     */
    function _isOwnerOrApproved(
        address approvedAddress,
        address from,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
            from := and(from, BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, BITMASK_ADDRESS)
            // `msgSender == from || msgSender == approvedAddress`.
            result := or(eq(msgSender, from), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isOwnerOrApproved(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256.
        unchecked {
            // We can directly increment and decrement the balances.
            --_packedAddressData[from]; // Updates: `balance -= 1`.
            ++_packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                to,
                BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

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

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

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

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isOwnerOrApproved(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (BITMASK_BURNED | BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
            bytes4 retval
        ) {
            return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << BITPOS_EXTRA_DATA;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * 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, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred.
     * This includes minting.
     * And also called before burning one token.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * 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, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred.
     * This includes minting.
     * And also called after one token has been burned.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function _toString(uint256 value) internal pure returns (string memory ptr) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit),
            // but we allocate 128 bytes to keep the free memory pointer 32-byte word aliged.
            // We will need 1 32-byte word to store the length,
            // and 3 32-byte words to store a maximum of 78 digits. Total: 32 + 3 * 32 = 128.
            ptr := add(mload(0x40), 128)
            // Update the free memory pointer to allocate.
            mstore(0x40, ptr)

            // Cache the end of the memory to calculate the length later.
            let end := ptr

            // We write the string from the rightmost digit to the leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // Costs a bit more than early returning for the zero case,
            // but cheaper in terms of deployment and overall runtime costs.
            for {
                // Initialize and perform the first pass without check.
                let temp := value
                // Move the pointer 1 byte leftwards to point to an empty character slot.
                ptr := sub(ptr, 1)
                // Write the character to the pointer. 48 is the ASCII index of '0'.
                mstore8(ptr, add(48, mod(temp, 10)))
                temp := div(temp, 10)
            } temp {
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
            } {
                // Body of the for loop.
                ptr := sub(ptr, 1)
                mstore8(ptr, add(48, mod(temp, 10)))
            }

            let length := sub(end, ptr)
            // Move the pointer 32 bytes leftwards to make room for the length.
            ptr := sub(ptr, 32)
            // Store the length.
            mstore(ptr, length)
        }
    }
}

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

pragma solidity ^0.8.6;

import { IStringValidator } from './IStringValidator.sol';

// IAssetStore is the inteface for consumers of the AsseStore.
interface IAssetStore {
  // Browsing
  function getGroupCount() external view returns(uint32);
  function getGroupNameAtIndex(uint32 _groupIndex) external view returns(string memory);
  function getCategoryCount(string memory _group) external view returns(uint32);
  function getCategoryNameAtIndex(string memory _group, uint32 _categoryIndex) external view returns(string memory);
  function getAssetCountInCategory(string memory _group, string memory _category) external view returns(uint32);
  function getAssetIdInCategory(string memory _group, string memory _category, uint32 _assetIndex) external view returns(uint256);
  function getAssetIdWithName(string memory _group, string memory _category, string memory _name) external view returns(uint256);

  // Fetching
  struct AssetAttributes {
    string group;
    string category;
    string name;
    string tag; // the id in SVG
    string minter; // the name of the minter (who paid the gas fee)
    address soulbound; // wallet address of the minter
    bytes metadata; // group/category specific metadata
    uint16 width;
    uint16 height;
  }

  function generateSVG(uint256 _assetId) external view returns(string memory);
  function generateSVGPart(uint256 _assetId, string memory _tag) external view returns(string memory);
  function getAttributes(uint256 _assetId) external view returns(AssetAttributes memory);
  function getStringValidator() external view returns(IStringValidator);
}

// IAssetStoreRegistry is the interface for contracts who registers assets to the AssetStore.
interface IAssetStoreRegistry {
  struct Part {
    bytes body;
    string color;
  }

  struct AssetInfo {
    string group;
    string category;
    string name;
    string minter; // the name of the minter, who is paying the gas fee
    address soulbound; // wallet address of the minter
    bytes metadata; // group/category specific metadata (optional)
    Part[] parts;
  }

  event AssetRegistered(address from, uint256 assetId);
  event GroupAdded(string group);
  event CategoryAdded(string group, string category);

  function registerAsset(AssetInfo memory _assetInfo) external returns(uint256);
  function registerAssets(AssetInfo[] memory _assetInfos) external;
}

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

pragma solidity ^0.8.6;

interface IAssetStoreToken {
  function generateSVG(string memory _svgPart, uint256 _style, string memory _tag) external returns (string memory);
  function assetIdOfToken(uint256 _tokenId) external returns(uint256);
  function styles() external returns(uint256);
}

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

pragma solidity >=0.6.0;

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

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

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

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

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

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

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

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

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

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

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

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

        return result;
    }

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

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

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

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

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

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

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

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

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

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

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

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

        return result;
    }
}

File 8 of 18 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

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 9 of 18 : IProxyRegistry.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.6;

interface IProxyRegistry {
    function proxies(address) external view returns (address);
}

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

pragma solidity ^0.8.0;

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

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

File 11 of 18 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must 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 Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 14 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 16 of 18 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 17 of 18 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.1.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of an ERC721A compliant contract.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * The caller cannot approve to their own address.
     */
    error ApproveToCaller();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set through `_extraData`.
        uint24 extraData;
    }

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     *
     * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.
     */
    function totalSupply() external view returns (uint256);

    // ==============================
    //            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);

    // ==============================
    //            IERC721
    // ==============================

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must 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 Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

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

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

    // ==============================
    //        IERC721Metadata
    // ==============================

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

    // ==============================
    //            IERC2309
    // ==============================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId` (inclusive) is transferred from `from` to `to`,
     * as defined in the ERC2309 standard. See `_mintERC2309` for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

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

pragma solidity ^0.8.6;

interface IStringValidator {
  function validate(bytes memory str) external pure returns (bool);
  function sanitizeJason(string memory _str) external pure returns(bytes memory);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IAssetStoreRegistry","name":"_registry","type":"address"},{"internalType":"contract IAssetStore","name":"_assetStore","type":"address"},{"internalType":"address","name":"_developer","type":"address"},{"internalType":"contract IProxyRegistry","name":"_proxyRegistry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"assetIdOfToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetStore","outputs":[{"internalType":"contract IAssetStore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"developer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_svgPart","type":"string"},{"internalType":"uint256","name":"_style","type":"uint256"},{"internalType":"string","name":"_tag","type":"string"}],"name":"generateSVG","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"group","type":"string"},{"internalType":"string","name":"category","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"minter","type":"string"},{"internalType":"address","name":"soulbound","type":"address"},{"internalType":"bytes","name":"metadata","type":"bytes"},{"components":[{"internalType":"bytes","name":"body","type":"bytes"},{"internalType":"string","name":"color","type":"string"}],"internalType":"struct IAssetStoreRegistry.Part[]","name":"parts","type":"tuple[]"}],"internalType":"struct IAssetStoreRegistry.AssetInfo","name":"_assetInfo","type":"tuple"},{"internalType":"uint256","name":"_affiliate","type":"uint256"}],"name":"mintWithAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyRegistry","outputs":[{"internalType":"contract IProxyRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract IAssetStoreRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_description","type":"string"}],"name":"setDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"styles","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensPerAsset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","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"}]

6101c060405260aa60e081815290620034346101003980516200002b91600a916020909101906200019b565b503480156200003957600080fd5b50604051620034de380380620034de8339810160408190526200005c9162000241565b6040518060400160405280601d81526020017f4b616d6f6e2053796d626f6c732062792048616b6b6f204461696f646f0000008152506040518060400160405280600581526020016425a0a6a7a760d91b815250620000ca620000c46200014760201b60201c565b6200014b565b8151620000df9060039060208501906200019b565b508051620000f59060049060208401906200019b565b5060006001555050606093841b6001600160601b031990811660805292841b831660a052600b80546001600160a01b0319166001600160a01b03939093169290921790915590911b1660c052620002ff565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054620001a990620002a9565b90600052602060002090601f016020900481019282620001cd576000855562000218565b82601f10620001e857805160ff191683800117855562000218565b8280016001018555821562000218579182015b8281111562000218578251825591602001919060010190620001fb565b50620002269291506200022a565b5090565b5b808211156200022657600081556001016200022b565b600080600080608085870312156200025857600080fd5b84516200026581620002e6565b60208601519094506200027881620002e6565b60408601519093506200028b81620002e6565b60608601519092506200029e81620002e6565b939692955090935050565b600181811c90821680620002be57607f821691505b60208210811415620002e057634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0381168114620002fc57600080fd5b50565b60805160601c60a05160601c60c05160601c6130d96200035b6000396000818161039801526115240152600081816102d501528181611316015281816113cf0152611ac70152600081816103320152610e1001526130d96000f3fe608060405234801561001057600080fd5b50600436106101ce5760003560e01c8063715018a611610104578063a22cb465116100a2578063ca4b208b11610071578063ca4b208b146103e0578063e985e9c5146103f3578063ef2d174614610406578063f2fde38b1461040e57600080fd5b8063a22cb46514610380578063b50cbd9f14610393578063b88d4fde146103ba578063c87b56dd146103cd57600080fd5b80637b103999116100de5780637b1039991461032d5780638da5cb5b1461035457806390c3f38f1461036557806395d89b411461037857600080fd5b8063715018a61461031d5780637284e41614610325578063786f94c6146102b657600080fd5b80632ab72d2f116101715780634f38687b1161014b5780634f38687b146102bd578063597a0e36146102d05780636352211e146102f757806370a082311461030a57600080fd5b80632ab72d2f1461029057806342842e0e146102a35780634b00371f146102b657600080fd5b8063081812fc116101ad578063081812fc14610227578063095ea7b31461025257806318160ddd1461026757806323b872dd1461027d57600080fd5b80626e59e9146101d357806301ffc9a7146101fc57806306fdde031461021f575b600080fd5b6101e66101e1366004612221565b610421565b6040516101f39190612cf0565b60405180910390f35b61020f61020a36600461217d565b6108b4565b60405190151581526020016101f3565b6101e6610951565b61023a610235366004612522565b6109e3565b6040516001600160a01b0390911681526020016101f3565b610265610260366004612151565b610a40565b005b600254600154035b6040519081526020016101f3565b61026561028b366004612071565b610b06565b61026f61029e366004612522565b610ce3565b6102656102b1366004612071565b610d8a565b600a61026f565b6102656102cb3660046123e8565b610daa565b61023a7f000000000000000000000000000000000000000000000000000000000000000081565b61023a610305366004612522565b610f77565b61026f610318366004611ffe565b610f82565b610265610fea565b6101e6611050565b61023a7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031661023a565b6102656103733660046121ec565b6110de565b6101e661114f565b61026561038e36600461211e565b61115e565b61023a7f000000000000000000000000000000000000000000000000000000000000000081565b6102656103c83660046120b2565b61120d565b6101e66103db366004612522565b611251565b600b5461023a906001600160a01b031681565b61020f610401366004612038565b6114e5565b61026f6115e6565b61026561041c366004611ffe565b6115f6565b6060600060405180610140016040528060405180604001604052806005815260200164626c61636b60d81b815250815260200160405180604001604052806005815260200164776869746560d81b8152508152602001604051806040016040528060078152602001662345464538414360c81b81525081526020016040518060400160405280600781526020017f234546453541460000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f233542333331390000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f234246324531360000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f233039363341440000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f2333443539343300000000000000000000000000000000000000000000000000815250815260200160405180604001604052806005815260200164626c61636b60d81b81525081526020016040518060400160405280600a81526020016975726c2823676f6c642960b01b8152508152509050600060405180610140016040528060405180604001604052806005815260200164776869746560d81b815250815260200160405180604001604052806005815260200164626c61636b60d81b81525081526020016040518060400160405280600781526020017f233044393541300000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f23353834353642000000000000000000000000000000000000000000000000008152508152602001604051806040016040528060078152602001662345464538414360c81b8152508152602001604051806040016040528060078152602001662345464538414360c81b81525081526020016040518060400160405280600781526020016611a3232323232360c91b81525081526020016040518060400160405280600781526020016611a3232323232360c91b81525081526020016040518060400160405280600a81526020016975726c2823676f6c642960b01b815250815260200160405180604001604052806005815260200164626c61636b60d81b81525081525090506000846040516020016107ca9190612a5a565b60408051601f19818403018152919052905060006107e9600a88612f83565b9050600060405180608001604052806049815260200161305b6049913989604051602001610818929190612863565b60405160208183030381529060405290506008821061085457806040516020016108429190612617565b60405160208183030381529060405290505b808583600a811061086757610867612fc3565b6020020151848685600a811061087f5761087f612fc3565b6020020151604051602001610897949392919061273c565b60408051808303601f190181529190529998505050505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316148061091757507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b8061094b57507f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b60606003805461096090612f48565b80601f016020809104026020016040519081016040528092919081815260200182805461098c90612f48565b80156109d95780601f106109ae576101008083540402835291602001916109d9565b820191906000526020600020905b8154815290600101906020018083116109bc57829003601f168201915b5050505050905090565b60006109ee826116d8565b610a24576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b6000610a4b82610f77565b9050336001600160a01b03821614610a9d57610a6781336114e5565b610a9d576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260076020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000610b1182611700565b9050836001600160a01b0316816001600160a01b031614610b5e576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526007602052604090208054338082146001600160a01b03881690911417610bc457610b8e86336114e5565b610bc4576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516610c04576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015610c0f57600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040902055600160e11b8316610c9a5760018401600081815260056020526040902054610c98576001548114610c985760008181526005602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6000610cee826116d8565b610d655760405162461bcd60e51b815260206004820152602c60248201527f4b616d6f6e546f6b656e2e617373657449644f66546f6b656e3a206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60096000610d74600a85612ed2565b8152602001908152602001600020549050919050565b610da58383836040518060200160405280600081525061120d565b505050565b604080518082018252601f81527f48616b6b6f204461696f646f202843432d4259206571756976616c656e74290060208201528352517f5b7eea860000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635b7eea8690610e45908690600401612d03565b602060405180830381600087803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e97919061253b565b90506000610ea460015490565b90508160096000610eb6600a85612ed2565b8152602081019190915260400160002055610edc33610ed76001600a612f05565b61177a565b600083118015610ef05750610ef08361188a565b8015610f0d575033610f0184610f77565b6001600160a01b031614155b15610f2a57610f25610f1e84610f77565b600161177a565b610f71565b6002610f37600a83612ed2565b610f419190612f83565b610f5c57600b54610f25906001600160a01b0316600161177a565b610f71610f1e6000546001600160a01b031690565b50505050565b600061094b82611700565b60006001600160a01b038216610fc4576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205467ffffffffffffffff1690565b6000546001600160a01b031633146110445760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d5c565b61104e600061189e565b565b600a805461105d90612f48565b80601f016020809104026020016040519081016040528092919081815260200182805461108990612f48565b80156110d65780601f106110ab576101008083540402835291602001916110d6565b820191906000526020600020905b8154815290600101906020018083116110b957829003601f168201915b505050505081565b6000546001600160a01b031633146111385760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d5c565b805161114b90600a906020840190611da1565b5050565b60606004805461096090612f48565b6001600160a01b0382163314156111a1576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611218848484610b06565b6001600160a01b0383163b15610f7157611234848484846118fb565b610f71576040516368d2bf6b60e11b815260040160405180910390fd5b606061125c826116d8565b6112ce5760405162461bcd60e51b815260206004820152602660248201527f4b616d6f6e546f6b656e2e746f6b656e5552493a206e6f6e6578697374656e7460448201527f20746f6b656e00000000000000000000000000000000000000000000000000006064820152608401610d5c565b60006112d983610ce3565b6040517f4378a6e3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634378a6e39060240160006040518083038186803b15801561135857600080fd5b505afa15801561136c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611394919081019061228e565b60608101516040517f34320bf10000000000000000000000000000000000000000000000000000000081529192506000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916334320bf191611404918791600401612dd8565b60006040518083038186803b15801561141c57600080fd5b505afa158015611430573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261145891908101906121b7565b905060006114758261146b600a89612f83565b8560600151610421565b90506114bb8360400151600a61148b89876119f3565b61149485611c04565b6040516020016114a79493929190612892565b604051602081830303815290604052611c04565b6040516020016114cb9190612a9f565b604051602081830303815290604052945050505050919050565b6040517fc45527910000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600091818416917f0000000000000000000000000000000000000000000000000000000000000000169063c45527919060240160206040518083038186803b15801561156657600080fd5b505afa15801561157a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159e919061201b565b6001600160a01b031614156115b55750600161094b565b6001600160a01b0380841660009081526008602090815260408083209386168352929052205460ff165b9392505050565b60006115f160015490565b905090565b6000546001600160a01b031633146116505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d5c565b6001600160a01b0381166116cc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d5c565b6116d58161189e565b50565b60006001548210801561094b575050600090815260056020526040902054600160e01b161590565b60008160015481101561174857600081815260056020526040902054600160e01b8116611746575b806115df575060001901600081815260056020526040902054611728565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546001600160a01b0383166117bd576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816117f4576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600081815260066020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260056020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821061183e5760015550505050565b6000611897600a83612f83565b1592915050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611930903390899088908890600401612cb4565b602060405180830381600087803b15801561194a57600080fd5b505af192505050801561197a575060408051601f3d908101601f191682019092526119779181019061219a565b60015b6119d5573d8080156119a8576040519150601f19603f3d011682016040523d82523d6000602084013e6119ad565b606091505b5080516119cd576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60606119fe8361188a565b611a3d576040518060400160405280600281526020017f4e6f000000000000000000000000000000000000000000000000000000000000815250611a74565b6040518060400160405280600381526020017f59657300000000000000000000000000000000000000000000000000000000008152505b825160208401516040850151608086015151611ac5576040518060400160405280600b81526020017f28616e6f6e796d6f757329000000000000000000000000000000000000000000815250611bd9565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a57cfb246040518163ffffffff1660e01b815260040160206040518083038186803b158015611b1e57600080fd5b505afa158015611b32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b56919061201b565b6001600160a01b031663841b9d9787608001516040518263ffffffff1660e01b8152600401611b859190612cf0565b60006040518083038186803b158015611b9d57600080fd5b505afa158015611bb1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bd991908101906121b7565b604051602001611bed959493929190612ae4565b604051602081830303815290604052905092915050565b6060815160001415611c2457505060408051602081019091526000815290565b600060405180606001604052806040815260200161301b6040913990506000600384516002611c539190612eba565b611c5d9190612ed2565b611c68906004612ee6565b90506000611c77826020612eba565b67ffffffffffffffff811115611c8f57611c8f612fd9565b6040519080825280601f01601f191660200182016040528015611cb9576020820181803683370190505b509050818152600183018586518101602084015b81831015611d25576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f8116850151825350600101611ccd565b600389510660018114611d3f5760028114611d6b57611d93565b7f3d3d000000000000000000000000000000000000000000000000000000000000600119830152611d93565b7f3d000000000000000000000000000000000000000000000000000000000000006000198301525b509398975050505050505050565b828054611dad90612f48565b90600052602060002090601f016020900481019282611dcf5760008555611e15565b82601f10611de857805160ff1916838001178555611e15565b82800160010185558215611e15579182015b82811115611e15578251825591602001919060010190611dfa565b50611e21929150611e25565b5090565b5b80821115611e215760008155600101611e26565b8035611e4581612fef565b919050565b8051611e4581612fef565b600082601f830112611e6657600080fd5b8135602067ffffffffffffffff80831115611e8357611e83612fd9565b8260051b611e92838201612e61565b8481528381019087850183890186018a1015611ead57600080fd5b600093505b86841015611f4457803585811115611ec957600080fd5b89016040818c03601f1901811315611ee057600080fd5b611ee8612df1565b8883013588811115611ef957600080fd5b611f078e8b83870101611f51565b825250908201359087821115611f1c57600080fd5b611f2a8d8a84860101611f51565b818a01528552505060019390930192918501918501611eb2565b5098975050505050505050565b600082601f830112611f6257600080fd5b8135611f75611f7082612e92565b612e61565b818152846020838601011115611f8a57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112611fb857600080fd5b8151611fc6611f7082612e92565b818152846020838601011115611fdb57600080fd5b6119eb826020830160208701612f1c565b805161ffff81168114611e4557600080fd5b60006020828403121561201057600080fd5b81356115df81612fef565b60006020828403121561202d57600080fd5b81516115df81612fef565b6000806040838503121561204b57600080fd5b823561205681612fef565b9150602083013561206681612fef565b809150509250929050565b60008060006060848603121561208657600080fd5b833561209181612fef565b925060208401356120a181612fef565b929592945050506040919091013590565b600080600080608085870312156120c857600080fd5b84356120d381612fef565b935060208501356120e381612fef565b925060408501359150606085013567ffffffffffffffff81111561210657600080fd5b61211287828801611f51565b91505092959194509250565b6000806040838503121561213157600080fd5b823561213c81612fef565b91506020830135801515811461206657600080fd5b6000806040838503121561216457600080fd5b823561216f81612fef565b946020939093013593505050565b60006020828403121561218f57600080fd5b81356115df81613004565b6000602082840312156121ac57600080fd5b81516115df81613004565b6000602082840312156121c957600080fd5b815167ffffffffffffffff8111156121e057600080fd5b6119eb84828501611fa7565b6000602082840312156121fe57600080fd5b813567ffffffffffffffff81111561221557600080fd5b6119eb84828501611f51565b60008060006060848603121561223657600080fd5b833567ffffffffffffffff8082111561224e57600080fd5b61225a87838801611f51565b945060208601359350604086013591508082111561227757600080fd5b5061228486828701611f51565b9150509250925092565b6000602082840312156122a057600080fd5b815167ffffffffffffffff808211156122b857600080fd5b9083019061012082860312156122cd57600080fd5b6122d5612e1a565b8251828111156122e457600080fd5b6122f087828601611fa7565b82525060208301518281111561230557600080fd5b61231187828601611fa7565b60208301525060408301518281111561232957600080fd5b61233587828601611fa7565b60408301525060608301518281111561234d57600080fd5b61235987828601611fa7565b60608301525060808301518281111561237157600080fd5b61237d87828601611fa7565b60808301525061238f60a08401611e4a565b60a082015260c0830151828111156123a657600080fd5b6123b287828601611fa7565b60c0830152506123c460e08401611fec565b60e082015261010091506123d9828401611fec565b91810191909152949350505050565b600080604083850312156123fb57600080fd5b823567ffffffffffffffff8082111561241357600080fd5b9084019060e0828703121561242757600080fd5b61242f612e3e565b82358281111561243e57600080fd5b61244a88828601611f51565b82525060208301358281111561245f57600080fd5b61246b88828601611f51565b60208301525060408301358281111561248357600080fd5b61248f88828601611f51565b6040830152506060830135828111156124a757600080fd5b6124b388828601611f51565b6060830152506124c560808401611e3a565b608082015260a0830135828111156124dc57600080fd5b6124e888828601611f51565b60a08301525060c08301358281111561250057600080fd5b61250c88828601611e55565b60c0830152509660209590950135955050505050565b60006020828403121561253457600080fd5b5035919050565b60006020828403121561254d57600080fd5b5051919050565b600081518084526020808501808196508360051b8101915082860160005b858110156125c2578284038952815160408151818752612594828801826125cf565b915050868201519150858103878701526125ae81836125cf565b9a87019a9550505090840190600101612572565b5091979650505050505050565b600081518084526125e7816020860160208601612f1c565b601f01601f19169290920160200192915050565b6000815161260d818560208601612f1c565b9290920192915050565b60008251612629818460208701612f1c565b7f3c6c696e6561724772616469656e742069643d22676f6c64222078313d22302e9201918252507f32222078323d2230222079313d2230222079323d2231223e0a20203c73746f7060208201527f206f66667365743d223025222073746f702d636f6c6f723d222343434142303960408201527f222f3e0a203c73746f70206f66667365743d22353025222073746f702d636f6c60608201527f6f723d222346464631383622202f3e0a203c73746f70206f66667365743d223160808201527f303025222073746f702d636f6c6f723d2223434341423039222f3e0a3c2f6c6960a08201527f6e6561724772616469656e743e0a00000000000000000000000000000000000060c082015260ce01919050565b6000855161274e818460208a01612f1c565b80830190507f3c2f646566733e0a203c7265637420783d22302220793d22302220776964746881527f3d223130302522206865696768743d2231303025222066696c6c3d2200000000602082015285516127af81603c840160208a01612f1c565b7f22202f3e0a203c75736520687265663d22000000000000000000000000000000603c929091019182015284516127ed81604d840160208901612f1c565b7f222066696c6c3d22000000000000000000000000000000000000000000000000604d9290910191820152835161282b816055840160208801612f1c565b7f22202f3e0a3c2f7376673e0a0000000000000000000000000000000000000000605592909101918201526061019695505050505050565b60008351612875818460208801612f1c565b835190830190612889818360208801612f1c565b01949350505050565b7f7b226e616d65223a22000000000000000000000000000000000000000000000081526000855160206128cb8260098601838b01612f1c565b7f222c226465736372697074696f6e223a220000000000000000000000000000006009928501928301528654601a90600090600181811c908083168061291257607f831692505b86831081141561293057634e487b7160e01b85526022600452602485fd5b80801561294457600181146129595761298a565b60ff198516898801528389018701955061298a565b60008e81526020902060005b858110156129805781548b82018a0152908401908901612965565b505086848a010195505b5050505050612a4c612a23612a1d6129ce6129c8857f222c2261747472696275746573223a5b00000000000000000000000000000000815260100190565b8c6125fb565b7f5d2c22696d616765223a22646174613a696d6167652f7376672b786d6c3b626181527f736536342c000000000000000000000000000000000000000000000000000000602082015260250190565b896125fb565b7f227d000000000000000000000000000000000000000000000000000000000000815260020190565b9a9950505050505050505050565b7f2300000000000000000000000000000000000000000000000000000000000000815260008251612a92816001850160208701612f1c565b9190910160010192915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251612ad781601d850160208701612f1c565b91909101601d0192915050565b7f7b2274726169745f74797065223a225072696d617279222c2276616c7565223a815260007f22000000000000000000000000000000000000000000000000000000000000008060208401528751612b43816021860160208c01612f1c565b7f227d2c7b2274726169745f74797065223a2247726f7570222c2276616c7565226021918501918201527f3a2200000000000000000000000000000000000000000000000000000000000060418201528751612ba6816043840160208c01612f1c565b7f227d2c7b2274726169745f74797065223a2243617465676f7279222c2276616c604392909101918201527f7565223a2200000000000000000000000000000000000000000000000000000060638201528651612c0a816068840160208b01612f1c565b8082019150507f227d2c7b2274726169745f74797065223a224e616d65222c2276616c7565223a6068820152816088820152612ca7612a23612ca1612c52608985018a6125fb565b7f227d2c7b2274726169745f74797065223a224d696e746572222c2276616c756581527f223a220000000000000000000000000000000000000000000000000000000000602082015260230190565b876125fb565b9998505050505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612ce660808301846125cf565b9695505050505050565b6020815260006115df60208301846125cf565b602081526000825160e06020840152612d206101008401826125cf565b90506020840151601f1980858403016040860152612d3e83836125cf565b92506040860151915080858403016060860152612d5b83836125cf565b92506060860151915080858403016080860152612d7883836125cf565b925060808601519150612d9660a08601836001600160a01b03169052565b60a08601519150808584030160c0860152612db183836125cf565b925060c08601519150808584030160e086015250612dcf8282612554565b95945050505050565b8281526040602082015260006119eb60408301846125cf565b6040805190810167ffffffffffffffff81118282101715612e1457612e14612fd9565b60405290565b604051610120810167ffffffffffffffff81118282101715612e1457612e14612fd9565b60405160e0810167ffffffffffffffff81118282101715612e1457612e14612fd9565b604051601f8201601f1916810167ffffffffffffffff81118282101715612e8a57612e8a612fd9565b604052919050565b600067ffffffffffffffff821115612eac57612eac612fd9565b50601f01601f191660200190565b60008219821115612ecd57612ecd612f97565b500190565b600082612ee157612ee1612fad565b500490565b6000816000190483118215151615612f0057612f00612f97565b500290565b600082821015612f1757612f17612f97565b500390565b60005b83811015612f37578181015183820152602001612f1f565b83811115610f715750506000910152565b600181811c90821680612f5c57607f821691505b60208210811415612f7d57634e487b7160e01b600052602260045260246000fd5b50919050565b600082612f9257612f92612fad565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146116d557600080fd5b6001600160e01b0319811681146116d557600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c7376672076696577426f783d2230203020313032342031303234222020786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667223e0a3c646566733e0aa2646970667358221220333d02de3a7ffa11e66ae88649e88df1a026c9aded73f77592e05950833d54f264736f6c6343000806003354686973206973206f6e65206f6620656666747320746f2063726561746520284f6e2d436861696e2041737365742053746f7265295b68747470733a2f2f617373657473746f72652e7774665d2e2020416c6c206b616d6f6e20766563746f72732077657265206372656174656420616e6420636f707972696768746564206279202848616b6b6f204461696f646f295b687474703a2f2f68616b6b6f2d6461696f646f2e636f6d5d2e000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c0000000000000000000000006a615ca8d7053c0a0de2d11cacb6f321ca63bd62000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101ce5760003560e01c8063715018a611610104578063a22cb465116100a2578063ca4b208b11610071578063ca4b208b146103e0578063e985e9c5146103f3578063ef2d174614610406578063f2fde38b1461040e57600080fd5b8063a22cb46514610380578063b50cbd9f14610393578063b88d4fde146103ba578063c87b56dd146103cd57600080fd5b80637b103999116100de5780637b1039991461032d5780638da5cb5b1461035457806390c3f38f1461036557806395d89b411461037857600080fd5b8063715018a61461031d5780637284e41614610325578063786f94c6146102b657600080fd5b80632ab72d2f116101715780634f38687b1161014b5780634f38687b146102bd578063597a0e36146102d05780636352211e146102f757806370a082311461030a57600080fd5b80632ab72d2f1461029057806342842e0e146102a35780634b00371f146102b657600080fd5b8063081812fc116101ad578063081812fc14610227578063095ea7b31461025257806318160ddd1461026757806323b872dd1461027d57600080fd5b80626e59e9146101d357806301ffc9a7146101fc57806306fdde031461021f575b600080fd5b6101e66101e1366004612221565b610421565b6040516101f39190612cf0565b60405180910390f35b61020f61020a36600461217d565b6108b4565b60405190151581526020016101f3565b6101e6610951565b61023a610235366004612522565b6109e3565b6040516001600160a01b0390911681526020016101f3565b610265610260366004612151565b610a40565b005b600254600154035b6040519081526020016101f3565b61026561028b366004612071565b610b06565b61026f61029e366004612522565b610ce3565b6102656102b1366004612071565b610d8a565b600a61026f565b6102656102cb3660046123e8565b610daa565b61023a7f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c81565b61023a610305366004612522565b610f77565b61026f610318366004611ffe565b610f82565b610265610fea565b6101e6611050565b61023a7f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c81565b6000546001600160a01b031661023a565b6102656103733660046121ec565b6110de565b6101e661114f565b61026561038e36600461211e565b61115e565b61023a7f000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c181565b6102656103c83660046120b2565b61120d565b6101e66103db366004612522565b611251565b600b5461023a906001600160a01b031681565b61020f610401366004612038565b6114e5565b61026f6115e6565b61026561041c366004611ffe565b6115f6565b6060600060405180610140016040528060405180604001604052806005815260200164626c61636b60d81b815250815260200160405180604001604052806005815260200164776869746560d81b8152508152602001604051806040016040528060078152602001662345464538414360c81b81525081526020016040518060400160405280600781526020017f234546453541460000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f233542333331390000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f234246324531360000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f233039363341440000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f2333443539343300000000000000000000000000000000000000000000000000815250815260200160405180604001604052806005815260200164626c61636b60d81b81525081526020016040518060400160405280600a81526020016975726c2823676f6c642960b01b8152508152509050600060405180610140016040528060405180604001604052806005815260200164776869746560d81b815250815260200160405180604001604052806005815260200164626c61636b60d81b81525081526020016040518060400160405280600781526020017f233044393541300000000000000000000000000000000000000000000000000081525081526020016040518060400160405280600781526020017f23353834353642000000000000000000000000000000000000000000000000008152508152602001604051806040016040528060078152602001662345464538414360c81b8152508152602001604051806040016040528060078152602001662345464538414360c81b81525081526020016040518060400160405280600781526020016611a3232323232360c91b81525081526020016040518060400160405280600781526020016611a3232323232360c91b81525081526020016040518060400160405280600a81526020016975726c2823676f6c642960b01b815250815260200160405180604001604052806005815260200164626c61636b60d81b81525081525090506000846040516020016107ca9190612a5a565b60408051601f19818403018152919052905060006107e9600a88612f83565b9050600060405180608001604052806049815260200161305b6049913989604051602001610818929190612863565b60405160208183030381529060405290506008821061085457806040516020016108429190612617565b60405160208183030381529060405290505b808583600a811061086757610867612fc3565b6020020151848685600a811061087f5761087f612fc3565b6020020151604051602001610897949392919061273c565b60408051808303601f190181529190529998505050505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316148061091757507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b8061094b57507f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b60606003805461096090612f48565b80601f016020809104026020016040519081016040528092919081815260200182805461098c90612f48565b80156109d95780601f106109ae576101008083540402835291602001916109d9565b820191906000526020600020905b8154815290600101906020018083116109bc57829003601f168201915b5050505050905090565b60006109ee826116d8565b610a24576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b6000610a4b82610f77565b9050336001600160a01b03821614610a9d57610a6781336114e5565b610a9d576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260076020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000610b1182611700565b9050836001600160a01b0316816001600160a01b031614610b5e576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526007602052604090208054338082146001600160a01b03881690911417610bc457610b8e86336114e5565b610bc4576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516610c04576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015610c0f57600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040902055600160e11b8316610c9a5760018401600081815260056020526040902054610c98576001548114610c985760008181526005602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b6000610cee826116d8565b610d655760405162461bcd60e51b815260206004820152602c60248201527f4b616d6f6e546f6b656e2e617373657449644f66546f6b656e3a206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60096000610d74600a85612ed2565b8152602001908152602001600020549050919050565b610da58383836040518060200160405280600081525061120d565b505050565b604080518082018252601f81527f48616b6b6f204461696f646f202843432d4259206571756976616c656e74290060208201528352517f5b7eea860000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c1690635b7eea8690610e45908690600401612d03565b602060405180830381600087803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e97919061253b565b90506000610ea460015490565b90508160096000610eb6600a85612ed2565b8152602081019190915260400160002055610edc33610ed76001600a612f05565b61177a565b600083118015610ef05750610ef08361188a565b8015610f0d575033610f0184610f77565b6001600160a01b031614155b15610f2a57610f25610f1e84610f77565b600161177a565b610f71565b6002610f37600a83612ed2565b610f419190612f83565b610f5c57600b54610f25906001600160a01b0316600161177a565b610f71610f1e6000546001600160a01b031690565b50505050565b600061094b82611700565b60006001600160a01b038216610fc4576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205467ffffffffffffffff1690565b6000546001600160a01b031633146110445760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d5c565b61104e600061189e565b565b600a805461105d90612f48565b80601f016020809104026020016040519081016040528092919081815260200182805461108990612f48565b80156110d65780601f106110ab576101008083540402835291602001916110d6565b820191906000526020600020905b8154815290600101906020018083116110b957829003601f168201915b505050505081565b6000546001600160a01b031633146111385760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d5c565b805161114b90600a906020840190611da1565b5050565b60606004805461096090612f48565b6001600160a01b0382163314156111a1576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611218848484610b06565b6001600160a01b0383163b15610f7157611234848484846118fb565b610f71576040516368d2bf6b60e11b815260040160405180910390fd5b606061125c826116d8565b6112ce5760405162461bcd60e51b815260206004820152602660248201527f4b616d6f6e546f6b656e2e746f6b656e5552493a206e6f6e6578697374656e7460448201527f20746f6b656e00000000000000000000000000000000000000000000000000006064820152608401610d5c565b60006112d983610ce3565b6040517f4378a6e3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c1690634378a6e39060240160006040518083038186803b15801561135857600080fd5b505afa15801561136c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611394919081019061228e565b60608101516040517f34320bf10000000000000000000000000000000000000000000000000000000081529192506000916001600160a01b037f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c16916334320bf191611404918791600401612dd8565b60006040518083038186803b15801561141c57600080fd5b505afa158015611430573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261145891908101906121b7565b905060006114758261146b600a89612f83565b8560600151610421565b90506114bb8360400151600a61148b89876119f3565b61149485611c04565b6040516020016114a79493929190612892565b604051602081830303815290604052611c04565b6040516020016114cb9190612a9f565b604051602081830303815290604052945050505050919050565b6040517fc45527910000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600091818416917f000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1169063c45527919060240160206040518083038186803b15801561156657600080fd5b505afa15801561157a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159e919061201b565b6001600160a01b031614156115b55750600161094b565b6001600160a01b0380841660009081526008602090815260408083209386168352929052205460ff165b9392505050565b60006115f160015490565b905090565b6000546001600160a01b031633146116505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d5c565b6001600160a01b0381166116cc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d5c565b6116d58161189e565b50565b60006001548210801561094b575050600090815260056020526040902054600160e01b161590565b60008160015481101561174857600081815260056020526040902054600160e01b8116611746575b806115df575060001901600081815260056020526040902054611728565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546001600160a01b0383166117bd576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816117f4576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600081815260066020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260056020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821061183e5760015550505050565b6000611897600a83612f83565b1592915050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611930903390899088908890600401612cb4565b602060405180830381600087803b15801561194a57600080fd5b505af192505050801561197a575060408051601f3d908101601f191682019092526119779181019061219a565b60015b6119d5573d8080156119a8576040519150601f19603f3d011682016040523d82523d6000602084013e6119ad565b606091505b5080516119cd576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60606119fe8361188a565b611a3d576040518060400160405280600281526020017f4e6f000000000000000000000000000000000000000000000000000000000000815250611a74565b6040518060400160405280600381526020017f59657300000000000000000000000000000000000000000000000000000000008152505b825160208401516040850151608086015151611ac5576040518060400160405280600b81526020017f28616e6f6e796d6f757329000000000000000000000000000000000000000000815250611bd9565b7f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c6001600160a01b031663a57cfb246040518163ffffffff1660e01b815260040160206040518083038186803b158015611b1e57600080fd5b505afa158015611b32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b56919061201b565b6001600160a01b031663841b9d9787608001516040518263ffffffff1660e01b8152600401611b859190612cf0565b60006040518083038186803b158015611b9d57600080fd5b505afa158015611bb1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bd991908101906121b7565b604051602001611bed959493929190612ae4565b604051602081830303815290604052905092915050565b6060815160001415611c2457505060408051602081019091526000815290565b600060405180606001604052806040815260200161301b6040913990506000600384516002611c539190612eba565b611c5d9190612ed2565b611c68906004612ee6565b90506000611c77826020612eba565b67ffffffffffffffff811115611c8f57611c8f612fd9565b6040519080825280601f01601f191660200182016040528015611cb9576020820181803683370190505b509050818152600183018586518101602084015b81831015611d25576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f8116850151825350600101611ccd565b600389510660018114611d3f5760028114611d6b57611d93565b7f3d3d000000000000000000000000000000000000000000000000000000000000600119830152611d93565b7f3d000000000000000000000000000000000000000000000000000000000000006000198301525b509398975050505050505050565b828054611dad90612f48565b90600052602060002090601f016020900481019282611dcf5760008555611e15565b82601f10611de857805160ff1916838001178555611e15565b82800160010185558215611e15579182015b82811115611e15578251825591602001919060010190611dfa565b50611e21929150611e25565b5090565b5b80821115611e215760008155600101611e26565b8035611e4581612fef565b919050565b8051611e4581612fef565b600082601f830112611e6657600080fd5b8135602067ffffffffffffffff80831115611e8357611e83612fd9565b8260051b611e92838201612e61565b8481528381019087850183890186018a1015611ead57600080fd5b600093505b86841015611f4457803585811115611ec957600080fd5b89016040818c03601f1901811315611ee057600080fd5b611ee8612df1565b8883013588811115611ef957600080fd5b611f078e8b83870101611f51565b825250908201359087821115611f1c57600080fd5b611f2a8d8a84860101611f51565b818a01528552505060019390930192918501918501611eb2565b5098975050505050505050565b600082601f830112611f6257600080fd5b8135611f75611f7082612e92565b612e61565b818152846020838601011115611f8a57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112611fb857600080fd5b8151611fc6611f7082612e92565b818152846020838601011115611fdb57600080fd5b6119eb826020830160208701612f1c565b805161ffff81168114611e4557600080fd5b60006020828403121561201057600080fd5b81356115df81612fef565b60006020828403121561202d57600080fd5b81516115df81612fef565b6000806040838503121561204b57600080fd5b823561205681612fef565b9150602083013561206681612fef565b809150509250929050565b60008060006060848603121561208657600080fd5b833561209181612fef565b925060208401356120a181612fef565b929592945050506040919091013590565b600080600080608085870312156120c857600080fd5b84356120d381612fef565b935060208501356120e381612fef565b925060408501359150606085013567ffffffffffffffff81111561210657600080fd5b61211287828801611f51565b91505092959194509250565b6000806040838503121561213157600080fd5b823561213c81612fef565b91506020830135801515811461206657600080fd5b6000806040838503121561216457600080fd5b823561216f81612fef565b946020939093013593505050565b60006020828403121561218f57600080fd5b81356115df81613004565b6000602082840312156121ac57600080fd5b81516115df81613004565b6000602082840312156121c957600080fd5b815167ffffffffffffffff8111156121e057600080fd5b6119eb84828501611fa7565b6000602082840312156121fe57600080fd5b813567ffffffffffffffff81111561221557600080fd5b6119eb84828501611f51565b60008060006060848603121561223657600080fd5b833567ffffffffffffffff8082111561224e57600080fd5b61225a87838801611f51565b945060208601359350604086013591508082111561227757600080fd5b5061228486828701611f51565b9150509250925092565b6000602082840312156122a057600080fd5b815167ffffffffffffffff808211156122b857600080fd5b9083019061012082860312156122cd57600080fd5b6122d5612e1a565b8251828111156122e457600080fd5b6122f087828601611fa7565b82525060208301518281111561230557600080fd5b61231187828601611fa7565b60208301525060408301518281111561232957600080fd5b61233587828601611fa7565b60408301525060608301518281111561234d57600080fd5b61235987828601611fa7565b60608301525060808301518281111561237157600080fd5b61237d87828601611fa7565b60808301525061238f60a08401611e4a565b60a082015260c0830151828111156123a657600080fd5b6123b287828601611fa7565b60c0830152506123c460e08401611fec565b60e082015261010091506123d9828401611fec565b91810191909152949350505050565b600080604083850312156123fb57600080fd5b823567ffffffffffffffff8082111561241357600080fd5b9084019060e0828703121561242757600080fd5b61242f612e3e565b82358281111561243e57600080fd5b61244a88828601611f51565b82525060208301358281111561245f57600080fd5b61246b88828601611f51565b60208301525060408301358281111561248357600080fd5b61248f88828601611f51565b6040830152506060830135828111156124a757600080fd5b6124b388828601611f51565b6060830152506124c560808401611e3a565b608082015260a0830135828111156124dc57600080fd5b6124e888828601611f51565b60a08301525060c08301358281111561250057600080fd5b61250c88828601611e55565b60c0830152509660209590950135955050505050565b60006020828403121561253457600080fd5b5035919050565b60006020828403121561254d57600080fd5b5051919050565b600081518084526020808501808196508360051b8101915082860160005b858110156125c2578284038952815160408151818752612594828801826125cf565b915050868201519150858103878701526125ae81836125cf565b9a87019a9550505090840190600101612572565b5091979650505050505050565b600081518084526125e7816020860160208601612f1c565b601f01601f19169290920160200192915050565b6000815161260d818560208601612f1c565b9290920192915050565b60008251612629818460208701612f1c565b7f3c6c696e6561724772616469656e742069643d22676f6c64222078313d22302e9201918252507f32222078323d2230222079313d2230222079323d2231223e0a20203c73746f7060208201527f206f66667365743d223025222073746f702d636f6c6f723d222343434142303960408201527f222f3e0a203c73746f70206f66667365743d22353025222073746f702d636f6c60608201527f6f723d222346464631383622202f3e0a203c73746f70206f66667365743d223160808201527f303025222073746f702d636f6c6f723d2223434341423039222f3e0a3c2f6c6960a08201527f6e6561724772616469656e743e0a00000000000000000000000000000000000060c082015260ce01919050565b6000855161274e818460208a01612f1c565b80830190507f3c2f646566733e0a203c7265637420783d22302220793d22302220776964746881527f3d223130302522206865696768743d2231303025222066696c6c3d2200000000602082015285516127af81603c840160208a01612f1c565b7f22202f3e0a203c75736520687265663d22000000000000000000000000000000603c929091019182015284516127ed81604d840160208901612f1c565b7f222066696c6c3d22000000000000000000000000000000000000000000000000604d9290910191820152835161282b816055840160208801612f1c565b7f22202f3e0a3c2f7376673e0a0000000000000000000000000000000000000000605592909101918201526061019695505050505050565b60008351612875818460208801612f1c565b835190830190612889818360208801612f1c565b01949350505050565b7f7b226e616d65223a22000000000000000000000000000000000000000000000081526000855160206128cb8260098601838b01612f1c565b7f222c226465736372697074696f6e223a220000000000000000000000000000006009928501928301528654601a90600090600181811c908083168061291257607f831692505b86831081141561293057634e487b7160e01b85526022600452602485fd5b80801561294457600181146129595761298a565b60ff198516898801528389018701955061298a565b60008e81526020902060005b858110156129805781548b82018a0152908401908901612965565b505086848a010195505b5050505050612a4c612a23612a1d6129ce6129c8857f222c2261747472696275746573223a5b00000000000000000000000000000000815260100190565b8c6125fb565b7f5d2c22696d616765223a22646174613a696d6167652f7376672b786d6c3b626181527f736536342c000000000000000000000000000000000000000000000000000000602082015260250190565b896125fb565b7f227d000000000000000000000000000000000000000000000000000000000000815260020190565b9a9950505050505050505050565b7f2300000000000000000000000000000000000000000000000000000000000000815260008251612a92816001850160208701612f1c565b9190910160010192915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251612ad781601d850160208701612f1c565b91909101601d0192915050565b7f7b2274726169745f74797065223a225072696d617279222c2276616c7565223a815260007f22000000000000000000000000000000000000000000000000000000000000008060208401528751612b43816021860160208c01612f1c565b7f227d2c7b2274726169745f74797065223a2247726f7570222c2276616c7565226021918501918201527f3a2200000000000000000000000000000000000000000000000000000000000060418201528751612ba6816043840160208c01612f1c565b7f227d2c7b2274726169745f74797065223a2243617465676f7279222c2276616c604392909101918201527f7565223a2200000000000000000000000000000000000000000000000000000060638201528651612c0a816068840160208b01612f1c565b8082019150507f227d2c7b2274726169745f74797065223a224e616d65222c2276616c7565223a6068820152816088820152612ca7612a23612ca1612c52608985018a6125fb565b7f227d2c7b2274726169745f74797065223a224d696e746572222c2276616c756581527f223a220000000000000000000000000000000000000000000000000000000000602082015260230190565b876125fb565b9998505050505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612ce660808301846125cf565b9695505050505050565b6020815260006115df60208301846125cf565b602081526000825160e06020840152612d206101008401826125cf565b90506020840151601f1980858403016040860152612d3e83836125cf565b92506040860151915080858403016060860152612d5b83836125cf565b92506060860151915080858403016080860152612d7883836125cf565b925060808601519150612d9660a08601836001600160a01b03169052565b60a08601519150808584030160c0860152612db183836125cf565b925060c08601519150808584030160e086015250612dcf8282612554565b95945050505050565b8281526040602082015260006119eb60408301846125cf565b6040805190810167ffffffffffffffff81118282101715612e1457612e14612fd9565b60405290565b604051610120810167ffffffffffffffff81118282101715612e1457612e14612fd9565b60405160e0810167ffffffffffffffff81118282101715612e1457612e14612fd9565b604051601f8201601f1916810167ffffffffffffffff81118282101715612e8a57612e8a612fd9565b604052919050565b600067ffffffffffffffff821115612eac57612eac612fd9565b50601f01601f191660200190565b60008219821115612ecd57612ecd612f97565b500190565b600082612ee157612ee1612fad565b500490565b6000816000190483118215151615612f0057612f00612f97565b500290565b600082821015612f1757612f17612f97565b500390565b60005b83811015612f37578181015183820152602001612f1f565b83811115610f715750506000910152565b600181811c90821680612f5c57607f821691505b60208210811415612f7d57634e487b7160e01b600052602260045260246000fd5b50919050565b600082612f9257612f92612fad565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146116d557600080fd5b6001600160e01b0319811681146116d557600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c7376672076696577426f783d2230203020313032342031303234222020786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667223e0a3c646566733e0aa2646970667358221220333d02de3a7ffa11e66ae88649e88df1a026c9aded73f77592e05950833d54f264736f6c63430008060033

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

000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c0000000000000000000000006a615ca8d7053c0a0de2d11cacb6f321ca63bd62000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1

-----Decoded View---------------
Arg [0] : _registry (address): 0x847A044aF5225f994C60f43e8cF74d20F756187C
Arg [1] : _assetStore (address): 0x847A044aF5225f994C60f43e8cF74d20F756187C
Arg [2] : _developer (address): 0x6a615Ca8D7053c0A0De2d11CACB6f321CA63BD62
Arg [3] : _proxyRegistry (address): 0xa5409ec958C83C3f309868babACA7c86DCB077c1

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c
Arg [1] : 000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c
Arg [2] : 0000000000000000000000006a615ca8d7053c0a0de2d11cacb6f321ca63bd62
Arg [3] : 000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1


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

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