ERC-721
Overview
Max Total Supply
3,036 MATERIAL
Holders
360
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
3 MATERIALLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
MaterialToken
Compiler Version
v0.8.6+commit.11564f7e
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT /* * Material Icon 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 MaterialToken is Ownable, ERC721A, IAssetStoreToken { using Strings for uint256; using Strings for uint16; IAssetStoreRegistry public immutable registry; IAssetStore public immutable assetStore; uint256 constant tokensPerAsset = 4; 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]."; // 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("Material Icons", "MATERIAL") { 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 = "Material Icons (Apache 2.0)"; uint256 assetId = registry.registerAsset(_assetInfo); uint256 tokenId = _nextTokenId(); assetIds[tokenId / tokensPerAsset] = assetId; _mint(msg.sender, tokensPerAsset - 1); // Specified affliate token must be one of soul-bound token and not owned by the minter. if (_affiliate > 0 && _isPrimary(_affiliate) && ownerOf(_affiliate) != msg.sender) { _mint(ownerOf(_affiliate), 1); } else if ((tokenId / tokensPerAsset) % 4 == 0) { // 1 in 24 tokens goes 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' ' <filter id="f1" x="0" y="0" width="200%" height="200%">\n' ' <feOffset result="offOut" in="SourceAlpha" dx="24" dy="32" />\n' ' <feGaussianBlur result="blurOut" in="offOut" stdDeviation="16" />\n' ' <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />\n' ' </filter>\n' '<g id="base">\n' ' <rect x="0" y="0" width="512" height="512" fill="#4285F4" />\n' ' <rect x="0" y="512" width="512" height="512" fill="#34A853" />\n' ' <rect x="512" y="0" width="512" height="512" fill="#FBBC05" />\n' ' <rect x="512" y="512" width="512" height="512" fill="#EA4335"/>\n' '</g>'; /* * 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) { bytes memory assetTag = abi.encodePacked('#', _tag); bytes memory image = abi.encodePacked( SVGHeader, _svgPart, '</defs>\n' '<g filter="url(#f1)">\n'); if (_style == 0) { image = abi.encodePacked(image, ' <mask id="assetMask">\n' ' <use href="', assetTag, '" fill="white" />\n' ' </mask>\n' ' <use href="#base" mask="url(#assetMask)" />\n'); } else if (_style < tokensPerAsset - 1) { image = abi.encodePacked(image, ' <use href="#base" />\n' ' <use href="', assetTag, '" fill="',(_style % 2 == 0) ? 'black':'white','" />\n'); } else { image = abi.encodePacked(image, ' <mask id="assetMask" desc="Material Icons (Apache 2.0)/Social/Public">\n' ' <rect x="0" y="0" width="1024" height="1024" fill="white" />\n' ' <use href="', assetTag, '" fill="black" />\n' ' </mask>\n' ' <use href="#base" mask="url(#assetMask)" />\n'); } return string(abi.encodePacked(image, '</g>\n</svg>')); } /* * 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), 'MaterialToken.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":"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), 'MaterialToken.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), '"}') ) ) ) ); } }
// 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); } }
// 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 {} }
// 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) } } }
// 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; }
// 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); }
// 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; } }
// 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); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; interface IProxyRegistry { function proxies(address) external view returns (address); }
// 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; } }
// 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); }
// 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); }
// 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); }
// 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); } } } }
// 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; } }
// 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); }
// 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); }
// 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); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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":"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"}]
Contract Creation Code
610160604052604e60e081815290620034086101003980516200002b91600a916020909101906200018f565b503480156200003957600080fd5b5060405162003456380380620034568339810160408190526200005c9162000235565b6040518060400160405280600e81526020016d4d6174657269616c2049636f6e7360901b81525060405180604001604052806008815260200167135055115492505360c21b815250620000be620000b86200013b60201b60201c565b6200013f565b8151620000d39060039060208501906200018f565b508051620000e99060049060208401906200018f565b5060006001555050606093841b6001600160601b031990811660805292841b831660a052600b80546001600160a01b0319166001600160a01b03939093169290921790915590911b1660c052620002f3565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8280546200019d906200029d565b90600052602060002090601f016020900481019282620001c157600085556200020c565b82601f10620001dc57805160ff19168380011785556200020c565b828001600101855582156200020c579182015b828111156200020c578251825591602001919060010190620001ef565b506200021a9291506200021e565b5090565b5b808211156200021a57600081556001016200021f565b600080600080608085870312156200024c57600080fd5b84516200025981620002da565b60208601519094506200026c81620002da565b60408601519093506200027f81620002da565b60608601519092506200029281620002da565b939692955090935050565b600181811c90821680620002b257607f821691505b60208210811415620002d457634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b0381168114620002f057600080fd5b50565b60805160601c60a05160601c60c05160601c6130b96200034f6000396000818161038d01526112120152600081816102c301528181611004015281816110bd01526117b00152600081816103270152610aff01526130b96000f3fe608060405234801561001057600080fd5b50600436106101c35760003560e01c80637284e416116100f9578063b50cbd9f11610097578063ca4b208b11610071578063ca4b208b146103d5578063e985e9c5146103e8578063ef2d1746146103fb578063f2fde38b1461040357600080fd5b8063b50cbd9f14610388578063b88d4fde146103af578063c87b56dd146103c257600080fd5b80638da5cb5b116100d35780638da5cb5b1461034957806390c3f38f1461035a57806395d89b411461036d578063a22cb4651461037557600080fd5b80637284e41614610313578063786f94c61461031b5780637b1039991461032257600080fd5b80632ab72d2f11610166578063597a0e3611610140578063597a0e36146102be5780636352211e146102e557806370a08231146102f8578063715018a61461030b57600080fd5b80632ab72d2f1461028557806342842e0e146102985780634f38687b146102ab57600080fd5b8063081812fc116101a2578063081812fc1461021c578063095ea7b31461024757806318160ddd1461025c57806323b872dd1461027257600080fd5b80626e59e9146101c857806301ffc9a7146101f157806306fdde0314610214575b600080fd5b6101db6101d6366004611f09565b610416565b6040516101e89190612ad0565b60405180910390f35b6102046101ff366004611e65565b6105a3565b60405190151581526020016101e8565b6101db610640565b61022f61022a36600461220a565b6106d2565b6040516001600160a01b0390911681526020016101e8565b61025a610255366004611e39565b61072f565b005b600254600154035b6040519081526020016101e8565b61025a610280366004611d59565b6107f5565b61026461029336600461220a565b6109d2565b61025a6102a6366004611d59565b610a79565b61025a6102b93660046120d0565b610a99565b61022f7f000000000000000000000000000000000000000000000000000000000000000081565b61022f6102f336600461220a565b610c65565b610264610306366004611ce6565b610c70565b61025a610cd8565b6101db610d3e565b6004610264565b61022f7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b031661022f565b61025a610368366004611ed4565b610dcc565b6101db610e3d565b61025a610383366004611e06565b610e4c565b61022f7f000000000000000000000000000000000000000000000000000000000000000081565b61025a6103bd366004611d9a565b610efb565b6101db6103d036600461220a565b610f3f565b600b5461022f906001600160a01b031681565b6102046103f6366004611d20565b6111d3565b6102646112d4565b61025a610411366004611ce6565b6112e4565b606060008260405160200161042b9190612879565b60408051601f19818403018152610280830190915261025f80835290925060009190612e2560208301398660405160200161046792919061265a565b604051602081830303815290604052905084600014156104aa578082604051602001610494929190612428565b6040516020818303038152906040529050610578565b6104b660016004612ce5565b8510156105535780826104ca600288612d63565b1561050a576040518060400160405280600581526020017f7768697465000000000000000000000000000000000000000000000000000000815250610541565b6040518060400160405280600581526020017f626c61636b0000000000000000000000000000000000000000000000000000008152505b604051602001610494939291906122ff565b8082604051602001610566929190612508565b60405160208183030381529060405290505b8060405160200161058991906123e7565b604051602081830303815290604052925050509392505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316148061060657507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b8061063a57507f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b60606003805461064f90612d28565b80601f016020809104026020016040519081016040528092919081815260200182805461067b90612d28565b80156106c85780601f1061069d576101008083540402835291602001916106c8565b820191906000526020600020905b8154815290600101906020018083116106ab57829003601f168201915b5050505050905090565b60006106dd826113c6565b610713576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b600061073a82610c65565b9050336001600160a01b0382161461078c5761075681336111d3565b61078c576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260076020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000610800826113ee565b9050836001600160a01b0316816001600160a01b03161461084d576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526007602052604090208054338082146001600160a01b038816909114176108b35761087d86336111d3565b6108b3576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385166108f3576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80156108fe57600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040902055600160e11b831661098957600184016000818152600560205260409020546109875760015481146109875760008181526005602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b60006109dd826113c6565b610a545760405162461bcd60e51b815260206004820152602f60248201527f4d6174657269616c546f6b656e2e617373657449644f66546f6b656e3a206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084015b60405180910390fd5b60096000610a63600485612cb2565b8152602001908152602001600020549050919050565b610a9483838360405180602001604052806000815250610efb565b505050565b604080518082018252601b81527f4d6174657269616c2049636f6e73202841706163686520322e3029000000000060208201528352517f5b7eea860000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635b7eea8690610b34908690600401612ae3565b602060405180830381600087803b158015610b4e57600080fd5b505af1158015610b62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b869190612223565b90506000610b9360015490565b90508160096000610ba5600485612cb2565b8152602081019190915260400160002055610bcb33610bc660016004612ce5565b611468565b600083118015610bdf5750610bdf83611578565b8015610bfc575033610bf084610c65565b6001600160a01b031614155b15610c1957610c14610c0d84610c65565b6001611468565b610c5f565b6004610c258183612cb2565b610c2f9190612d63565b610c4a57600b54610c14906001600160a01b03166001611468565b610c5f610c0d6000546001600160a01b031690565b50505050565b600061063a826113ee565b60006001600160a01b038216610cb2576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205467ffffffffffffffff1690565b6000546001600160a01b03163314610d325760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a4b565b610d3c600061158c565b565b600a8054610d4b90612d28565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7790612d28565b8015610dc45780601f10610d9957610100808354040283529160200191610dc4565b820191906000526020600020905b815481529060010190602001808311610da757829003601f168201915b505050505081565b6000546001600160a01b03163314610e265760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a4b565b8051610e3990600a906020840190611a89565b5050565b60606004805461064f90612d28565b6001600160a01b038216331415610e8f576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610f068484846107f5565b6001600160a01b0383163b15610c5f57610f22848484846115e9565b610c5f576040516368d2bf6b60e11b815260040160405180910390fd5b6060610f4a826113c6565b610fbc5760405162461bcd60e51b815260206004820152602960248201527f4d6174657269616c546f6b656e2e746f6b656e5552493a206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610a4b565b6000610fc7836109d2565b6040517f4378a6e3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634378a6e39060240160006040518083038186803b15801561104657600080fd5b505afa15801561105a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110829190810190611f76565b60608101516040517f34320bf10000000000000000000000000000000000000000000000000000000081529192506000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916334320bf1916110f2918791600401612bb8565b60006040518083038186803b15801561110a57600080fd5b505afa15801561111e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111469190810190611e9f565b9050600061116382611159600489612d63565b8560600151610416565b90506111a98360400151600a61117989876116e1565b611182856118ec565b60405160200161119594939291906126b1565b6040516020818303038152906040526118ec565b6040516020016111b991906128be565b604051602081830303815290604052945050505050919050565b6040517fc45527910000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600091818416917f0000000000000000000000000000000000000000000000000000000000000000169063c45527919060240160206040518083038186803b15801561125457600080fd5b505afa158015611268573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128c9190611d03565b6001600160a01b031614156112a35750600161063a565b6001600160a01b0380841660009081526008602090815260408083209386168352929052205460ff165b9392505050565b60006112df60015490565b905090565b6000546001600160a01b0316331461133e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a4b565b6001600160a01b0381166113ba5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a4b565b6113c38161158c565b50565b60006001548210801561063a575050600090815260056020526040902054600160e01b161590565b60008160015481101561143657600081815260056020526040902054600160e01b8116611434575b806112cd575060001901600081815260056020526040902054611416565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546001600160a01b0383166114ab576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816114e2576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600081815260066020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260056020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821061152c5760015550505050565b6000611585600483612d63565b1592915050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061161e903390899088908890600401612a94565b602060405180830381600087803b15801561163857600080fd5b505af1925050508015611668575060408051601f3d908101601f1916820190925261166591810190611e82565b60015b6116c3573d808015611696576040519150601f19603f3d011682016040523d82523d6000602084013e61169b565b606091505b5080516116bb576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60606116ec83611578565b61172b576040518060400160405280600281526020017f4e6f000000000000000000000000000000000000000000000000000000000000815250611762565b6040518060400160405280600381526020017f59657300000000000000000000000000000000000000000000000000000000008152505b825160208401516080850151516117ae576040518060400160405280600b81526020017f28616e6f6e796d6f7573290000000000000000000000000000000000000000008152506118c2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a57cfb246040518163ffffffff1660e01b815260040160206040518083038186803b15801561180757600080fd5b505afa15801561181b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183f9190611d03565b6001600160a01b031663841b9d9786608001516040518263ffffffff1660e01b815260040161186e9190612ad0565b60006040518083038186803b15801561188657600080fd5b505afa15801561189a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118c29190810190611e9f565b6040516020016118d59493929190612903565b604051602081830303815290604052905092915050565b606081516000141561190c57505060408051602081019091526000815290565b6000604051806060016040528060408152602001612de5604091399050600060038451600261193b9190612c9a565b6119459190612cb2565b611950906004612cc6565b9050600061195f826020612c9a565b67ffffffffffffffff81111561197757611977612da3565b6040519080825280601f01601f1916602001820160405280156119a1576020820181803683370190505b509050818152600183018586518101602084015b81831015611a0d576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f81168501518253506001016119b5565b600389510660018114611a275760028114611a5357611a7b565b7f3d3d000000000000000000000000000000000000000000000000000000000000600119830152611a7b565b7f3d000000000000000000000000000000000000000000000000000000000000006000198301525b509398975050505050505050565b828054611a9590612d28565b90600052602060002090601f016020900481019282611ab75760008555611afd565b82601f10611ad057805160ff1916838001178555611afd565b82800160010185558215611afd579182015b82811115611afd578251825591602001919060010190611ae2565b50611b09929150611b0d565b5090565b5b80821115611b095760008155600101611b0e565b8035611b2d81612db9565b919050565b8051611b2d81612db9565b600082601f830112611b4e57600080fd5b8135602067ffffffffffffffff80831115611b6b57611b6b612da3565b8260051b611b7a838201612c41565b8481528381019087850183890186018a1015611b9557600080fd5b600093505b86841015611c2c57803585811115611bb157600080fd5b89016040818c03601f1901811315611bc857600080fd5b611bd0612bd1565b8883013588811115611be157600080fd5b611bef8e8b83870101611c39565b825250908201359087821115611c0457600080fd5b611c128d8a84860101611c39565b818a01528552505060019390930192918501918501611b9a565b5098975050505050505050565b600082601f830112611c4a57600080fd5b8135611c5d611c5882612c72565b612c41565b818152846020838601011115611c7257600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112611ca057600080fd5b8151611cae611c5882612c72565b818152846020838601011115611cc357600080fd5b6116d9826020830160208701612cfc565b805161ffff81168114611b2d57600080fd5b600060208284031215611cf857600080fd5b81356112cd81612db9565b600060208284031215611d1557600080fd5b81516112cd81612db9565b60008060408385031215611d3357600080fd5b8235611d3e81612db9565b91506020830135611d4e81612db9565b809150509250929050565b600080600060608486031215611d6e57600080fd5b8335611d7981612db9565b92506020840135611d8981612db9565b929592945050506040919091013590565b60008060008060808587031215611db057600080fd5b8435611dbb81612db9565b93506020850135611dcb81612db9565b925060408501359150606085013567ffffffffffffffff811115611dee57600080fd5b611dfa87828801611c39565b91505092959194509250565b60008060408385031215611e1957600080fd5b8235611e2481612db9565b915060208301358015158114611d4e57600080fd5b60008060408385031215611e4c57600080fd5b8235611e5781612db9565b946020939093013593505050565b600060208284031215611e7757600080fd5b81356112cd81612dce565b600060208284031215611e9457600080fd5b81516112cd81612dce565b600060208284031215611eb157600080fd5b815167ffffffffffffffff811115611ec857600080fd5b6116d984828501611c8f565b600060208284031215611ee657600080fd5b813567ffffffffffffffff811115611efd57600080fd5b6116d984828501611c39565b600080600060608486031215611f1e57600080fd5b833567ffffffffffffffff80821115611f3657600080fd5b611f4287838801611c39565b9450602086013593506040860135915080821115611f5f57600080fd5b50611f6c86828701611c39565b9150509250925092565b600060208284031215611f8857600080fd5b815167ffffffffffffffff80821115611fa057600080fd5b908301906101208286031215611fb557600080fd5b611fbd612bfa565b825182811115611fcc57600080fd5b611fd887828601611c8f565b825250602083015182811115611fed57600080fd5b611ff987828601611c8f565b60208301525060408301518281111561201157600080fd5b61201d87828601611c8f565b60408301525060608301518281111561203557600080fd5b61204187828601611c8f565b60608301525060808301518281111561205957600080fd5b61206587828601611c8f565b60808301525061207760a08401611b32565b60a082015260c08301518281111561208e57600080fd5b61209a87828601611c8f565b60c0830152506120ac60e08401611cd4565b60e082015261010091506120c1828401611cd4565b91810191909152949350505050565b600080604083850312156120e357600080fd5b823567ffffffffffffffff808211156120fb57600080fd5b9084019060e0828703121561210f57600080fd5b612117612c1e565b82358281111561212657600080fd5b61213288828601611c39565b82525060208301358281111561214757600080fd5b61215388828601611c39565b60208301525060408301358281111561216b57600080fd5b61217788828601611c39565b60408301525060608301358281111561218f57600080fd5b61219b88828601611c39565b6060830152506121ad60808401611b22565b608082015260a0830135828111156121c457600080fd5b6121d088828601611c39565b60a08301525060c0830135828111156121e857600080fd5b6121f488828601611b3d565b60c0830152509660209590950135955050505050565b60006020828403121561221c57600080fd5b5035919050565b60006020828403121561223557600080fd5b5051919050565b600081518084526020808501808196508360051b8101915082860160005b858110156122aa57828403895281516040815181875261227c828801826122b7565b9150508682015191508581038787015261229681836122b7565b9a87019a955050509084019060010161225a565b5091979650505050505050565b600081518084526122cf816020860160208601612cfc565b601f01601f19169290920160200192915050565b600081516122f5818560208601612cfc565b9290920192915050565b60008451612311818460208901612cfc565b80830190507f203c75736520687265663d22236261736522202f3e0a203c757365206872656681527f3d2200000000000000000000000000000000000000000000000000000000000060208201528451612372816022840160208901612cfc565b7f222066696c6c3d220000000000000000000000000000000000000000000000006022929091019182015283516123b081602a840160208801612cfc565b7f22202f3e0a000000000000000000000000000000000000000000000000000000602a9290910191820152602f0195945050505050565b600082516123f9818460208701612cfc565b7f3c2f673e0a3c2f7376673e000000000000000000000000000000000000000000920191825250600b01919050565b6000835161243a818460208801612cfc565b80830190507f203c6d61736b2069643d2261737365744d61736b223e0a20203c75736520687281527f65663d22000000000000000000000000000000000000000000000000000000006020820152835161249b816024840160208801612cfc565b7f222066696c6c3d22776869746522202f3e0a203c2f6d61736b3e0a203c757365602492909101918201527f20687265663d22236261736522206d61736b3d2275726c282361737365744d6160448201526739b5949110179f0560c11b6064820152606c01949350505050565b6000835161251a818460208801612cfc565b80830190507f203c6d61736b2069643d2261737365744d61736b2220646573633d224d61746581527f7269616c2049636f6e73202841706163686520322e30292f536f6369616c2f5060208201527f75626c6963223e0a20203c7265637420783d22302220793d223022207769647460408201527f683d223130323422206865696768743d2231303234222066696c6c3d2277686960608201527f746522202f3e0a20203c75736520687265663d22000000000000000000000000608082015283516125ed816094840160208801612cfc565b7f222066696c6c3d22626c61636b22202f3e0a203c2f6d61736b3e0a203c757365609492909101918201527f20687265663d22236261736522206d61736b3d2275726c282361737365744d6160b48201526739b5949110179f0560c11b60d482015260dc01949350505050565b6000835161266c818460208801612cfc565b835190830190612680818360208801612cfc565b7f3c2f646566733e0a3c672066696c7465723d2275726c2823663129223e0a00009101908152601e01949350505050565b7f7b226e616d65223a22000000000000000000000000000000000000000000000081526000855160206126ea8260098601838b01612cfc565b7f222c226465736372697074696f6e223a220000000000000000000000000000006009928501928301528654601a90600090600181811c908083168061273157607f831692505b86831081141561274f57634e487b7160e01b85526022600452602485fd5b8080156127635760018114612778576127a9565b60ff19851689880152838901870195506127a9565b60008e81526020902060005b8581101561279f5781548b82018a0152908401908901612784565b505086848a010195505b505050505061286b61284261283c6127ed6127e7857f222c2261747472696275746573223a5b00000000000000000000000000000000815260100190565b8c6122e3565b7f5d2c22696d616765223a22646174613a696d6167652f7376672b786d6c3b626181527f736536342c000000000000000000000000000000000000000000000000000000602082015260250190565b896122e3565b7f227d000000000000000000000000000000000000000000000000000000000000815260020190565b9a9950505050505050505050565b7f23000000000000000000000000000000000000000000000000000000000000008152600082516128b1816001850160208701612cfc565b9190910160010192915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516128f681601d850160208701612cfc565b91909101601d0192915050565b7f7b2274726169745f74797065223a225072696d617279222c2276616c7565223a81527f2200000000000000000000000000000000000000000000000000000000000000602082015260008551612961816021850160208a01612cfc565b7f227d2c7b2274726169745f74797065223a2247726f7570222c2276616c7565226021918401918201527f3a22000000000000000000000000000000000000000000000000000000000000604182015285516129c4816043840160208a01612cfc565b7f227d2c7b2274726169745f74797065223a2243617465676f7279222c2276616c604392909101918201527f7565223a2200000000000000000000000000000000000000000000000000000060638201528451612a28816068840160208901612cfc565b7f227d2c7b2274726169745f74797065223a224d696e746572222c2276616c7565606892909101918201527f223a2200000000000000000000000000000000000000000000000000000000006088820152612a89612842608b8301866122e3565b979650505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612ac660808301846122b7565b9695505050505050565b6020815260006112cd60208301846122b7565b602081526000825160e06020840152612b006101008401826122b7565b90506020840151601f1980858403016040860152612b1e83836122b7565b92506040860151915080858403016060860152612b3b83836122b7565b92506060860151915080858403016080860152612b5883836122b7565b925060808601519150612b7660a08601836001600160a01b03169052565b60a08601519150808584030160c0860152612b9183836122b7565b925060c08601519150808584030160e086015250612baf828261223c565b95945050505050565b8281526040602082015260006116d960408301846122b7565b6040805190810167ffffffffffffffff81118282101715612bf457612bf4612da3565b60405290565b604051610120810167ffffffffffffffff81118282101715612bf457612bf4612da3565b60405160e0810167ffffffffffffffff81118282101715612bf457612bf4612da3565b604051601f8201601f1916810167ffffffffffffffff81118282101715612c6a57612c6a612da3565b604052919050565b600067ffffffffffffffff821115612c8c57612c8c612da3565b50601f01601f191660200190565b60008219821115612cad57612cad612d77565b500190565b600082612cc157612cc1612d8d565b500490565b6000816000190483118215151615612ce057612ce0612d77565b500290565b600082821015612cf757612cf7612d77565b500390565b60005b83811015612d17578181015183820152602001612cff565b83811115610c5f5750506000910152565b600181811c90821680612d3c57607f821691505b60208210811415612d5d57634e487b7160e01b600052602260045260246000fd5b50919050565b600082612d7257612d72612d8d565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146113c357600080fd5b6001600160e01b0319811681146113c357600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c7376672076696577426f783d2230203020313032342031303234222020786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667223e0a3c646566733e0a203c66696c7465722069643d2266312220783d22302220793d2230222077696474683d223230302522206865696768743d2232303025223e0a20203c66654f666673657420726573756c743d226f66664f75742220696e3d22536f75726365416c706861222064783d223234222064793d22333222202f3e0a20203c6665476175737369616e426c757220726573756c743d22626c75724f75742220696e3d226f66664f75742220737464446576696174696f6e3d22313622202f3e0a20203c6665426c656e6420696e3d22536f75726365477261706869632220696e323d22626c75724f757422206d6f64653d226e6f726d616c22202f3e0a203c2f66696c7465723e0a3c672069643d2262617365223e0a203c7265637420783d22302220793d2230222077696474683d2235313222206865696768743d22353132222066696c6c3d222334323835463422202f3e0a203c7265637420783d22302220793d22353132222077696474683d2235313222206865696768743d22353132222066696c6c3d222333344138353322202f3e0a203c7265637420783d223531322220793d2230222077696474683d2235313222206865696768743d22353132222066696c6c3d222346424243303522202f3e0a203c7265637420783d223531322220793d22353132222077696474683d2235313222206865696768743d22353132222066696c6c3d2223454134333335222f3e0a3c2f673ea26469706673582212201477be6c8b77ff9747c3e4ff5833904c4d3d508434c53aa840376f5ecd5923b964736f6c6343000806003354686973206973206f6e65206f6620656666747320746f2063726561746520284f6e2d436861696e2041737365742053746f7265295b68747470733a2f2f617373657473746f72652e7774665d2e000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c0000000000000000000000006a615ca8d7053c0a0de2d11cacb6f321ca63bd62000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c35760003560e01c80637284e416116100f9578063b50cbd9f11610097578063ca4b208b11610071578063ca4b208b146103d5578063e985e9c5146103e8578063ef2d1746146103fb578063f2fde38b1461040357600080fd5b8063b50cbd9f14610388578063b88d4fde146103af578063c87b56dd146103c257600080fd5b80638da5cb5b116100d35780638da5cb5b1461034957806390c3f38f1461035a57806395d89b411461036d578063a22cb4651461037557600080fd5b80637284e41614610313578063786f94c61461031b5780637b1039991461032257600080fd5b80632ab72d2f11610166578063597a0e3611610140578063597a0e36146102be5780636352211e146102e557806370a08231146102f8578063715018a61461030b57600080fd5b80632ab72d2f1461028557806342842e0e146102985780634f38687b146102ab57600080fd5b8063081812fc116101a2578063081812fc1461021c578063095ea7b31461024757806318160ddd1461025c57806323b872dd1461027257600080fd5b80626e59e9146101c857806301ffc9a7146101f157806306fdde0314610214575b600080fd5b6101db6101d6366004611f09565b610416565b6040516101e89190612ad0565b60405180910390f35b6102046101ff366004611e65565b6105a3565b60405190151581526020016101e8565b6101db610640565b61022f61022a36600461220a565b6106d2565b6040516001600160a01b0390911681526020016101e8565b61025a610255366004611e39565b61072f565b005b600254600154035b6040519081526020016101e8565b61025a610280366004611d59565b6107f5565b61026461029336600461220a565b6109d2565b61025a6102a6366004611d59565b610a79565b61025a6102b93660046120d0565b610a99565b61022f7f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c81565b61022f6102f336600461220a565b610c65565b610264610306366004611ce6565b610c70565b61025a610cd8565b6101db610d3e565b6004610264565b61022f7f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c81565b6000546001600160a01b031661022f565b61025a610368366004611ed4565b610dcc565b6101db610e3d565b61025a610383366004611e06565b610e4c565b61022f7f000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c181565b61025a6103bd366004611d9a565b610efb565b6101db6103d036600461220a565b610f3f565b600b5461022f906001600160a01b031681565b6102046103f6366004611d20565b6111d3565b6102646112d4565b61025a610411366004611ce6565b6112e4565b606060008260405160200161042b9190612879565b60408051601f19818403018152610280830190915261025f80835290925060009190612e2560208301398660405160200161046792919061265a565b604051602081830303815290604052905084600014156104aa578082604051602001610494929190612428565b6040516020818303038152906040529050610578565b6104b660016004612ce5565b8510156105535780826104ca600288612d63565b1561050a576040518060400160405280600581526020017f7768697465000000000000000000000000000000000000000000000000000000815250610541565b6040518060400160405280600581526020017f626c61636b0000000000000000000000000000000000000000000000000000008152505b604051602001610494939291906122ff565b8082604051602001610566929190612508565b60405160208183030381529060405290505b8060405160200161058991906123e7565b604051602081830303815290604052925050509392505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316148061060657507f80ac58cd000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b8061063a57507f5b5e139f000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b60606003805461064f90612d28565b80601f016020809104026020016040519081016040528092919081815260200182805461067b90612d28565b80156106c85780601f1061069d576101008083540402835291602001916106c8565b820191906000526020600020905b8154815290600101906020018083116106ab57829003601f168201915b5050505050905090565b60006106dd826113c6565b610713576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b600061073a82610c65565b9050336001600160a01b0382161461078c5761075681336111d3565b61078c576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260076020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000610800826113ee565b9050836001600160a01b0316816001600160a01b03161461084d576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526007602052604090208054338082146001600160a01b038816909114176108b35761087d86336111d3565b6108b3576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385166108f3576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80156108fe57600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040902055600160e11b831661098957600184016000818152600560205260409020546109875760015481146109875760008181526005602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b60006109dd826113c6565b610a545760405162461bcd60e51b815260206004820152602f60248201527f4d6174657269616c546f6b656e2e617373657449644f66546f6b656e3a206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084015b60405180910390fd5b60096000610a63600485612cb2565b8152602001908152602001600020549050919050565b610a9483838360405180602001604052806000815250610efb565b505050565b604080518082018252601b81527f4d6174657269616c2049636f6e73202841706163686520322e3029000000000060208201528352517f5b7eea860000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c1690635b7eea8690610b34908690600401612ae3565b602060405180830381600087803b158015610b4e57600080fd5b505af1158015610b62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b869190612223565b90506000610b9360015490565b90508160096000610ba5600485612cb2565b8152602081019190915260400160002055610bcb33610bc660016004612ce5565b611468565b600083118015610bdf5750610bdf83611578565b8015610bfc575033610bf084610c65565b6001600160a01b031614155b15610c1957610c14610c0d84610c65565b6001611468565b610c5f565b6004610c258183612cb2565b610c2f9190612d63565b610c4a57600b54610c14906001600160a01b03166001611468565b610c5f610c0d6000546001600160a01b031690565b50505050565b600061063a826113ee565b60006001600160a01b038216610cb2576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526006602052604090205467ffffffffffffffff1690565b6000546001600160a01b03163314610d325760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a4b565b610d3c600061158c565b565b600a8054610d4b90612d28565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7790612d28565b8015610dc45780601f10610d9957610100808354040283529160200191610dc4565b820191906000526020600020905b815481529060010190602001808311610da757829003601f168201915b505050505081565b6000546001600160a01b03163314610e265760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a4b565b8051610e3990600a906020840190611a89565b5050565b60606004805461064f90612d28565b6001600160a01b038216331415610e8f576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610f068484846107f5565b6001600160a01b0383163b15610c5f57610f22848484846115e9565b610c5f576040516368d2bf6b60e11b815260040160405180910390fd5b6060610f4a826113c6565b610fbc5760405162461bcd60e51b815260206004820152602960248201527f4d6174657269616c546f6b656e2e746f6b656e5552493a206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610a4b565b6000610fc7836109d2565b6040517f4378a6e3000000000000000000000000000000000000000000000000000000008152600481018290529091506000906001600160a01b037f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c1690634378a6e39060240160006040518083038186803b15801561104657600080fd5b505afa15801561105a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110829190810190611f76565b60608101516040517f34320bf10000000000000000000000000000000000000000000000000000000081529192506000916001600160a01b037f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c16916334320bf1916110f2918791600401612bb8565b60006040518083038186803b15801561110a57600080fd5b505afa15801561111e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111469190810190611e9f565b9050600061116382611159600489612d63565b8560600151610416565b90506111a98360400151600a61117989876116e1565b611182856118ec565b60405160200161119594939291906126b1565b6040516020818303038152906040526118ec565b6040516020016111b991906128be565b604051602081830303815290604052945050505050919050565b6040517fc45527910000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600091818416917f000000000000000000000000a5409ec958c83c3f309868babaca7c86dcb077c1169063c45527919060240160206040518083038186803b15801561125457600080fd5b505afa158015611268573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128c9190611d03565b6001600160a01b031614156112a35750600161063a565b6001600160a01b0380841660009081526008602090815260408083209386168352929052205460ff165b9392505050565b60006112df60015490565b905090565b6000546001600160a01b0316331461133e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a4b565b6001600160a01b0381166113ba5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a4b565b6113c38161158c565b50565b60006001548210801561063a575050600090815260056020526040902054600160e01b161590565b60008160015481101561143657600081815260056020526040902054600160e01b8116611434575b806112cd575060001901600081815260056020526040902054611416565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546001600160a01b0383166114ab576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816114e2576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600081815260066020526040902080546801000000000000000185020190554260a01b6001841460e11b1717600082815260056020526040902055808281015b6040516001830192906001600160a01b038716906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821061152c5760015550505050565b6000611585600483612d63565b1592915050565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061161e903390899088908890600401612a94565b602060405180830381600087803b15801561163857600080fd5b505af1925050508015611668575060408051601f3d908101601f1916820190925261166591810190611e82565b60015b6116c3573d808015611696576040519150601f19603f3d011682016040523d82523d6000602084013e61169b565b606091505b5080516116bb576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60606116ec83611578565b61172b576040518060400160405280600281526020017f4e6f000000000000000000000000000000000000000000000000000000000000815250611762565b6040518060400160405280600381526020017f59657300000000000000000000000000000000000000000000000000000000008152505b825160208401516080850151516117ae576040518060400160405280600b81526020017f28616e6f6e796d6f7573290000000000000000000000000000000000000000008152506118c2565b7f000000000000000000000000847a044af5225f994c60f43e8cf74d20f756187c6001600160a01b031663a57cfb246040518163ffffffff1660e01b815260040160206040518083038186803b15801561180757600080fd5b505afa15801561181b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183f9190611d03565b6001600160a01b031663841b9d9786608001516040518263ffffffff1660e01b815260040161186e9190612ad0565b60006040518083038186803b15801561188657600080fd5b505afa15801561189a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118c29190810190611e9f565b6040516020016118d59493929190612903565b604051602081830303815290604052905092915050565b606081516000141561190c57505060408051602081019091526000815290565b6000604051806060016040528060408152602001612de5604091399050600060038451600261193b9190612c9a565b6119459190612cb2565b611950906004612cc6565b9050600061195f826020612c9a565b67ffffffffffffffff81111561197757611977612da3565b6040519080825280601f01601f1916602001820160405280156119a1576020820181803683370190505b509050818152600183018586518101602084015b81831015611a0d576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f81168501518253506001016119b5565b600389510660018114611a275760028114611a5357611a7b565b7f3d3d000000000000000000000000000000000000000000000000000000000000600119830152611a7b565b7f3d000000000000000000000000000000000000000000000000000000000000006000198301525b509398975050505050505050565b828054611a9590612d28565b90600052602060002090601f016020900481019282611ab75760008555611afd565b82601f10611ad057805160ff1916838001178555611afd565b82800160010185558215611afd579182015b82811115611afd578251825591602001919060010190611ae2565b50611b09929150611b0d565b5090565b5b80821115611b095760008155600101611b0e565b8035611b2d81612db9565b919050565b8051611b2d81612db9565b600082601f830112611b4e57600080fd5b8135602067ffffffffffffffff80831115611b6b57611b6b612da3565b8260051b611b7a838201612c41565b8481528381019087850183890186018a1015611b9557600080fd5b600093505b86841015611c2c57803585811115611bb157600080fd5b89016040818c03601f1901811315611bc857600080fd5b611bd0612bd1565b8883013588811115611be157600080fd5b611bef8e8b83870101611c39565b825250908201359087821115611c0457600080fd5b611c128d8a84860101611c39565b818a01528552505060019390930192918501918501611b9a565b5098975050505050505050565b600082601f830112611c4a57600080fd5b8135611c5d611c5882612c72565b612c41565b818152846020838601011115611c7257600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112611ca057600080fd5b8151611cae611c5882612c72565b818152846020838601011115611cc357600080fd5b6116d9826020830160208701612cfc565b805161ffff81168114611b2d57600080fd5b600060208284031215611cf857600080fd5b81356112cd81612db9565b600060208284031215611d1557600080fd5b81516112cd81612db9565b60008060408385031215611d3357600080fd5b8235611d3e81612db9565b91506020830135611d4e81612db9565b809150509250929050565b600080600060608486031215611d6e57600080fd5b8335611d7981612db9565b92506020840135611d8981612db9565b929592945050506040919091013590565b60008060008060808587031215611db057600080fd5b8435611dbb81612db9565b93506020850135611dcb81612db9565b925060408501359150606085013567ffffffffffffffff811115611dee57600080fd5b611dfa87828801611c39565b91505092959194509250565b60008060408385031215611e1957600080fd5b8235611e2481612db9565b915060208301358015158114611d4e57600080fd5b60008060408385031215611e4c57600080fd5b8235611e5781612db9565b946020939093013593505050565b600060208284031215611e7757600080fd5b81356112cd81612dce565b600060208284031215611e9457600080fd5b81516112cd81612dce565b600060208284031215611eb157600080fd5b815167ffffffffffffffff811115611ec857600080fd5b6116d984828501611c8f565b600060208284031215611ee657600080fd5b813567ffffffffffffffff811115611efd57600080fd5b6116d984828501611c39565b600080600060608486031215611f1e57600080fd5b833567ffffffffffffffff80821115611f3657600080fd5b611f4287838801611c39565b9450602086013593506040860135915080821115611f5f57600080fd5b50611f6c86828701611c39565b9150509250925092565b600060208284031215611f8857600080fd5b815167ffffffffffffffff80821115611fa057600080fd5b908301906101208286031215611fb557600080fd5b611fbd612bfa565b825182811115611fcc57600080fd5b611fd887828601611c8f565b825250602083015182811115611fed57600080fd5b611ff987828601611c8f565b60208301525060408301518281111561201157600080fd5b61201d87828601611c8f565b60408301525060608301518281111561203557600080fd5b61204187828601611c8f565b60608301525060808301518281111561205957600080fd5b61206587828601611c8f565b60808301525061207760a08401611b32565b60a082015260c08301518281111561208e57600080fd5b61209a87828601611c8f565b60c0830152506120ac60e08401611cd4565b60e082015261010091506120c1828401611cd4565b91810191909152949350505050565b600080604083850312156120e357600080fd5b823567ffffffffffffffff808211156120fb57600080fd5b9084019060e0828703121561210f57600080fd5b612117612c1e565b82358281111561212657600080fd5b61213288828601611c39565b82525060208301358281111561214757600080fd5b61215388828601611c39565b60208301525060408301358281111561216b57600080fd5b61217788828601611c39565b60408301525060608301358281111561218f57600080fd5b61219b88828601611c39565b6060830152506121ad60808401611b22565b608082015260a0830135828111156121c457600080fd5b6121d088828601611c39565b60a08301525060c0830135828111156121e857600080fd5b6121f488828601611b3d565b60c0830152509660209590950135955050505050565b60006020828403121561221c57600080fd5b5035919050565b60006020828403121561223557600080fd5b5051919050565b600081518084526020808501808196508360051b8101915082860160005b858110156122aa57828403895281516040815181875261227c828801826122b7565b9150508682015191508581038787015261229681836122b7565b9a87019a955050509084019060010161225a565b5091979650505050505050565b600081518084526122cf816020860160208601612cfc565b601f01601f19169290920160200192915050565b600081516122f5818560208601612cfc565b9290920192915050565b60008451612311818460208901612cfc565b80830190507f203c75736520687265663d22236261736522202f3e0a203c757365206872656681527f3d2200000000000000000000000000000000000000000000000000000000000060208201528451612372816022840160208901612cfc565b7f222066696c6c3d220000000000000000000000000000000000000000000000006022929091019182015283516123b081602a840160208801612cfc565b7f22202f3e0a000000000000000000000000000000000000000000000000000000602a9290910191820152602f0195945050505050565b600082516123f9818460208701612cfc565b7f3c2f673e0a3c2f7376673e000000000000000000000000000000000000000000920191825250600b01919050565b6000835161243a818460208801612cfc565b80830190507f203c6d61736b2069643d2261737365744d61736b223e0a20203c75736520687281527f65663d22000000000000000000000000000000000000000000000000000000006020820152835161249b816024840160208801612cfc565b7f222066696c6c3d22776869746522202f3e0a203c2f6d61736b3e0a203c757365602492909101918201527f20687265663d22236261736522206d61736b3d2275726c282361737365744d6160448201526739b5949110179f0560c11b6064820152606c01949350505050565b6000835161251a818460208801612cfc565b80830190507f203c6d61736b2069643d2261737365744d61736b2220646573633d224d61746581527f7269616c2049636f6e73202841706163686520322e30292f536f6369616c2f5060208201527f75626c6963223e0a20203c7265637420783d22302220793d223022207769647460408201527f683d223130323422206865696768743d2231303234222066696c6c3d2277686960608201527f746522202f3e0a20203c75736520687265663d22000000000000000000000000608082015283516125ed816094840160208801612cfc565b7f222066696c6c3d22626c61636b22202f3e0a203c2f6d61736b3e0a203c757365609492909101918201527f20687265663d22236261736522206d61736b3d2275726c282361737365744d6160b48201526739b5949110179f0560c11b60d482015260dc01949350505050565b6000835161266c818460208801612cfc565b835190830190612680818360208801612cfc565b7f3c2f646566733e0a3c672066696c7465723d2275726c2823663129223e0a00009101908152601e01949350505050565b7f7b226e616d65223a22000000000000000000000000000000000000000000000081526000855160206126ea8260098601838b01612cfc565b7f222c226465736372697074696f6e223a220000000000000000000000000000006009928501928301528654601a90600090600181811c908083168061273157607f831692505b86831081141561274f57634e487b7160e01b85526022600452602485fd5b8080156127635760018114612778576127a9565b60ff19851689880152838901870195506127a9565b60008e81526020902060005b8581101561279f5781548b82018a0152908401908901612784565b505086848a010195505b505050505061286b61284261283c6127ed6127e7857f222c2261747472696275746573223a5b00000000000000000000000000000000815260100190565b8c6122e3565b7f5d2c22696d616765223a22646174613a696d6167652f7376672b786d6c3b626181527f736536342c000000000000000000000000000000000000000000000000000000602082015260250190565b896122e3565b7f227d000000000000000000000000000000000000000000000000000000000000815260020190565b9a9950505050505050505050565b7f23000000000000000000000000000000000000000000000000000000000000008152600082516128b1816001850160208701612cfc565b9190910160010192915050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516128f681601d850160208701612cfc565b91909101601d0192915050565b7f7b2274726169745f74797065223a225072696d617279222c2276616c7565223a81527f2200000000000000000000000000000000000000000000000000000000000000602082015260008551612961816021850160208a01612cfc565b7f227d2c7b2274726169745f74797065223a2247726f7570222c2276616c7565226021918401918201527f3a22000000000000000000000000000000000000000000000000000000000000604182015285516129c4816043840160208a01612cfc565b7f227d2c7b2274726169745f74797065223a2243617465676f7279222c2276616c604392909101918201527f7565223a2200000000000000000000000000000000000000000000000000000060638201528451612a28816068840160208901612cfc565b7f227d2c7b2274726169745f74797065223a224d696e746572222c2276616c7565606892909101918201527f223a2200000000000000000000000000000000000000000000000000000000006088820152612a89612842608b8301866122e3565b979650505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612ac660808301846122b7565b9695505050505050565b6020815260006112cd60208301846122b7565b602081526000825160e06020840152612b006101008401826122b7565b90506020840151601f1980858403016040860152612b1e83836122b7565b92506040860151915080858403016060860152612b3b83836122b7565b92506060860151915080858403016080860152612b5883836122b7565b925060808601519150612b7660a08601836001600160a01b03169052565b60a08601519150808584030160c0860152612b9183836122b7565b925060c08601519150808584030160e086015250612baf828261223c565b95945050505050565b8281526040602082015260006116d960408301846122b7565b6040805190810167ffffffffffffffff81118282101715612bf457612bf4612da3565b60405290565b604051610120810167ffffffffffffffff81118282101715612bf457612bf4612da3565b60405160e0810167ffffffffffffffff81118282101715612bf457612bf4612da3565b604051601f8201601f1916810167ffffffffffffffff81118282101715612c6a57612c6a612da3565b604052919050565b600067ffffffffffffffff821115612c8c57612c8c612da3565b50601f01601f191660200190565b60008219821115612cad57612cad612d77565b500190565b600082612cc157612cc1612d8d565b500490565b6000816000190483118215151615612ce057612ce0612d77565b500290565b600082821015612cf757612cf7612d77565b500390565b60005b83811015612d17578181015183820152602001612cff565b83811115610c5f5750506000910152565b600181811c90821680612d3c57607f821691505b60208210811415612d5d57634e487b7160e01b600052602260045260246000fd5b50919050565b600082612d7257612d72612d8d565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146113c357600080fd5b6001600160e01b0319811681146113c357600080fdfe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c7376672076696577426f783d2230203020313032342031303234222020786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667223e0a3c646566733e0a203c66696c7465722069643d2266312220783d22302220793d2230222077696474683d223230302522206865696768743d2232303025223e0a20203c66654f666673657420726573756c743d226f66664f75742220696e3d22536f75726365416c706861222064783d223234222064793d22333222202f3e0a20203c6665476175737369616e426c757220726573756c743d22626c75724f75742220696e3d226f66664f75742220737464446576696174696f6e3d22313622202f3e0a20203c6665426c656e6420696e3d22536f75726365477261706869632220696e323d22626c75724f757422206d6f64653d226e6f726d616c22202f3e0a203c2f66696c7465723e0a3c672069643d2262617365223e0a203c7265637420783d22302220793d2230222077696474683d2235313222206865696768743d22353132222066696c6c3d222334323835463422202f3e0a203c7265637420783d22302220793d22353132222077696474683d2235313222206865696768743d22353132222066696c6c3d222333344138353322202f3e0a203c7265637420783d223531322220793d2230222077696474683d2235313222206865696768743d22353132222066696c6c3d222346424243303522202f3e0a203c7265637420783d223531322220793d22353132222077696474683d2235313222206865696768743d22353132222066696c6c3d2223454134333335222f3e0a3c2f673ea26469706673582212201477be6c8b77ff9747c3e4ff5833904c4d3d508434c53aa840376f5ecd5923b964736f6c63430008060033
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 ]
[ 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.