Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
139 0xAR
Holders
29
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 0xARLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
NFTManager
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 100 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; import "./IAlienRunesGenerator.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "erc721a/contracts/ERC721A.sol"; import "erc721a/contracts/extensions/ERC721AQueryable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; enum UriMetadataFormat { IMAGE_SVG, IMAGE_DATA_SVG, ANIMATION_URL_SVG, SVG_DATA_SVG, NO_SVG } contract NFTManager is ERC721AQueryable, ERC2981, Pausable, Ownable, ReentrancyGuard { uint256 public constant MAX_ITEMS = 10000; uint256 public constant PRICE = 0.0035 ether; uint256 public constant MAX_PER_ADDRESS = 100; uint256 public constant RESERVED_FOR_TEAM = 50; IAlienRunesGenerator generator; event ItemMinted (uint256 indexed id); string public baseCacheUri = ""; UriMetadataFormat public metadataFormat = UriMetadataFormat.IMAGE_SVG; constructor(IAlienRunesGenerator _generator) ERC721A("AlienRunes", "0xAR") { generator = _generator; _safeMint(msg.sender, RESERVED_FOR_TEAM); // reserve first few for the team _setDefaultRoyalty(msg.sender, _feeDenominator() / 10); // 10% royalty pause(); } function setBaseCacheUri(string memory newBaseCacheUri) public onlyOwner { baseCacheUri = newBaseCacheUri; } function getBaseCacheUri() public view returns (string memory) { return baseCacheUri; } function setUriMetadataFormat(UriMetadataFormat newMF) public onlyOwner { metadataFormat = newMF; } function getUriMetadataFormat() public view returns (UriMetadataFormat) { return metadataFormat; } function pause() public onlyOwner { _pause(); } function unpause() public onlyOwner { _unpause(); } modifier mintIsOpen { require(totalSupply() <= MAX_ITEMS, "Mint has ended"); if (_msgSender() != owner()) { require(!paused(), "Mint is paused"); } _; } function numberMinted(address owner) public view returns (uint256) { return _numberMinted(owner); } function mint(uint256 quantity) public payable mintIsOpen nonReentrant { uint256 total = totalSupply(); require(total + quantity <= MAX_ITEMS, "Max limit exceeded"); require(total <= MAX_ITEMS, "Mint ended"); require( numberMinted(msg.sender) + quantity <= MAX_PER_ADDRESS, "Cannot mint that many items" ); require(msg.value >= quantity * PRICE, "Insufficient funds"); _safeMint(msg.sender, quantity); } function getRuneAsSVG(uint256 tokenId) public view returns (string memory) { require(_exists(tokenId), "Nonexistent token"); return generator.renderAsSvg(tokenId); } function tokenURI_SVG(uint256 tokenId) public view returns (string memory) { require(_exists(tokenId), "URI query for nonexistent token"); return renderAsDataUriInternal(tokenId, "", UriMetadataFormat.IMAGE_SVG); } function tokenURI(uint256 tokenId) public view virtual override(IERC721A, ERC721A) returns (string memory) { require(_exists(tokenId), "URI query for nonexistent token"); return renderAsDataUriInternal(tokenId, baseCacheUri, metadataFormat); } function renderAsDataUriInternal(uint256 _tokenId, string memory _baseCacheUri, UriMetadataFormat mf) internal view returns (string memory) { string memory svg; string memory attributes; (svg, attributes) = generator.renderAsSvgAndAttributes(_tokenId); string memory image = ""; if (bytes(_baseCacheUri).length > 0) { image = string.concat('"image":"', _baseCacheUri, Strings.toString(_tokenId), '.png','"'); if (mf == UriMetadataFormat.IMAGE_SVG) { // do not allow duplicate "image" attribute by mistake mf = UriMetadataFormat.NO_SVG; } if (mf != UriMetadataFormat.NO_SVG) { image = string.concat(image, ','); } } else { // does not allow absolutely no image; If baseURL is empty, then SVG must be returned in "image" attribute if (mf == UriMetadataFormat.NO_SVG) { mf = UriMetadataFormat.IMAGE_SVG; } } if (mf == UriMetadataFormat.IMAGE_SVG) { image = string.concat(image, '"image"'); } else if (mf == UriMetadataFormat.IMAGE_DATA_SVG) { image = string.concat(image, '"image_data"'); } else if (mf == UriMetadataFormat.ANIMATION_URL_SVG) { image = string.concat(image, '"animation_url"'); } else if (mf == UriMetadataFormat.SVG_DATA_SVG) { image = string.concat(image, '"svg_data"'); } if (mf != UriMetadataFormat.NO_SVG) { image = string.concat(image, ':"data:image/svg+xml;base64,', encode(bytes(svg)),'"'); } string memory json = string.concat( '{"name":"Alien Rune #', Strings.toString(_tokenId), '","description":"Alien Runes (0xAR) - Collection of 10,000 unique NFTs, 100% on-chain, generated by Solidity code",', attributes, ',', image, '}' ); // // option #1 - as JSON // return string.concat('data:application/json;utf8,', json); // option #2 - as BASE64 encoded return string.concat( "data:application/json;base64,", encode(bytes(json)) ); } function withdraw(address payable recipient, uint256 amount) public onlyOwner { require(recipient != address(0), 'Recipient address can not be address zero'); uint balance = address(this).balance; require(balance > 0, "Nothing left to withdraw"); (bool succeed, ) = recipient.call{value: amount}(""); require(succeed, "Failed to withdraw"); } function withdrawAll() public payable onlyOwner { uint balance = address(this).balance; payable(msg.sender).transfer(balance); } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC721A, ERC721A, ERC2981) returns (bool) { return ERC721A.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); } /* Gas Efficient BASE64 encoding; Copied from https://github.com/Vectorized/solady/blob/main/src/utils/Base64.sol */ /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// See: https://datatracker.ietf.org/doc/html/rfc4648 /// @param fileSafe Whether to replace '+' with '-' and '/' with '_'. /// @param noPadding Whether to strip away the padding. function encode(bytes memory data, bool fileSafe, bool noPadding) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let dataLength := mload(data) if dataLength { // Multiply by 4/3 rounded up. // The `shl(2, ...)` is equivalent to multiplying by 4. let encodedLength := shl(2, div(add(dataLength, 2), 3)) // Set `result` to point to the start of the free memory. result := mload(0x40) // Store the table into the scratch space. // Offsetted by -1 byte so that the `mload` will load the character. // We will rewrite the free memory pointer at `0x40` later with // the allocated size. // The magic constant 0x0670 will turn "-_" into "+/". mstore(0x1f, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef") mstore(0x3f, xor("ghijklmnopqrstuvwxyz0123456789-_", mul(iszero(fileSafe), 0x0670))) // Skip the first slot, which stores the length. let ptr := add(result, 0x20) let end := add(ptr, encodedLength) // Run over the input, 3 bytes at a time. for {} 1 {} { data := add(data, 3) // Advance 3 bytes. let input := mload(data) // Write 4 bytes. Optimized for fewer stack operations. mstore8(0, mload(and(shr(18, input), 0x3F))) mstore8(1, mload(and(shr(12, input), 0x3F))) mstore8(2, mload(and(shr(6, input), 0x3F))) mstore8(3, mload(and(input, 0x3F))) mstore(ptr, mload(0x00)) ptr := add(ptr, 4) // Advance 4 bytes. if iszero(lt(ptr, end)) { break } } mstore(0x40, add(end, 0x20)) // Allocate the memory. // Equivalent to `o = [0, 2, 1][dataLength % 3]`. let o := div(2, mod(dataLength, 3)) // Offset `ptr` and pad with '='. We can simply write over the end. mstore(sub(ptr, o), shl(240, 0x3d3d)) // Set `o` to zero if there is padding. o := mul(iszero(iszero(noPadding)), o) mstore(sub(ptr, o), 0) // Zeroize the slot after the string. mstore(result, sub(encodedLength, o)) // Store the length. } } } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, false, false)`. function encode(bytes memory data) internal pure returns (string memory result) { result = encode(data, false, false); } /// @dev Encodes `data` using the base64 encoding described in RFC 4648. /// Equivalent to `encode(data, fileSafe, false)`. function encode(bytes memory data, bool fileSafe) internal pure returns (string memory result) { result = encode(data, fileSafe, false); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.21; interface IAlienRunesGenerator { function renderAsSvg(uint256 _tokenId) external view returns (string memory result); function renderAsSvgAndAttributes(uint256 _tokenId) external view returns (string memory svg, string memory attributes); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // 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 `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID 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 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @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 virtual 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 virtual 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 virtual 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 virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual 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 virtual { 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; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ 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: [ERC165](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. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ 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 ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * 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 initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev 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); } /** * @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 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)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @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) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @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) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @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. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(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 `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @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 memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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 Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns 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)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @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 virtual { uint256 startTokenId = _currentIndex; 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 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _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 virtual { 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 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 virtual { _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 Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @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) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(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++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { 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 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 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; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @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 virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AQueryable.sol'; import '../ERC721A.sol'; /** * @title ERC721AQueryable. * * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable { /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) { return ownership; } ownership = _ownershipAt(tokenId); if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] calldata tokenIds) external view virtual override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view virtual override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _nextTokenId(); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, stopLimit)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// 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 // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * 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(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores 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 via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @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() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 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`, * 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, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` 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 payable; /** * @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 payable; /** * @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](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import '../IERC721A.sol'; /** * @dev Interface of ERC721AQueryable. */ interface IERC721AQueryable is IERC721A { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// 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); }
{ "remappings": [ "@openzeppelin/=node_modules/@openzeppelin/", "erc721a/=node_modules/erc721a/", "forge-std/=lib/forge-std/src/", "ds-test/=lib/forge-std/lib/ds-test/src/" ], "optimizer": { "enabled": true, "runs": 100, "details": { "peephole": true, "inliner": true, "deduplicate": true, "cse": true, "yul": true, "yulDetails": { "stackAllocation": true, "optimizerSteps": "[fv][edjr]T[secxL]d[fv][edjr]T[secxL]d" } } }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IAlienRunesGenerator","name":"_generator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","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":"uint256","name":"id","type":"uint256"}],"name":"ItemMinted","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_ITEMS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PER_ADDRESS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESERVED_FOR_TEAM","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseCacheUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBaseCacheUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRuneAsSVG","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUriMetadataFormat","outputs":[{"internalType":"enum UriMetadataFormat","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataFormat","outputs":[{"internalType":"enum UriMetadataFormat","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"numberMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"safeTransferFrom","outputs":[],"stateMutability":"payable","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":"payable","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":"newBaseCacheUri","type":"string"}],"name":"setBaseCacheUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum UriMetadataFormat","name":"newMF","type":"uint8"}],"name":"setUriMetadataFormat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI_SVG","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
60806040908152346200002e57620000206200001a620000c1565b620002cf565b51612f25908162000bb28239f35b600080fd5b634e487b7160e01b60009081526041600452602490fd5b601f909101601f19168101906001600160401b038211908210176200006e57604052565b62000033565b906200008460405192836200004a565b565b6001600160a01b038116036200002e57565b90505190620000848262000086565b906020828203126200002e57620000be9162000098565b90565b620000be62003ad780380380620000d88162000074565b928339810190620000a7565b6001600160401b0381116200006e57601f1990601f011660200190565b90620001176200011183620000e4565b62000074565b918252565b62000128600a62000101565b69416c69656e52756e657360b01b602082015290565b6200014a600462000101565b63183c20a960e11b602082015290565b634e487b7160e01b60009081526022600452602490fd5b90600182811c9216801562000193575b60208310146200018d57565b6200015a565b91607f169162000181565b9055565b818110620001ae575050565b60008155600101620001a2565b9190601f90818111620001cf575b50505050565b620001e4620002089460009081526020902090565b916020918185019280600594851c8601961062000212575b5001901c0190620001a2565b38808080620001c9565b94508394620001fc565b6200023560006200022e835462000171565b83620001bb565b60009055565b62000084906200021c565b634e487b7160e01b60009081526021600452602490fd5b600511156200026857565b62000246565b9062000084826200025d565b906200028a6200019e916200026e565b825460ff191660ff919091161790565b634e487b7160e01b60009081526012600452602490fd5b6001600160601b0391821691168115620002c9570490565b6200029a565b620002ee620002dd6200011c565b620002e76200013e565b9062000356565b620002fa600d6200023b565b620003086000600e6200027a565b600c80546001600160a01b0319166001600160a01b038316179055506200034c336200033660328262000834565b62000345600a612710620002b1565b90620007b6565b62000084620004e0565b90620003629162000371565b60016200036e81600b55565b50565b906200037d9162000388565b62000084336200056b565b906200039491620003a0565b600a805460ff19169055565b6200008491829182918291829182918291906200049e565b815190916001600160401b0382116200006e57620003e382620003dc855462000171565b85620001bb565b602090601f8084116001146200042457506200019e92916000918362000418575b50506000198260031b1c19169060011b1790565b01519050388062000404565b600085815260208120939192908590601f198216905b8181106200047657501062000458575b50505050600190811b019055565b0151600019600385901b60f8161c191690915550388080806200044a565b838501518755600190960195602094850194889350016200043a565b906200008491620003b8565b620004ac6002918262000492565b50620004bb6003918262000492565b5060006200036e81600055565b620004d262000540565b620000846200008462000611565b62000084620004c8565b15620004f257565b60405162461bcd60e51b8152806200053c600482016020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b0390fd5b620000846200055a600a5460081c6001600160a01b031690565b6001600160a01b03163314620004ea565b600a8054610100600160a81b03198116600884811b610100600160a81b0316919091179092556001600160a01b0392831692911c167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b620005d162000673565b600a805460ff1916600117905560405133815262000084907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602090a1565b62000084620005c7565b601081526020016f14185d5cd8589b194e881c185d5cd95960821b81525b60200190565b6020808252620000be91016200061b565b156200065857565b60405162461bcd60e51b8152806200053c600482016200063f565b6200008462000684600a5460ff1690565b1562000650565b156200069357565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b601981526020017f455243323938313a20696e76616c696420726563656976657200000000000000815262000639565b6020808252620000be9101620006eb565b156200073457565b60405162461bcd60e51b8152806200053c600482016200071b565b815181546001600160a01b0319166001600160a01b0390911617815562000084916200078590602001516001600160601b031690565b90805490916001600160a01b0390911660a09190911b6001600160a01b031916179055565b9062000084916200074f565b906200081a90620007d56127106001600160601b03831611156200068b565b620007eb6001600160a01b03841615156200072c565b6200080a620007fb604062000074565b6001600160a01b039094168452565b6001600160601b03166020830152565b6200036e60089182620007aa565b620000be600062000101565b62000084916200084362000828565b9062000850818462000a85565b600092803b620008605750505050565b83549182039160015b156200089a575b84620008838585600101958589620009ad565b62000869576040516368d2bf6b60e11b8152600490fd5b808310620008705792505050815403620008b757808080620001c9565b80fd5b6001600160e01b03198116036200002e57565b905051906200008482620008ba565b906020828203126200002e57620000be91620008cd565b91909160005b8281106200090a5750506000910152565b8082015181850152602001620008f9565b80518083529091620009379082906020018094602001620008f3565b601f01601f19160190565b62000981620000be959392946200097a6080946200096a858781019960018060a01b03169052565b6001600160a01b03166020850152565b6040830152565b606001526200091b565b3d15620009a8576200099d3d62000101565b903d6000602084013e565b606090565b600094936001600160a01b0390921691903393620009e76040938451918291630a85bd0160e11b9485845260209660049a8b860162000942565b039483826000978189855af186928162000a4f575b5062000a3b57505050600162000a125750505050565b62000a1c6200098b565b8051918262000a3857505090516368d2bf6b60e11b8152915050fd5b01fd5b506001600160e01b03191614955050505050565b62000a75919350853d871162000a7d575b62000a6c81836200004a565b810190620008dc565b9138620009fc565b503d62000a60565b9190600092835490821562000b92576001600160a01b03811660009081526005602052604090819020805468010000000000000001860201905594600162000aee81861460e11b62000ad984868162000ba4565b4260a01b9117176001600160a01b0385161790565b9660049762000b0f8162000b0c888c60009182526020526040902090565b55565b50848601916001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef878387838180a48188015b85810362000b82575050501562000b7457506200008495965062000b6d818355565b5050505050565b51622e076360e81b81528790fd5b8290808589858180a40162000b4b565b60405163b562e8dd60e01b8152600490fd5b5060009150620000be905056fe6080604052600436106102a15760003560e01c806301ffc9a71461029c57806306de6c841461029757806306fdde0314610292578063081812fc1461028d578063095ea7b3146102885780630aaef2851461028357806318160ddd1461027e57806323b872dd146102795780632a55205a14610274578063304aed001461026f5780633f4ba83a1461026a57806342842e0e1461026557806357d4c4ee146102605780635bbb21771461025b5780635c975abb146102565780636352211e1461025157806370a082311461024c578063715018a6146102475780637f7046571461024257806382db5f891461023d5780638456cb59146102385780638462151c14610233578063853828b61461022e5780638d859f3e146102295780638da5cb5b1461022457806391e2300f1461021f57806395d89b411461021a57806399a2557a14610215578063a0712d6814610210578063a22cb4651461020b578063a463a67a14610206578063b88d4fde14610201578063c23dc68f146101fc578063c87b56dd146101f7578063c8a55ccf146101f2578063cb53a4e1146101ed578063dc33e681146101e8578063e985e9c5146101e3578063f2fde38b146101de578063f3fef3a3146101d95763f9344d00036102a157610d53565b610d0f565b610cf7565b610cdb565b610c9d565b610c7e565b610b4c565b610b31565b610b0a565b610ae3565b610a75565b610a0f565b6109c2565b6109a6565b610967565b61094c565b610924565b610902565b6108ef565b6108c8565b61085a565b610842565b610742565b61072a565b61070f565b6106e0565b6106c1565b610699565b61058a565b610576565b61055e565b610543565b61051a565b6104d2565b610476565b61045a565b610441565b6103ca565b6103af565b61037d565b6102de565b600080fd5b6001600160e01b03198116036102a157565b905035906102c5826102a6565b565b906020828203126102a1576102db916102b8565b90565b346102a15761030b6102f96102f43660046102c7565b611bd0565b60405191829182901515815260200190565b0390f35b80fd5b906020828203126102a157503590565b91909160005b8281106103385750506000910152565b8082015181850152602001610328565b805180835290916103629082906020018094602001610322565b601f01601f19160190565b6102db9160208083019252610348565b346102a15761030b610398610393366004610312565b611345565b6040519182918261036d565b60009103126102a157565b346102a1576103bf3660046103a4565b61030b61039861242a565b346102a15761030b6103e56103e0366004610312565b61256b565b604051918291826001600160a01b03909116815260200190565b6001600160a01b038116036102a157565b905035906102c5826103ff565b91906040838203126102a157806104376102db9285610410565b9360200190503590565b61045561044f36600461041d565b906124be565b604051005b346102a15761046a3660046103a4565b60405160648152602090f35b346102a1576104863660046103a4565b61030b610491612347565b6040519182918290815260200190565b90916060828403126102a1576102db6104ba8484610410565b936104c88160208601610410565b9360400190503590565b6104556104e03660046104a1565b91612654565b91906040838203126102a1576102db908335610437565b6001600160a01b0390911681526040810192916102c59160200152565b346102a15761053361052d3660046104e6565b90612123565b9061030b604051928392836104fd565b346102a15761030b610398610559366004610312565b61143e565b346102a15761056e3660046103a4565b610455610f59565b6104556105843660046104a1565b9161280a565b346102a15761059a3660046103a4565b6040516127108152602090f35b9181601f840112156102a1578235916001600160401b0383116102a1576020808501948460051b0101116102a157565b906020828203126102a15781356001600160401b0381116102a1576105fc92016105a7565b9091565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b8161064691610600565b60800190565b8051808352916020019160208092019160005b82811061066d575050505090565b9061067c84958294955161063c565b940192919060010161065f565b6102db916020808301925261064c565b346102a15761030b6106b56106af3660046105d7565b90612cbd565b60405191829182610689565b346102a1576106d13660046103a4565b61030b6102f9600a5460ff1690565b346102a15761030b6103e56106f6366004610312565b61243e565b906020828203126102a1576102db91610410565b346102a15761030b6104916107253660046106fb565b612379565b346102a15761073a3660046103a4565b610455611d79565b346102a1576107523660046103a4565b60405160328152602090f35b634e487b7160e01b60009081526041600452602490fd5b90601f1990601f011681019081106001600160401b0382111761079757604052565b61075e565b906102c56040519283610775565b6001600160401b03811161079757601f1990601f011660200190565b9180919283376000910152565b909291926107e86107e3826107aa565b61079c565b938185526020850190828401116102a1576102c5926107c6565b9080601f830112156102a157816102db9235906020016107d3565b906020828203126102a15781356001600160401b0381116102a1576102db9201610802565b346102a15761045561085536600461081d565b610ed6565b346102a15761086a3660046103a4565b610455610f3e565b81525b60200190565b8051808352916020019160208092019160005b82811061089c575050505090565b906108ab849582949551610872565b940192919060010161088e565b6102db916020808301925261087b565b346102a15761030b6108e36108de3660046106fb565b612e56565b604051918291826108b8565b6108fa3660046103a4565b610455611bc8565b346102a1576109123660046103a4565b604051660c6f3b40b6c0008152602090f35b346102a1576109343660046103a4565b61030b6103e5600a5460081c6001600160a01b031690565b346102a15761095c3660046103a4565b61030b610398610edf565b346102a1576109773660046103a4565b61030b610398612434565b90916060828403126102a1576102db61099b8484610410565b9360208401356104c8565b346102a15761030b6108e36109bc366004610982565b91612d15565b6104556109d0366004610312565b611275565b801515036102a157565b905035906102c5826109d5565b91906040838203126102a15780610a066102db9285610410565b936020016109df565b346102a157610455610a223660046109ec565b906125a6565b634e487b7160e01b60009081526021600452602490fd5b60051115610a4957565b610a28565b906102c582610a3f565b610a6190610a4e565b9052565b6020810192916102c59190610a58565b346102a157610a853660046103a4565b600e5461030b9060ff165b60405191829182610a65565b906080828203126102a157610ab18183610410565b92610abf8260208501610410565b9260408101359260608201356001600160401b0381116102a1576102db9201610802565b610455610af1366004610a9c565b9291909161281a565b6080810192916102c59190610600565b346102a15761030b610b25610b20366004610312565b612b3c565b60405191829182610afa565b346102a15761030b610398610b47366004610312565b611464565b346102a157610b5c3660046103a4565b61030b610a90600e5460ff1690565b634e487b7160e01b60009081526004819052602490fd5b634e487b7160e01b60009081526022600452602490fd5b90600182811c92168015610bb8575b6020831014610bb357565b610b82565b91607f1691610ba8565b90600092918054610bdf610bd582610b99565b8085529360200190565b91600191808316908115610c355750600114610bfc575b50505050565b600090815260208120949550939192915b828510610c2257505050019038808080610bf6565b8054848601526020909401938101610c0d565b60ff1916845250505090151560051b01915038808080610bf6565b906102c5610c649260405193848092610bc2565b0383610775565b90610c79576102db90610c50565b610b6b565b346102a157610c8e3660046103a4565b61030b6103986000600d610c6b565b346102a15761030b610491610cb33660046106fb565b610f61565b91906040838203126102a15780610cd26102db9285610410565b93602001610410565b346102a15761030b6102f9610cf1366004610cb8565b90612603565b346102a157610455610d0a3660046106fb565b611e1c565b346102a157610455610d2236600461041d565b90611b8f565b600511156102a157565b905035906102c582610d28565b906020828203126102a1576102db91610d32565b346102a157610455610d66366004610d3f565b610f22565b6102c590610d77611d3c565b610ec7565b9055565b818110610d8b575050565b60008155600101610d80565b9190601f90818111610da95750505050565b610dbc610dde9460009081526020902090565b916020918185019280600594851c86019610610de7575b5001901c0190610d80565b38808080610bf6565b94508394610dd3565b908051906001600160401b03821161079757610e1682610e108554610b99565b85610d97565b602090601f808411600114610e535750610d7c929160009183610e48575b50506000198260031b1c19169060011b1790565b015190503880610e34565b600085815260208120939192908590601f198216905b818110610ea2575010610e85575b50505050600190811b019055565b0151600019600385901b60f8161c19169091555038808080610e77565b83850151875560019096019560209485019488935001610e69565b906102c591610df0565b610ed3600d9182610ebd565b50565b6102c590610d6b565b6102db600d610c50565b6102c590610ef5611d3c565b610f17565b90610f07610d7c91610a4e565b825460ff191660ff919091161790565b610ed381600e610efa565b6102c590610ee9565b610f33611d3c565b6102c56102c5611ee6565b6102c5610f2b565b610f4e611d3c565b6102c56102c5611f9f565b6102c5610f46565b6102db906123b6565b600e81526020016d135a5b9d081a185cc8195b99195960921b8152610875565b60208082526102db9101610f6a565b15610fa057565b60405162461bcd60e51b815280610fb960048201610f8a565b0390fd5b600e81526020016d135a5b9d081a5cc81c185d5cd95960921b8152610875565b60208082526102db9101610fbd565b15610ff357565b60405162461bcd60e51b815280610fb960048201610fdd565b6102c59061102561271061101e612347565b1115610f99565b336001600160a01b0380611044600a5460081c6001600160a01b031690565b16911603156110625761106261105c600a5460ff1690565b15610fec565b6110739061106e61206e565b611206565b6102c5612086565b634e487b7160e01b60009081526011600452602490fd5b9190820180921161109f57565b61107b565b601281526020017113585e081b1a5b5a5d08195e18d95959195960721b8152610875565b60208082526102db91016110a4565b156110de57565b60405162461bcd60e51b815280610fb9600482016110c8565b600a815260200169135a5b9d08195b99195960b21b8152610875565b60208082526102db91016110f7565b1561112957565b60405162461bcd60e51b815280610fb960048201611113565b601b81526020017f43616e6e6f74206d696e742074686174206d616e79206974656d7300000000008152610875565b60208082526102db9101611142565b1561118757565b60405162461bcd60e51b815280610fb960048201611171565b8181029291811591840414171561109f57565b6012815260200171496e73756666696369656e742066756e647360701b8152610875565b60208082526102db91016111b3565b156111ed57565b60405162461bcd60e51b815280610fb9600482016111d7565b6102c590611235611215612347565b6127109061122e826112278684611092565b11156110d7565b1115611122565b33611254606461124d8461124885610f61565b611092565b1115611180565b61127034611269660c6f3b40b6c000856111a0565b11156111e6565b612992565b6102c59061100c565b60118152602001702737b732bc34b9ba32b73a103a37b5b2b760791b8152610875565b60208082526102db910161127e565b156112b757565b60405162461bcd60e51b815280610fb9600482016112a1565b909291926112e06107e3826107aa565b938185526020850190828401116102a1576102c592610322565b9080601f830112156102a15781516102db926020016112d0565b906020828203126102a15781516001600160401b0381116102a1576102db92016112fa565b6040513d6000823e3d90fd5b61138d9061135a6113558261261c565b6112b0565b600c546001600160a01b03908116169060405180926384ab67b560e01b8252818060009687956004830190815260200190565b03915afa9182156113bf5780926113a357505090565b6102db92503d8091833e6113b78183610775565b810190611314565b611339565b601f81526020017f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e008152610875565b60208082526102db91016113c4565b1561140957565b60405162461bcd60e51b815280610fb9600482016113f3565b9061142f6107e3836107aa565b918252565b6102db6000611422565b6102db9061145361144e8261261c565b611402565b60009061145e611434565b906117e9565b6102db9061147461144e8261261c565b600d9061145e611486600e5460ff1690565b92610c50565b9190916040818403126102a1578051926001600160401b03938481116102a157816114b89184016112fa565b9360208301519081116102a1576102db92016112fa565b6114e0815180938093602001610322565b0190565b681134b6b0b3b2911d1160b91b815261150b929161150591600901906114cf565b906114cf565b632e706e6760e01b815260040161152581601160f91b9052565b60010190565b91906115416102c59160405194602086016114e4565b839003601f198101845283610775565b61155a916114cf565b600b60fa1b8152611525565b906102c56115416040519360208501611551565b611583916114cf565b691139bb33afb230ba309160b11b8152600a0190565b906102c5611541604051936020850161157a565b6115b6916114cf565b6e1130b734b6b0ba34b7b72fbab9361160891b8152600f0190565b906102c561154160405193602085016115ad565b6115ee916114cf565b6b1134b6b0b3b2afb230ba309160a11b8152600c0190565b906102c561154160405193602085016115e5565b611623916114cf565b661134b6b0b3b29160c91b815260070190565b906102c5611541604051936020850161161a565b6116589061168493926114cf565b7f3a22646174613a696d6167652f7376672b786d6c3b6261736536342c000000008152601c01906114cf565b601160f91b8152611525565b91906115416102c591604051946020860161164a565b916115056116df61177093611783956116d681747b226e616d65223a22416c69656e2052756e65202360581b9052565b601501906114cf565b7f222c226465736372697074696f6e223a22416c69656e2052756e65732028307881527f415229202d20436f6c6c656374696f6e206f662031302c30303020756e69717560208201527f65204e4654732c2031303025206f6e2d636861696e2c2067656e65726174656460408201527208189e4814dbdb1a591a5d1e4818dbd919488b606a1b606082015260730190565b600b60fa1b8152916001809301906114cf565b607d60f81b81520190565b60405193926102c59261154192602087016116a6565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526102db9190601d01906114cf565b906102c561154160405193602085016117a4565b600c546040516322dac39360e01b8152600480820184905260009390928490839060249082906001600160a01b03165afa9182156113bf576102db966118db96866118d6979381966119d3575b5061183f611434565b8251909290156119aa5761185e919250611858866121e2565b9061152b565b9061186881610a4e565b61187184610a4e565b146119a2575b61188087610a4e565b61188984610a4e565b0361198d575b61189890610a4e565b6118a183610a4e565b03611900576118bb6118b56118c192611636565b96610a4e565b91610a4e565b036118e0575b506118d1906121e2565b61178e565b611bee565b6117d5565b836118f36118f9926118d1949650611bee565b90611690565b92906118c7565b61190a6001610a4e565b61191383610a4e565b03611927576118bb6118b56118c192611606565b6119316002610a4e565b61193a83610a4e565b0361194e576118bb6118b56118c1926115d1565b946119596003610a4e565b61196283610a4e565b14611974575b6118bb6118c191610a4e565b946118bb6119846118c192611599565b96915050611968565b9061199a61189891611566565b91905061188f565b869250611877565b506119b487610a4e565b6119bd84610a4e565b146119cb5761189890610a4e565b91508161188f565b9093506119f39195503d8085833e6119eb8183610775565b81019061148c565b94909238611836565b906102c591611a09611d3c565b611b4b565b602981526020017f526563697069656e7420616464726573732063616e206e6f742062652061646481526872657373207a65726f60b81b60208201525b60400190565b60208082526102db9101611a0e565b15611a6757565b60405162461bcd60e51b815280610fb960048201611a51565b60188152602001774e6f7468696e67206c65667420746f20776974686472617760401b8152610875565b60208082526102db9101611a80565b15611ac057565b60405162461bcd60e51b815280610fb960048201611aaa565b3d15611af357611ae83d611422565b903d6000602084013e565b606090565b60128152602001714661696c656420746f20776974686472617760701b8152610875565b60208082526102db9101611af8565b15611b3257565b60405162461bcd60e51b815280610fb960048201611b1c565b6102c59160009182916001600160a01b0391821691611b6b831515611a60565b611b76471515611ab9565b5060405190818003925af1611b89611ad9565b50611b2b565b906102c5916119fc565b611ba1611d3c565b6102c5473360008215611bbf575b6000809381938293f1156113bf57565b506108fc611baf565b6102c5611b99565b611bd9816123d9565b908115611be4575090565b6102db9150612091565b6102db906000809180516060949381611c075750505050565b909192945060036002908082850104821b9360408051987f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526106709015027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f18603f908152602090818b01888c0191868484019b5b0191825182808260121c16519160009283538181600c1c1651600153818160061c16518c5316518953518152600401918b831015611cbe578790611c7f565b5050985082915001905206900490613d3d60f01b828503521515029182600091035203825238808080610bf6565b15611cf357565b60405162461bcd60e51b815280610fb9600482016020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6102c5611d54600a5460081c6001600160a01b031690565b6001600160a01b03163314611cec565b611d6c611d3c565b6102c56102c56000611e25565b6102c5611d64565b6102c590611d8d611d3c565b611dff565b602681526020017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b6020820152611a4b565b60208082526102db9101611d92565b15611de657565b60405162461bcd60e51b815280610fb960048201611dd0565b6102c590611e176001600160a01b0382161515611ddf565b611e25565b6102c590611d81565b600a8054610100600160a81b03198116600884811b610100600160a81b0316919091179092556001600160a01b0392831692911c167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b611e89611f3f565b6102c5611ea5565b805460ff191691151560ff16919091179055565b6001611eb281600a611e91565b506040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589080602081015b0390a1565b6102c5611e81565b601081526020016f14185d5cd8589b194e881c185d5cd95960821b8152610875565b60208082526102db9101611eee565b15611f2657565b60405162461bcd60e51b815280610fb960048201611f10565b6102c5611f4e600a5460ff1690565b15611f1f565b611f5c611ffc565b6102c56000611f6c81600a611e91565b506040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa908060208101611ee1565b6102c5611f54565b601481526020017314185d5cd8589b194e881b9bdd081c185d5cd95960621b8152610875565b60208082526102db9101611fa7565b15611fe357565b60405162461bcd60e51b815280610fb960048201611fcd565b6102c561200b600a5460ff1690565b611fdc565b601f81526020017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c008152610875565b60208082526102db9101612010565b1561205557565b60405162461bcd60e51b815280610fb96004820161203f565b6002610ed381600b612083828254141561204e565b55565b6001610ed381600b55565b6001600160e01b0319811663152a902d60e11b149081156120b0575090565b6001600160e01b0319166301ffc9a760e01b14905090565b906102c56120ed6120d9604061079c565b93546001600160a01b038116855260a01c90565b6001600160601b03166020840152565b634e487b7160e01b60009081526012600452602490fd5b811561211e570490565b6120fd565b600090815260096020526040902090919061213d906120c8565b80519092906001600160a01b03161561219f575b61218d8161219b92506121826001600160601b03918261217b60208901516001600160601b031690565b16906111a0565b906127101690612114565b92516001600160a01b031690565b9190565b915061219b61218d6121b160086120c8565b93915050612151565b369037565b906102c56121d56121cf84611422565b936107aa565b601f1901602084016121ba565b6001806121ee8361224d565b926121fa8285016121bf565b938401602101915b61220d575b50505090565b6000199091019061223a90600a906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a8453612114565b918215612248579182612202565b612207565b60009072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b80821015612333575b506d04ee2d6d415b85acef81000000008082101561231f575b50662386f26fc100008082101561230b575b506305f5e100808210156122f7575b50612710808210156122e3575b506064808210156122cf575b50600a11156115255790565b6122d891612114565b9060020190386122c3565b6122ec91612114565b9060040190386122b7565b61230091612114565b9060080190386122aa565b61231491612114565b90601001903861229b565b61232891612114565b906020019038612289565b9061233e9250612114565b60409038612270565b6000546001549003612357600090565b900390565b6001600160a01b0390911660009081526020919091526040902090565b60006001600160a01b038216156123a3575061239e6001600160401b0391600561235c565b541690565b506040516323d3ad8160e21b8152600490fd5b6123d56001600160401b03916123cf604091600561235c565b54901c90565b1690565b6001600160e01b03198181166301ffc9a760e01b8114928315612419575b83156124035750505090565b50635b5e139f60e01b1491503890508080612207565b6380ac58cd60e01b821493506123f7565b6102db6002610c50565b6102db6003610c50565b6001600160a01b03906123d5905b80612464565b604051636f96cda160e11b8152600490fd5b600080548310612475575b50612452565b61248b6004938460009182526020526040902090565b549050600160e01b811661246f575b806124b857506000190160008181526020839052604090205461249a565b91505090565b6124c78261243e565b906001600160a01b03808316919033838103612544575b5060009361251b836124fb88600660009182526020526040902090565b805490916001600160a01b03199091166001600160a01b03909116179055565b5016917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259080a4565b61254e9085612603565b1561255957386124de565b6040516367d9dca160e11b8152600490fd5b6125748161261c565b15612594576000908152600660205260409020546001600160a01b031690565b6040516333d1c03960e21b8152600490fd5b336125c4836125bf846125ba85600761235c565b61235c565b611e91565b60405192151583526001600160a01b03918216929116907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190602090a3565b6102db916125ba61261592600761235c565b5460ff1690565b600190612648565b8161262d575090565b6000908152600460205260409020600160e01b915054161590565b60005481109150612624565b9092916126608161244c565b936001600160a01b0383811693908087168590036127f95760008481526006602052604090208054959091336001600160a01b038516811481891417156127d2575b506000988186169384156127c057998794939291816102c59b9c60019b6127b8575b50506126ea8860056126d68a8261235c565b6126e4815460001901809255565b5061235c565b6126f68b825401809255565b50600160e11b61272061270a838b8b612b0b565b4260a01b908317176001600160a01b038b161790565b9060049161273c816120838b8660009182526020526040902090565b50821615612773575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9250819050a450505050565b868b0160008181526020839052604090205415612791575b50612745565b8354811461278b5761208383916127b19360009182526020526040902090565b388061278b565b5581386126c4565b604051633a954ecd60e21b8152600490fd5b6127dc9085612603565b156127e757386126a2565b604051632ce44b5f60e11b8152600490fd5b60405162a1148160e81b8152600490fd5b90916102c592612818611434565b925b91929092612829818585612654565b600093803b61283a575b5050505050565b612843936128c9565b156128515780808080612833565b506040516368d2bf6b60e11b8152600490fd5b905051906102c5826102a6565b906020828203126102a1576102db91612864565b6128c06102db959392946128b96080946128a9858781019960018060a01b03169052565b6001600160a01b03166020850152565b6040830152565b60600152610348565b600094936001600160a01b03909216919033936129016040938451918291630a85bd0160e11b9485845260209660049a8b8601612885565b039483826000978189855af1869281612963575b5061294f5750505060016129295750505050565b612931611ad9565b8051918261294c57505090516368d2bf6b60e11b8152915050fd5b01fd5b506001600160e01b03191614955050505050565b612984919350853d871161298b575b61297c8183610775565b810190612871565b9138612915565b503d612972565b6102c59161299e611434565b906129a98184612a08565b600092803b6129b85750505050565b83549182039160015b156129ee575b846129d885856001019585896128c9565b6129c1576040516368d2bf6b60e11b8152600490fd5b8083106129c7579250505081540361030f57808080610bf6565b91906000928354908215612af9576040946001612a3d680100000000000000018602612a3585600561235c565b908154019055565b612a6681861460e11b612a51848681612b0b565b4260a01b9117176001600160a01b0385161790565b96600497612a8281612083888c60009182526020526040902090565b50848601916001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef878387838180a48188015b858103612aea5750505015612adc57506102c5959650612833818355565b51622e076360e81b81528790fd5b8290808589858180a401612abe565b60405163b562e8dd60e01b8152600490fd5b50600091506102db9050565b612b21608061079c565b90600080835260208181850152816040850152506060830152565b612b44612b17565b50612b4d612b17565b6000612b87565b612b825750612b6281612bad565b90612b706040830151151590565b612b7e576102db9150612b93565b5090565b905090565b50600054821015612b54565b612ba86102db91612ba2612b17565b5061244c565b612bd0565b612bce6102db91612bbc612b17565b50600460009182526020526040902090565b545b90612bd9612b17565b6001600160a01b03831681526001600160401b0360a084901c166020820152600160e01b83161515604082015260e89290921c6060830152565b6001600160401b0381116107975760051b60200190565b9061142f6107e383612c13565b60005b828110612c4657505050565b612c4e612b17565b81830152602001612c3a565b906102c5612c70612c6a84612c2a565b93612c13565b601f190160208401612c37565b634e487b7160e01b60009081526032600452602490fd5b9190811015612ca45760051b0190565b612c7d565b908151811015612ca45760051b6020010190565b90612cc781612c5a565b9160005b82811461220757612ce7610b20612ce3838686612c94565b3590565b612cf18286612ca9565b52612cfc8185612ca9565b50600101612ccb565b906102c56121d5612c6a84612c2a565b9082811015612e4457600091612d2a60005490565b808511612e3c575b50612d3c81612379565b9184811015612e3357808503838110612e2b575b505b612d5b83612d05565b928015612e2257612d6b82612b3c565b90600092604092612d7e84820151151590565b15612e10575b505b8781141580612e06575b15612dfa57612d9e81612bad565b80840151612df457516001600160a01b03908181169081612dea575b505080861690851614612dd0575b600101612d86565b612de581612de2896001019989612ca9565b52565b612dc8565b5094508438612dba565b50612dc8565b50505050509150815290565b5081871415612d90565b516001600160a01b0316935083612d84565b50505091505090565b925082612d50565b60009250612d52565b935083612d32565b604051631960ccad60e11b8152600490fd5b6000918291612e6481612379565b93612e6e85612d05565b92612e77612b17565b5060005b868614612ee557612e8b81612bad565b6040810151612edf57516001600160a01b03908181169081612ed5575b505080851690841614612ebe575b600101612e7b565b612ed081612de2886001019888612ca9565b612eb6565b5093508338612ea8565b50612eb6565b509450505090509056fea264697066735822122040d34c8094676fca6d4a36306837378258bca673c8341074510583e939e1591d64736f6c634300081500330000000000000000000000002d902bb467f6990373e5487972f9ef89a12f9f87
Deployed Bytecode
0x6080604052600436106102a15760003560e01c806301ffc9a71461029c57806306de6c841461029757806306fdde0314610292578063081812fc1461028d578063095ea7b3146102885780630aaef2851461028357806318160ddd1461027e57806323b872dd146102795780632a55205a14610274578063304aed001461026f5780633f4ba83a1461026a57806342842e0e1461026557806357d4c4ee146102605780635bbb21771461025b5780635c975abb146102565780636352211e1461025157806370a082311461024c578063715018a6146102475780637f7046571461024257806382db5f891461023d5780638456cb59146102385780638462151c14610233578063853828b61461022e5780638d859f3e146102295780638da5cb5b1461022457806391e2300f1461021f57806395d89b411461021a57806399a2557a14610215578063a0712d6814610210578063a22cb4651461020b578063a463a67a14610206578063b88d4fde14610201578063c23dc68f146101fc578063c87b56dd146101f7578063c8a55ccf146101f2578063cb53a4e1146101ed578063dc33e681146101e8578063e985e9c5146101e3578063f2fde38b146101de578063f3fef3a3146101d95763f9344d00036102a157610d53565b610d0f565b610cf7565b610cdb565b610c9d565b610c7e565b610b4c565b610b31565b610b0a565b610ae3565b610a75565b610a0f565b6109c2565b6109a6565b610967565b61094c565b610924565b610902565b6108ef565b6108c8565b61085a565b610842565b610742565b61072a565b61070f565b6106e0565b6106c1565b610699565b61058a565b610576565b61055e565b610543565b61051a565b6104d2565b610476565b61045a565b610441565b6103ca565b6103af565b61037d565b6102de565b600080fd5b6001600160e01b03198116036102a157565b905035906102c5826102a6565b565b906020828203126102a1576102db916102b8565b90565b346102a15761030b6102f96102f43660046102c7565b611bd0565b60405191829182901515815260200190565b0390f35b80fd5b906020828203126102a157503590565b91909160005b8281106103385750506000910152565b8082015181850152602001610328565b805180835290916103629082906020018094602001610322565b601f01601f19160190565b6102db9160208083019252610348565b346102a15761030b610398610393366004610312565b611345565b6040519182918261036d565b60009103126102a157565b346102a1576103bf3660046103a4565b61030b61039861242a565b346102a15761030b6103e56103e0366004610312565b61256b565b604051918291826001600160a01b03909116815260200190565b6001600160a01b038116036102a157565b905035906102c5826103ff565b91906040838203126102a157806104376102db9285610410565b9360200190503590565b61045561044f36600461041d565b906124be565b604051005b346102a15761046a3660046103a4565b60405160648152602090f35b346102a1576104863660046103a4565b61030b610491612347565b6040519182918290815260200190565b90916060828403126102a1576102db6104ba8484610410565b936104c88160208601610410565b9360400190503590565b6104556104e03660046104a1565b91612654565b91906040838203126102a1576102db908335610437565b6001600160a01b0390911681526040810192916102c59160200152565b346102a15761053361052d3660046104e6565b90612123565b9061030b604051928392836104fd565b346102a15761030b610398610559366004610312565b61143e565b346102a15761056e3660046103a4565b610455610f59565b6104556105843660046104a1565b9161280a565b346102a15761059a3660046103a4565b6040516127108152602090f35b9181601f840112156102a1578235916001600160401b0383116102a1576020808501948460051b0101116102a157565b906020828203126102a15781356001600160401b0381116102a1576105fc92016105a7565b9091565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b8161064691610600565b60800190565b8051808352916020019160208092019160005b82811061066d575050505090565b9061067c84958294955161063c565b940192919060010161065f565b6102db916020808301925261064c565b346102a15761030b6106b56106af3660046105d7565b90612cbd565b60405191829182610689565b346102a1576106d13660046103a4565b61030b6102f9600a5460ff1690565b346102a15761030b6103e56106f6366004610312565b61243e565b906020828203126102a1576102db91610410565b346102a15761030b6104916107253660046106fb565b612379565b346102a15761073a3660046103a4565b610455611d79565b346102a1576107523660046103a4565b60405160328152602090f35b634e487b7160e01b60009081526041600452602490fd5b90601f1990601f011681019081106001600160401b0382111761079757604052565b61075e565b906102c56040519283610775565b6001600160401b03811161079757601f1990601f011660200190565b9180919283376000910152565b909291926107e86107e3826107aa565b61079c565b938185526020850190828401116102a1576102c5926107c6565b9080601f830112156102a157816102db9235906020016107d3565b906020828203126102a15781356001600160401b0381116102a1576102db9201610802565b346102a15761045561085536600461081d565b610ed6565b346102a15761086a3660046103a4565b610455610f3e565b81525b60200190565b8051808352916020019160208092019160005b82811061089c575050505090565b906108ab849582949551610872565b940192919060010161088e565b6102db916020808301925261087b565b346102a15761030b6108e36108de3660046106fb565b612e56565b604051918291826108b8565b6108fa3660046103a4565b610455611bc8565b346102a1576109123660046103a4565b604051660c6f3b40b6c0008152602090f35b346102a1576109343660046103a4565b61030b6103e5600a5460081c6001600160a01b031690565b346102a15761095c3660046103a4565b61030b610398610edf565b346102a1576109773660046103a4565b61030b610398612434565b90916060828403126102a1576102db61099b8484610410565b9360208401356104c8565b346102a15761030b6108e36109bc366004610982565b91612d15565b6104556109d0366004610312565b611275565b801515036102a157565b905035906102c5826109d5565b91906040838203126102a15780610a066102db9285610410565b936020016109df565b346102a157610455610a223660046109ec565b906125a6565b634e487b7160e01b60009081526021600452602490fd5b60051115610a4957565b610a28565b906102c582610a3f565b610a6190610a4e565b9052565b6020810192916102c59190610a58565b346102a157610a853660046103a4565b600e5461030b9060ff165b60405191829182610a65565b906080828203126102a157610ab18183610410565b92610abf8260208501610410565b9260408101359260608201356001600160401b0381116102a1576102db9201610802565b610455610af1366004610a9c565b9291909161281a565b6080810192916102c59190610600565b346102a15761030b610b25610b20366004610312565b612b3c565b60405191829182610afa565b346102a15761030b610398610b47366004610312565b611464565b346102a157610b5c3660046103a4565b61030b610a90600e5460ff1690565b634e487b7160e01b60009081526004819052602490fd5b634e487b7160e01b60009081526022600452602490fd5b90600182811c92168015610bb8575b6020831014610bb357565b610b82565b91607f1691610ba8565b90600092918054610bdf610bd582610b99565b8085529360200190565b91600191808316908115610c355750600114610bfc575b50505050565b600090815260208120949550939192915b828510610c2257505050019038808080610bf6565b8054848601526020909401938101610c0d565b60ff1916845250505090151560051b01915038808080610bf6565b906102c5610c649260405193848092610bc2565b0383610775565b90610c79576102db90610c50565b610b6b565b346102a157610c8e3660046103a4565b61030b6103986000600d610c6b565b346102a15761030b610491610cb33660046106fb565b610f61565b91906040838203126102a15780610cd26102db9285610410565b93602001610410565b346102a15761030b6102f9610cf1366004610cb8565b90612603565b346102a157610455610d0a3660046106fb565b611e1c565b346102a157610455610d2236600461041d565b90611b8f565b600511156102a157565b905035906102c582610d28565b906020828203126102a1576102db91610d32565b346102a157610455610d66366004610d3f565b610f22565b6102c590610d77611d3c565b610ec7565b9055565b818110610d8b575050565b60008155600101610d80565b9190601f90818111610da95750505050565b610dbc610dde9460009081526020902090565b916020918185019280600594851c86019610610de7575b5001901c0190610d80565b38808080610bf6565b94508394610dd3565b908051906001600160401b03821161079757610e1682610e108554610b99565b85610d97565b602090601f808411600114610e535750610d7c929160009183610e48575b50506000198260031b1c19169060011b1790565b015190503880610e34565b600085815260208120939192908590601f198216905b818110610ea2575010610e85575b50505050600190811b019055565b0151600019600385901b60f8161c19169091555038808080610e77565b83850151875560019096019560209485019488935001610e69565b906102c591610df0565b610ed3600d9182610ebd565b50565b6102c590610d6b565b6102db600d610c50565b6102c590610ef5611d3c565b610f17565b90610f07610d7c91610a4e565b825460ff191660ff919091161790565b610ed381600e610efa565b6102c590610ee9565b610f33611d3c565b6102c56102c5611ee6565b6102c5610f2b565b610f4e611d3c565b6102c56102c5611f9f565b6102c5610f46565b6102db906123b6565b600e81526020016d135a5b9d081a185cc8195b99195960921b8152610875565b60208082526102db9101610f6a565b15610fa057565b60405162461bcd60e51b815280610fb960048201610f8a565b0390fd5b600e81526020016d135a5b9d081a5cc81c185d5cd95960921b8152610875565b60208082526102db9101610fbd565b15610ff357565b60405162461bcd60e51b815280610fb960048201610fdd565b6102c59061102561271061101e612347565b1115610f99565b336001600160a01b0380611044600a5460081c6001600160a01b031690565b16911603156110625761106261105c600a5460ff1690565b15610fec565b6110739061106e61206e565b611206565b6102c5612086565b634e487b7160e01b60009081526011600452602490fd5b9190820180921161109f57565b61107b565b601281526020017113585e081b1a5b5a5d08195e18d95959195960721b8152610875565b60208082526102db91016110a4565b156110de57565b60405162461bcd60e51b815280610fb9600482016110c8565b600a815260200169135a5b9d08195b99195960b21b8152610875565b60208082526102db91016110f7565b1561112957565b60405162461bcd60e51b815280610fb960048201611113565b601b81526020017f43616e6e6f74206d696e742074686174206d616e79206974656d7300000000008152610875565b60208082526102db9101611142565b1561118757565b60405162461bcd60e51b815280610fb960048201611171565b8181029291811591840414171561109f57565b6012815260200171496e73756666696369656e742066756e647360701b8152610875565b60208082526102db91016111b3565b156111ed57565b60405162461bcd60e51b815280610fb9600482016111d7565b6102c590611235611215612347565b6127109061122e826112278684611092565b11156110d7565b1115611122565b33611254606461124d8461124885610f61565b611092565b1115611180565b61127034611269660c6f3b40b6c000856111a0565b11156111e6565b612992565b6102c59061100c565b60118152602001702737b732bc34b9ba32b73a103a37b5b2b760791b8152610875565b60208082526102db910161127e565b156112b757565b60405162461bcd60e51b815280610fb9600482016112a1565b909291926112e06107e3826107aa565b938185526020850190828401116102a1576102c592610322565b9080601f830112156102a15781516102db926020016112d0565b906020828203126102a15781516001600160401b0381116102a1576102db92016112fa565b6040513d6000823e3d90fd5b61138d9061135a6113558261261c565b6112b0565b600c546001600160a01b03908116169060405180926384ab67b560e01b8252818060009687956004830190815260200190565b03915afa9182156113bf5780926113a357505090565b6102db92503d8091833e6113b78183610775565b810190611314565b611339565b601f81526020017f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e008152610875565b60208082526102db91016113c4565b1561140957565b60405162461bcd60e51b815280610fb9600482016113f3565b9061142f6107e3836107aa565b918252565b6102db6000611422565b6102db9061145361144e8261261c565b611402565b60009061145e611434565b906117e9565b6102db9061147461144e8261261c565b600d9061145e611486600e5460ff1690565b92610c50565b9190916040818403126102a1578051926001600160401b03938481116102a157816114b89184016112fa565b9360208301519081116102a1576102db92016112fa565b6114e0815180938093602001610322565b0190565b681134b6b0b3b2911d1160b91b815261150b929161150591600901906114cf565b906114cf565b632e706e6760e01b815260040161152581601160f91b9052565b60010190565b91906115416102c59160405194602086016114e4565b839003601f198101845283610775565b61155a916114cf565b600b60fa1b8152611525565b906102c56115416040519360208501611551565b611583916114cf565b691139bb33afb230ba309160b11b8152600a0190565b906102c5611541604051936020850161157a565b6115b6916114cf565b6e1130b734b6b0ba34b7b72fbab9361160891b8152600f0190565b906102c561154160405193602085016115ad565b6115ee916114cf565b6b1134b6b0b3b2afb230ba309160a11b8152600c0190565b906102c561154160405193602085016115e5565b611623916114cf565b661134b6b0b3b29160c91b815260070190565b906102c5611541604051936020850161161a565b6116589061168493926114cf565b7f3a22646174613a696d6167652f7376672b786d6c3b6261736536342c000000008152601c01906114cf565b601160f91b8152611525565b91906115416102c591604051946020860161164a565b916115056116df61177093611783956116d681747b226e616d65223a22416c69656e2052756e65202360581b9052565b601501906114cf565b7f222c226465736372697074696f6e223a22416c69656e2052756e65732028307881527f415229202d20436f6c6c656374696f6e206f662031302c30303020756e69717560208201527f65204e4654732c2031303025206f6e2d636861696e2c2067656e65726174656460408201527208189e4814dbdb1a591a5d1e4818dbd919488b606a1b606082015260730190565b600b60fa1b8152916001809301906114cf565b607d60f81b81520190565b60405193926102c59261154192602087016116a6565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526102db9190601d01906114cf565b906102c561154160405193602085016117a4565b600c546040516322dac39360e01b8152600480820184905260009390928490839060249082906001600160a01b03165afa9182156113bf576102db966118db96866118d6979381966119d3575b5061183f611434565b8251909290156119aa5761185e919250611858866121e2565b9061152b565b9061186881610a4e565b61187184610a4e565b146119a2575b61188087610a4e565b61188984610a4e565b0361198d575b61189890610a4e565b6118a183610a4e565b03611900576118bb6118b56118c192611636565b96610a4e565b91610a4e565b036118e0575b506118d1906121e2565b61178e565b611bee565b6117d5565b836118f36118f9926118d1949650611bee565b90611690565b92906118c7565b61190a6001610a4e565b61191383610a4e565b03611927576118bb6118b56118c192611606565b6119316002610a4e565b61193a83610a4e565b0361194e576118bb6118b56118c1926115d1565b946119596003610a4e565b61196283610a4e565b14611974575b6118bb6118c191610a4e565b946118bb6119846118c192611599565b96915050611968565b9061199a61189891611566565b91905061188f565b869250611877565b506119b487610a4e565b6119bd84610a4e565b146119cb5761189890610a4e565b91508161188f565b9093506119f39195503d8085833e6119eb8183610775565b81019061148c565b94909238611836565b906102c591611a09611d3c565b611b4b565b602981526020017f526563697069656e7420616464726573732063616e206e6f742062652061646481526872657373207a65726f60b81b60208201525b60400190565b60208082526102db9101611a0e565b15611a6757565b60405162461bcd60e51b815280610fb960048201611a51565b60188152602001774e6f7468696e67206c65667420746f20776974686472617760401b8152610875565b60208082526102db9101611a80565b15611ac057565b60405162461bcd60e51b815280610fb960048201611aaa565b3d15611af357611ae83d611422565b903d6000602084013e565b606090565b60128152602001714661696c656420746f20776974686472617760701b8152610875565b60208082526102db9101611af8565b15611b3257565b60405162461bcd60e51b815280610fb960048201611b1c565b6102c59160009182916001600160a01b0391821691611b6b831515611a60565b611b76471515611ab9565b5060405190818003925af1611b89611ad9565b50611b2b565b906102c5916119fc565b611ba1611d3c565b6102c5473360008215611bbf575b6000809381938293f1156113bf57565b506108fc611baf565b6102c5611b99565b611bd9816123d9565b908115611be4575090565b6102db9150612091565b6102db906000809180516060949381611c075750505050565b909192945060036002908082850104821b9360408051987f4142434445464748494a4b4c4d4e4f505152535455565758595a616263646566601f526106709015027f6768696a6b6c6d6e6f707172737475767778797a303132333435363738392d5f18603f908152602090818b01888c0191868484019b5b0191825182808260121c16519160009283538181600c1c1651600153818160061c16518c5316518953518152600401918b831015611cbe578790611c7f565b5050985082915001905206900490613d3d60f01b828503521515029182600091035203825238808080610bf6565b15611cf357565b60405162461bcd60e51b815280610fb9600482016020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6102c5611d54600a5460081c6001600160a01b031690565b6001600160a01b03163314611cec565b611d6c611d3c565b6102c56102c56000611e25565b6102c5611d64565b6102c590611d8d611d3c565b611dff565b602681526020017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b6020820152611a4b565b60208082526102db9101611d92565b15611de657565b60405162461bcd60e51b815280610fb960048201611dd0565b6102c590611e176001600160a01b0382161515611ddf565b611e25565b6102c590611d81565b600a8054610100600160a81b03198116600884811b610100600160a81b0316919091179092556001600160a01b0392831692911c167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b611e89611f3f565b6102c5611ea5565b805460ff191691151560ff16919091179055565b6001611eb281600a611e91565b506040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589080602081015b0390a1565b6102c5611e81565b601081526020016f14185d5cd8589b194e881c185d5cd95960821b8152610875565b60208082526102db9101611eee565b15611f2657565b60405162461bcd60e51b815280610fb960048201611f10565b6102c5611f4e600a5460ff1690565b15611f1f565b611f5c611ffc565b6102c56000611f6c81600a611e91565b506040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa908060208101611ee1565b6102c5611f54565b601481526020017314185d5cd8589b194e881b9bdd081c185d5cd95960621b8152610875565b60208082526102db9101611fa7565b15611fe357565b60405162461bcd60e51b815280610fb960048201611fcd565b6102c561200b600a5460ff1690565b611fdc565b601f81526020017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c008152610875565b60208082526102db9101612010565b1561205557565b60405162461bcd60e51b815280610fb96004820161203f565b6002610ed381600b612083828254141561204e565b55565b6001610ed381600b55565b6001600160e01b0319811663152a902d60e11b149081156120b0575090565b6001600160e01b0319166301ffc9a760e01b14905090565b906102c56120ed6120d9604061079c565b93546001600160a01b038116855260a01c90565b6001600160601b03166020840152565b634e487b7160e01b60009081526012600452602490fd5b811561211e570490565b6120fd565b600090815260096020526040902090919061213d906120c8565b80519092906001600160a01b03161561219f575b61218d8161219b92506121826001600160601b03918261217b60208901516001600160601b031690565b16906111a0565b906127101690612114565b92516001600160a01b031690565b9190565b915061219b61218d6121b160086120c8565b93915050612151565b369037565b906102c56121d56121cf84611422565b936107aa565b601f1901602084016121ba565b6001806121ee8361224d565b926121fa8285016121bf565b938401602101915b61220d575b50505090565b6000199091019061223a90600a906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a8453612114565b918215612248579182612202565b612207565b60009072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b80821015612333575b506d04ee2d6d415b85acef81000000008082101561231f575b50662386f26fc100008082101561230b575b506305f5e100808210156122f7575b50612710808210156122e3575b506064808210156122cf575b50600a11156115255790565b6122d891612114565b9060020190386122c3565b6122ec91612114565b9060040190386122b7565b61230091612114565b9060080190386122aa565b61231491612114565b90601001903861229b565b61232891612114565b906020019038612289565b9061233e9250612114565b60409038612270565b6000546001549003612357600090565b900390565b6001600160a01b0390911660009081526020919091526040902090565b60006001600160a01b038216156123a3575061239e6001600160401b0391600561235c565b541690565b506040516323d3ad8160e21b8152600490fd5b6123d56001600160401b03916123cf604091600561235c565b54901c90565b1690565b6001600160e01b03198181166301ffc9a760e01b8114928315612419575b83156124035750505090565b50635b5e139f60e01b1491503890508080612207565b6380ac58cd60e01b821493506123f7565b6102db6002610c50565b6102db6003610c50565b6001600160a01b03906123d5905b80612464565b604051636f96cda160e11b8152600490fd5b600080548310612475575b50612452565b61248b6004938460009182526020526040902090565b549050600160e01b811661246f575b806124b857506000190160008181526020839052604090205461249a565b91505090565b6124c78261243e565b906001600160a01b03808316919033838103612544575b5060009361251b836124fb88600660009182526020526040902090565b805490916001600160a01b03199091166001600160a01b03909116179055565b5016917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259080a4565b61254e9085612603565b1561255957386124de565b6040516367d9dca160e11b8152600490fd5b6125748161261c565b15612594576000908152600660205260409020546001600160a01b031690565b6040516333d1c03960e21b8152600490fd5b336125c4836125bf846125ba85600761235c565b61235c565b611e91565b60405192151583526001600160a01b03918216929116907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190602090a3565b6102db916125ba61261592600761235c565b5460ff1690565b600190612648565b8161262d575090565b6000908152600460205260409020600160e01b915054161590565b60005481109150612624565b9092916126608161244c565b936001600160a01b0383811693908087168590036127f95760008481526006602052604090208054959091336001600160a01b038516811481891417156127d2575b506000988186169384156127c057998794939291816102c59b9c60019b6127b8575b50506126ea8860056126d68a8261235c565b6126e4815460001901809255565b5061235c565b6126f68b825401809255565b50600160e11b61272061270a838b8b612b0b565b4260a01b908317176001600160a01b038b161790565b9060049161273c816120838b8660009182526020526040902090565b50821615612773575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9250819050a450505050565b868b0160008181526020839052604090205415612791575b50612745565b8354811461278b5761208383916127b19360009182526020526040902090565b388061278b565b5581386126c4565b604051633a954ecd60e21b8152600490fd5b6127dc9085612603565b156127e757386126a2565b604051632ce44b5f60e11b8152600490fd5b60405162a1148160e81b8152600490fd5b90916102c592612818611434565b925b91929092612829818585612654565b600093803b61283a575b5050505050565b612843936128c9565b156128515780808080612833565b506040516368d2bf6b60e11b8152600490fd5b905051906102c5826102a6565b906020828203126102a1576102db91612864565b6128c06102db959392946128b96080946128a9858781019960018060a01b03169052565b6001600160a01b03166020850152565b6040830152565b60600152610348565b600094936001600160a01b03909216919033936129016040938451918291630a85bd0160e11b9485845260209660049a8b8601612885565b039483826000978189855af1869281612963575b5061294f5750505060016129295750505050565b612931611ad9565b8051918261294c57505090516368d2bf6b60e11b8152915050fd5b01fd5b506001600160e01b03191614955050505050565b612984919350853d871161298b575b61297c8183610775565b810190612871565b9138612915565b503d612972565b6102c59161299e611434565b906129a98184612a08565b600092803b6129b85750505050565b83549182039160015b156129ee575b846129d885856001019585896128c9565b6129c1576040516368d2bf6b60e11b8152600490fd5b8083106129c7579250505081540361030f57808080610bf6565b91906000928354908215612af9576040946001612a3d680100000000000000018602612a3585600561235c565b908154019055565b612a6681861460e11b612a51848681612b0b565b4260a01b9117176001600160a01b0385161790565b96600497612a8281612083888c60009182526020526040902090565b50848601916001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef878387838180a48188015b858103612aea5750505015612adc57506102c5959650612833818355565b51622e076360e81b81528790fd5b8290808589858180a401612abe565b60405163b562e8dd60e01b8152600490fd5b50600091506102db9050565b612b21608061079c565b90600080835260208181850152816040850152506060830152565b612b44612b17565b50612b4d612b17565b6000612b87565b612b825750612b6281612bad565b90612b706040830151151590565b612b7e576102db9150612b93565b5090565b905090565b50600054821015612b54565b612ba86102db91612ba2612b17565b5061244c565b612bd0565b612bce6102db91612bbc612b17565b50600460009182526020526040902090565b545b90612bd9612b17565b6001600160a01b03831681526001600160401b0360a084901c166020820152600160e01b83161515604082015260e89290921c6060830152565b6001600160401b0381116107975760051b60200190565b9061142f6107e383612c13565b60005b828110612c4657505050565b612c4e612b17565b81830152602001612c3a565b906102c5612c70612c6a84612c2a565b93612c13565b601f190160208401612c37565b634e487b7160e01b60009081526032600452602490fd5b9190811015612ca45760051b0190565b612c7d565b908151811015612ca45760051b6020010190565b90612cc781612c5a565b9160005b82811461220757612ce7610b20612ce3838686612c94565b3590565b612cf18286612ca9565b52612cfc8185612ca9565b50600101612ccb565b906102c56121d5612c6a84612c2a565b9082811015612e4457600091612d2a60005490565b808511612e3c575b50612d3c81612379565b9184811015612e3357808503838110612e2b575b505b612d5b83612d05565b928015612e2257612d6b82612b3c565b90600092604092612d7e84820151151590565b15612e10575b505b8781141580612e06575b15612dfa57612d9e81612bad565b80840151612df457516001600160a01b03908181169081612dea575b505080861690851614612dd0575b600101612d86565b612de581612de2896001019989612ca9565b52565b612dc8565b5094508438612dba565b50612dc8565b50505050509150815290565b5081871415612d90565b516001600160a01b0316935083612d84565b50505091505090565b925082612d50565b60009250612d52565b935083612d32565b604051631960ccad60e11b8152600490fd5b6000918291612e6481612379565b93612e6e85612d05565b92612e77612b17565b5060005b868614612ee557612e8b81612bad565b6040810151612edf57516001600160a01b03908181169081612ed5575b505080851690841614612ebe575b600101612e7b565b612ed081612de2886001019888612ca9565b612eb6565b5093508338612ea8565b50612eb6565b509450505090509056fea264697066735822122040d34c8094676fca6d4a36306837378258bca673c8341074510583e939e1591d64736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002d902bb467f6990373e5487972f9ef89a12f9f87
-----Decoded View---------------
Arg [0] : _generator (address): 0x2d902BB467F6990373E5487972f9Ef89a12f9F87
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002d902bb467f6990373e5487972f9ef89a12f9f87
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.