ERC-721
Overview
Max Total Supply
104 ADIGT
Holders
92
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 ADIGTLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
GoldenTicket
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import '@openzeppelin/contracts/access/Ownable.sol'; import 'erc721a/contracts/extensions/ERC721AQueryable.sol'; import 'operator-filter-registry/src/DefaultOperatorFilterer.sol'; import '@openzeppelin/contracts/token/common/ERC2981.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import '@openzeppelin/contracts/utils/structs/BitMaps.sol'; contract GoldenTicket is ERC721AQueryable, ERC2981, Ownable, Pausable, DefaultOperatorFilterer { string private _name; string private _symbol; string private _contractUri; string public baseUri; BitMaps.BitMap private lockedTokens; BitMaps.BitMap private redeemedTokens; mapping(address => bool) public permittedOperators; constructor( string memory __name, string memory __symbol, string memory __contractUri, string memory _baseUri, address recipient, uint96 value ) ERC721A(_name, _symbol) { _name = __name; _symbol = __symbol; _contractUri = __contractUri; baseUri = _baseUri; _setDefaultRoyalty(recipient, value); _pause(); } modifier onlyPermittedOperator() { require(permittedOperators[msg.sender] || msg.sender == owner(), 'Not a permitted operator'); _; } /// @notice The name of the ERC721 token. function name() public view override(ERC721A, IERC721A) returns (string memory) { return _name; } /// @notice The symbol of the ERC721 token. function symbol() public view override(ERC721A, IERC721A) returns (string memory) { return _symbol; } /// @notice Sets the name and symbol of the ERC721 token. /// @param newName The new name for the token. /// @param newSymbol The new symbol for the token. function setNameAndSymbol( string calldata newName, string calldata newSymbol ) external onlyOwner { _name = newName; _symbol = newSymbol; } /// @notice The token base URI. function _baseURI() internal view override returns (string memory) { return baseUri; } /// @notice Sets the base URI for the token metadata. /// @param newBaseUri The new base URI for the token metadata. function setBaseUri(string calldata newBaseUri) external onlyOwner { baseUri = newBaseUri; } /// @notice Sets the URI for the contract metadata. /// @param newContractUri The new contract URI for contract metadata. function setContractURI(string calldata newContractUri) external onlyOwner { _contractUri = newContractUri; } /// @notice Sets the contract URI for marketplace listings. function contractURI() public view returns (string memory) { return _contractUri; } /// @notice Pauses the contract, preventing token transfers. function pause() public onlyOwner { _pause(); } /// @notice Unpauses the contract, allowing token transfers. function unpause() public onlyOwner { _unpause(); } /// @notice Mints multiple tokens and assigns them to the specified addresses. /// @param to An array of addresses to which tokens will be minted. /// @param value An array of values representing the number of tokens to mint for each address. function mintMany(address[] calldata to, uint256[] calldata value) external onlyOwner { require(to.length == value.length, 'Mismatched lengths'); unchecked { for (uint256 i = 0; i < to.length; i++) { _mint(to[i], value[i]); } } } /// @notice Sets the royalty fee for the specified recipient. /// @param recipient The address of the royalty recipient. /// @param value The value of the royalty fee. function setRoyalties(address recipient, uint96 value) public onlyOwner { _setDefaultRoyalty(recipient, value); } /// @notice Locks the specified tokens, preventing them from being transferred. /// @param tokenIds An array of token IDs to be locked. function lockTokens(uint256[] calldata tokenIds) external onlyPermittedOperator { unchecked { for (uint256 i = 0; i < tokenIds.length; i++) { require(_exists(tokenIds[i]), 'Token does not exist.'); require(!BitMaps.get(lockedTokens, tokenIds[i]), 'Token is already locked'); BitMaps.set(lockedTokens, tokenIds[i]); } } } /// @notice Admin function to unlock the specified golden tickets, allowing them to be transferred. /// @param tokenIds An array of token IDs to be unlocked. function unlockTokens(uint256[] calldata tokenIds) external onlyPermittedOperator { unchecked { for (uint256 i = 0; i < tokenIds.length; i++) { require(BitMaps.get(lockedTokens, tokenIds[i]), 'Token is already unlocked'); BitMaps.unset(lockedTokens, tokenIds[i]); } } } /// @notice Check if a token is locked. /// @param tokenId The tokenId of the token to check. function isTokenLocked(uint256 tokenId) public view returns (bool) { return BitMaps.get(lockedTokens, tokenId); } /// @notice Check if a token has be burned and redeemed. /// @param tokenId The tokenId of the token to check. function isTokenRedeemed(uint256 tokenId) public view returns (bool) { return BitMaps.get(redeemedTokens, tokenId); } /// @notice Get tokenIds of all locked tokens in a given range. /// @param start The start tokenId of the range to check. /// @param end The end tokenId of the range to check. function getLockedTokensInRange( uint256 start, uint256 end ) public view returns (uint256[] memory) { require(end >= start, 'End must be greater than or equal to start'); uint256[] memory result = new uint256[](end - start + 1); uint256 count = 0; unchecked { for (uint256 i = start; i <= end; i++) { if (BitMaps.get(lockedTokens, i)) { result[count] = i; count++; } } } uint256[] memory tokens = new uint256[](count); unchecked { for (uint256 i = 0; i < count; i++) { tokens[i] = result[i]; } } return tokens; } /// @notice Get tokenIds of all redeemed tokens in a given range. /// @param start The start tokenId of the range to check. /// @param end The end tokenId of the range to check. function getRedeemedTokensInRange( uint256 start, uint256 end ) public view returns (uint256[] memory) { require(end >= start, 'End must be greater than or equal to start'); uint256[] memory result = new uint256[](end - start + 1); uint256 count = 0; unchecked { for (uint256 i = start; i <= end; i++) { if (BitMaps.get(redeemedTokens, i)) { result[count] = i; count++; } } } uint256[] memory redeemedTokensInRange = new uint256[](count); unchecked { for (uint256 i = 0; i < count; i++) { redeemedTokensInRange[i] = result[i]; } } return redeemedTokensInRange; } /// @notice Admin function to burn and redeem the golden ticket. /// @param tokenIds An array of locked token IDs to be burned. function burnAndRedeem(uint256[] calldata tokenIds) external onlyPermittedOperator { unchecked { for (uint256 i = 0; i < tokenIds.length; i++) { require( BitMaps.get(lockedTokens, tokenIds[i]), 'Token must be locked before burn/redemption' ); _burn(tokenIds[i]); BitMaps.set(redeemedTokens, tokenIds[i]); } } } /// @notice Adds multiple addresses as permitted operators. /// @param operators An array of addresses to be added as permitted operators. function addPermittedOperators(address[] calldata operators) external onlyOwner { for (uint256 i = 0; i < operators.length; i++) { require(!permittedOperators[operators[i]], 'At least one operator is already permitted'); permittedOperators[operators[i]] = true; } } /// @notice Removes multiple addresses from the permitted operators list. /// @param operators An array of addresses to be removed from the permitted operators list. function removePermittedOperators(address[] calldata operators) external onlyOwner { for (uint256 i = 0; i < operators.length; i++) { permittedOperators[operators[i]] = false; } } /// @dev Ensure that a user cannot burn or transfer a locked golden ticket unless that user is a permitted operator function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal override { unchecked { for (uint256 i = startTokenId; i < startTokenId + quantity; i++) { if (BitMaps.get(lockedTokens, i)) { require( permittedOperators[msg.sender] || msg.sender == owner(), 'At least one token is locked and cannot be transferred.' ); } } } super._beforeTokenTransfers(from, to, startTokenId, quantity); } function setApprovalForAll( address operator, bool approved ) public override(ERC721A, IERC721A) onlyAllowedOperatorApproval(operator) whenNotPaused { super.setApprovalForAll(operator, approved); } function approve( address operator, uint256 tokenId ) public payable override(ERC721A, IERC721A) onlyAllowedOperatorApproval(operator) whenNotPaused { if (BitMaps.get(lockedTokens, tokenId)) { require( permittedOperators[msg.sender] || msg.sender == owner(), 'Token must not be locked to grant approval.' ); } super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) whenNotPaused { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) whenNotPaused { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public payable override(ERC721A, IERC721A) onlyAllowedOperator(from) whenNotPaused { super.safeTransferFrom(from, to, tokenId, data); } /// @dev Supports `interfaceId`s for IERC165, IERC721, IERC721Metadata, IERC2981 function supportsInterface( bytes4 interfaceId ) public view override(ERC721A, IERC721A, ERC2981) returns (bool) { return ERC721A.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); } }
// 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) (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 (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 // 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 v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/BitMaps.sol) pragma solidity ^0.8.0; /** * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential. * Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor]. */ library BitMaps { struct BitMap { mapping(uint256 => uint256) _data; } /** * @dev Returns whether the bit at `index` is set. */ function get(BitMap storage bitmap, uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); return bitmap._data[bucket] & mask != 0; } /** * @dev Sets the bit at `index` to the boolean `value`. */ function setTo(BitMap storage bitmap, uint256 index, bool value) internal { if (value) { set(bitmap, index); } else { unset(bitmap, index); } } /** * @dev Sets the bit at `index`. */ function set(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] |= mask; } /** * @dev Unsets the bit at `index`. */ function unset(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] &= ~mask; } }
// 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.selector); 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.selector); 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 Returns whether the ownership slot at `index` is initialized. * An uninitialized slot does not necessarily mean that the slot has no owner. */ function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return _packedOwnerships[index] != 0; } /** * @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 packed) { if (_startTokenId() <= tokenId) { packed = _packedOwnerships[tokenId]; // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector); // 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, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = _packedOwnerships[--tokenId]; } if (packed == 0) continue; if (packed & _BITMASK_BURNED == 0) return packed; // Otherwise, the token is burned, and we must revert. // This handles the case of batch burned tokens, where only the burned bit // of the starting slot is set, and remaining slots are left uninitialized. _revert(OwnerQueryForNonexistentToken.selector); } } // Otherwise, the data exists and we can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. // If the token is not burned, return `packed`. Otherwise, revert. if (packed & _BITMASK_BURNED == 0) return packed; } _revert(OwnerQueryForNonexistentToken.selector); } /** * @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. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @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.selector); 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 result) { if (_startTokenId() <= tokenId) { if (tokenId < _currentIndex) { uint256 packed; while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId; result = packed & _BITMASK_BURNED == 0; } } } /** * @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); // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS)); if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector); (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.selector); _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; } } } } // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; assembly { // 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. from, // `from`. toMasked, // `to`. tokenId // `tokenId`. ) } if (toMasked == 0) _revert(TransferToZeroAddress.selector); _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.selector); } } /** * @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.selector); } 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.selector); _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: // - `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) ); // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); uint256 end = startTokenId + quantity; uint256 tokenId = startTokenId; do { assembly { // 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`. tokenId // `tokenId`. ) } // The `!=` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. } while (++tokenId != end); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) _revert(MintToZeroAddress.selector); if (quantity == 0) _revert(MintZeroQuantity.selector); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector); _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.selector); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) _revert(bytes4(0)); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @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: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck && _msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { _revert(ApprovalCallerNotOwnerNorApproved.selector); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // 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.selector); } _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.selector); 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) } } /** * @dev For more efficient reverts. */ function _revert(bytes4 errorSelector) internal pure { assembly { mstore(0x00, errorSelector) revert(0x00, 0x04) } } }
// 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 ownership) { unchecked { if (tokenId >= _startTokenId()) { if (tokenId < _nextTokenId()) { // If the `tokenId` is within bounds, // scan backwards for the initialized ownership slot. while (!_ownershipIsInitialized(tokenId)) --tokenId; return _ownershipAt(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) { TokenOwnership[] memory ownerships; uint256 i = tokenIds.length; assembly { // Grab the free memory pointer. ownerships := mload(0x40) // Store the length. mstore(ownerships, i) // Allocate one word for the length, // `tokenIds.length` words for the pointers. i := shl(5, i) // Multiply `i` by 32. mstore(0x40, add(add(ownerships, 0x20), i)) } while (i != 0) { uint256 tokenId; assembly { i := sub(i, 0x20) tokenId := calldataload(add(tokenIds.offset, i)) } TokenOwnership memory ownership = explicitOwnershipOf(tokenId); assembly { // Store the pointer of `ownership` in the `ownerships` array. mstore(add(add(ownerships, 0x20), i), ownership) } } 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) { return _tokensOfOwnerIn(owner, start, stop); } /** * @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) { uint256 start = _startTokenId(); uint256 stop = _nextTokenId(); uint256[] memory tokenIds; if (start != stop) tokenIds = _tokensOfOwnerIn(owner, start, stop); return tokenIds; } /** * @dev Helper function for returning an array of token IDs owned by `owner`. * * Note that this function is optimized for smaller bytecode size over runtime gas, * since it is meant to be called off-chain. */ function _tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) private view returns (uint256[] memory) { unchecked { if (start >= stop) _revert(InvalidQueryRange.selector); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } uint256 stopLimit = _nextTokenId(); // Set `stop = min(stop, stopLimit)`. if (stop >= stopLimit) { stop = stopLimit; } uint256[] memory tokenIds; uint256 tokenIdsMaxLength = balanceOf(owner); bool startLtStop = start < stop; assembly { // Set `tokenIdsMaxLength` to zero if `start` is less than `stop`. tokenIdsMaxLength := mul(tokenIdsMaxLength, startLtStop) } if (tokenIdsMaxLength != 0) { // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (stop - start <= tokenIdsMaxLength) { tokenIdsMaxLength = stop - start; } assembly { // Grab the free memory pointer. tokenIds := mload(0x40) // Allocate one word for the length, and `tokenIdsMaxLength` words // for the data. `shl(5, x)` is equivalent to `mul(32, x)`. mstore(0x40, add(tokenIds, shl(5, add(tokenIdsMaxLength, 1)))) } // 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; } uint256 tokenIdsIdx; // Use a do-while, which is slightly more efficient for this case, // as the array will at least contain one element. do { ownership = _ownershipAt(start); assembly { switch mload(add(ownership, 0x40)) // if `ownership.burned == false`. case 0 { // if `ownership.addr != address(0)`. // The `addr` already has it's upper 96 bits clearned, // since it is written to memory with regular Solidity. if mload(ownership) { currOwnershipAddr := mload(ownership) } // if `currOwnershipAddr == owner`. // The `shl(96, x)` is to make the comparison agnostic to any // dirty upper 96 bits in `owner`. if iszero(shl(96, xor(currOwnershipAddr, owner))) { tokenIdsIdx := add(tokenIdsIdx, 1) mstore(add(tokenIds, shl(5, tokenIdsIdx)), start) } } // Otherwise, reset `currOwnershipAddr`. // This handles the case of batch burned tokens // (burned bit of first slot set, remaining slots left uninitialized). default { currOwnershipAddr := 0 } start := add(start, 1) } } while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength)); // Store the length of the array. assembly { mstore(tokenIds, tokenIdsIdx) } } return tokenIds; } } }
// 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 // 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 pragma solidity ^0.8.13; import {OperatorFilterer} from "./OperatorFilterer.sol"; import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol"; /** * @title DefaultOperatorFilterer * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. * @dev Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract DefaultOperatorFilterer is OperatorFilterer { /// @dev The constructor that is called when the contract is being deployed. constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { /** * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns * true if supplied registrant address is not registered. */ function isOperatorAllowed(address registrant, address operator) external view returns (bool); /** * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner. */ function register(address registrant) external; /** * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes. */ function registerAndSubscribe(address registrant, address subscription) external; /** * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another * address without subscribing. */ function registerAndCopyEntries(address registrant, address registrantToCopy) external; /** * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. * Note that this does not remove any filtered addresses or codeHashes. * Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes. */ function unregister(address addr) external; /** * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered. */ function updateOperator(address registrant, address operator, bool filtered) external; /** * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates. */ function updateOperators(address registrant, address[] calldata operators, bool filtered) external; /** * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered. */ function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; /** * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates. */ function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; /** * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous * subscription if present. * Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, * subscriptions will not be forwarded. Instead the former subscription's existing entries will still be * used. */ function subscribe(address registrant, address registrantToSubscribe) external; /** * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes. */ function unsubscribe(address registrant, bool copyExistingEntries) external; /** * @notice Get the subscription address of a given registrant, if any. */ function subscriptionOf(address addr) external returns (address registrant); /** * @notice Get the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscribers(address registrant) external returns (address[] memory); /** * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant. * Note that order is not guaranteed as updates are made. */ function subscriberAt(address registrant, uint256 index) external returns (address); /** * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr. */ function copyEntriesOf(address registrant, address registrantToCopy) external; /** * @notice Returns true if operator is filtered by a given address or its subscription. */ function isOperatorFiltered(address registrant, address operator) external returns (bool); /** * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription. */ function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); /** * @notice Returns true if a codeHash is filtered by a given address or its subscription. */ function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); /** * @notice Returns a list of filtered operators for a given address or its subscription. */ function filteredOperators(address addr) external returns (address[] memory); /** * @notice Returns the set of filtered codeHashes for a given address or its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashes(address addr) external returns (bytes32[] memory); /** * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredOperatorAt(address registrant, uint256 index) external returns (address); /** * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or * its subscription. * Note that order is not guaranteed as updates are made. */ function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); /** * @notice Returns true if an address has registered */ function isRegistered(address addr) external returns (bool); /** * @dev Convenience method to compute the code hash of an arbitrary contract */ function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E; address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol"; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. * Please note that if your token contract does not provide an owner with EIP-173, it must provide * administration methods on the contract itself to interact with the registry otherwise the subscription * will be locked to the options set during construction. */ abstract contract OperatorFilterer { /// @dev Emitted when an operator is not allowed. error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS); /// @dev The constructor that is called when the contract is being deployed. constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } /** * @dev A helper function to check if an operator is allowed. */ modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } /** * @dev A helper function to check if an operator approval is allowed. */ modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } /** * @dev A helper function to check if an operator is allowed. */ function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { // under normal circumstances, this function will revert rather than return false, but inheriting contracts // may specify their own OperatorFilterRegistry implementations, which may behave differently if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "viaIR": true, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"__name","type":"string"},{"internalType":"string","name":"__symbol","type":"string"},{"internalType":"string","name":"__contractUri","type":"string"},{"internalType":"string","name":"_baseUri","type":"string"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"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":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":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":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"operators","type":"address[]"}],"name":"addPermittedOperators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","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":"baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"burnAndRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","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":"ownership","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":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"getLockedTokensInRange","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"getRedeemedTokensInRange","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isTokenLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isTokenRedeemed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"lockTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"value","type":"uint256[]"}],"name":"mintMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"permittedOperators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"operators","type":"address[]"}],"name":"removePermittedOperators","outputs":[],"stateMutability":"nonpayable","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":"newBaseUri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newContractUri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newName","type":"string"},{"internalType":"string","name":"newSymbol","type":"string"}],"name":"setNameAndSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint96","name":"value","type":"uint96"}],"name":"setRoyalties","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":"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":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unlockTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080806040523462000d1a575f906200418c803803809162000022828562000d1e565b833981019160c08284031262000d175781516001600160401b03811162000d1357836200005191840162000d42565b60208301519091906001600160401b03811162000d1357846200007691850162000d42565b60408401519094906001600160401b03811162000d0f57816200009b91860162000d42565b60608501519091906001600160401b03811162000a155790620000c091860162000d42565b6080850151909590946001600160a01b038616860362000a155760a00151936001600160601b038516850362000a1557604051600b548186620001038362000db7565b808352926001811690811562000cee575060011462000c9e575b6200012b9250038262000d1e565b604051908582600c5491620001408362000db7565b808352926001811690811562000c7d575060011462000c2d575b620001689250038362000d1e565b8051906001600160401b03821162000c195781906200018960025462000db7565b601f811162000bbb575b50602090601f831160011462000b4157889262000b35575b50508160011b915f199060031b1c1916176002555b8051906001600160401b03821162000b21578190620001e160035462000db7565b601f811162000ab1575b50602090601f831160011462000a2557879262000a19575b50508160011b915f199060031b1c1916176003555b838055600a54336001600160a01b0382167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08780a36001600160a81b0319163360ff60a01b191617600a556daaeb6d7670e522a718067333cd4e3b6200096b575b8051906001600160401b038211620009575781906200029a600b5462000db7565b601f8111620008f9575b50602090601f83116001146200087f57869262000873575b50508160011b915f199060031b1c191617600b555b8051906001600160401b0382116200085f578190620002f2600c5462000db7565b601f811162000801575b50602090601f8311600114620007875785926200077b575b50508160011b915f199060031b1c191617600c555b8051906001600160401b038211620007675781906200034a600d5462000db7565b601f811162000706575b50602090601f83116001146200068c57849262000680575b50508160011b915f199060031b1c191617600d555b8351906001600160401b0382116200066c57620003a0600e5462000db7565b601f811162000616575b50602090601f8311600114620005a25794829394959262000596575b50508160011b915f199060031b1c191617600e555b6127106001600160601b038216116200053e576001600160a01b03821615620004f957604080519081016001600160401b03811182821017620004e5576040526001600160a01b03929092168083526001600160601b03821660209093019290925260a090811b6001600160a01b031916909117600855600a549081901c60ff16620004ad5760ff60a01b1916600160a01b17600a556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602090a16040516132f9908162000df38239f35b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b634e487b7160e01b5f52604160045260245ffd5b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b015190505f80620003c6565b600e81525f805160206200412c8339815191529190601f198416905b818110620005fd57509583600195969710620005e4575b505050811b01600e55620003db565b01515f1960f88460031b161c191690555f8080620005d5565b9192602060018192868b015181550194019201620005be565b600e82525f805160206200412c833981519152601f840160051c8101916020851062000661575b601f0160051c01905b818110620006555750620003aa565b82815560010162000646565b90915081906200063d565b634e487b7160e01b81526041600452602490fd5b015190505f806200036c565b600d85528493505f805160206200414c83398151915291905b601f1984168510620006ea576001945083601f19811610620006d1575b505050811b01600d5562000381565b01515f1960f88460031b161c191690555f8080620006c2565b81810151835560209485019460019093019290910190620006a5565b600d85529091505f805160206200414c833981519152601f840160051c810191602085106200075c575b90601f859493920160051c01905b8181106200074d575062000354565b8581558493506001016200073e565b909150819062000730565b634e487b7160e01b83526041600452602483fd5b015190505f8062000314565b600c86528593505f805160206200410c83398151915291905b601f1984168510620007e5576001945083601f19811610620007cc575b505050811b01600c5562000329565b01515f1960f88460031b161c191690555f8080620007bd565b81810151835560209485019460019093019290910190620007a0565b600c86529091505f805160206200410c833981519152601f840160051c81016020851062000857575b90849392915b601f830160051c8201811062000848575050620002fc565b87815585945060010162000830565b50806200082a565b634e487b7160e01b84526041600452602484fd5b015190505f80620002bc565b600b87528693505f805160206200416c83398151915291905b601f1984168510620008dd576001945083601f19811610620008c4575b505050811b01600b55620002d1565b01515f1960f88460031b161c191690555f8080620008b5565b8181015183556020948501946001909301929091019062000898565b600b87529091505f805160206200416c833981519152601f840160051c8101602085106200094f575b90849392915b601f830160051c8201811062000940575050620002a4565b88815585945060010162000928565b508062000922565b634e487b7160e01b85526041600452602485fd5b6daaeb6d7670e522a718067333cd4e3b1562000a1557604051633e9f1edf60e11b8152306004820152733cc6cdda760b79bafa08df41ecfa224f810dceb660248201528481604481836daaeb6d7670e522a718067333cd4e5af1801562000a0a57620009d9575b5062000279565b9093906001600160401b038111620009f657604052925f620009d2565b634e487b7160e01b82526041600452602482fd5b6040513d87823e3d90fd5b8380fd5b015190505f8062000203565b600388528793507fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b91905b601f198416851062000a95576001945083601f1981161062000a7c575b505050811b0160035562000218565b01515f1960f88460031b161c191690555f808062000a6d565b8181015183556020948501946001909301929091019062000a50565b600388529091507fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f840160051c81016020851062000b19575b90849392915b601f830160051c8201811062000b0a575050620001eb565b89815585945060010162000af2565b508062000aec565b634e487b7160e01b86526041600452602486fd5b015190505f80620001ab565b600289528893505f80516020620040ec83398151915291905b601f198416851062000b9f576001945083601f1981161062000b86575b505050811b01600255620001c0565b01515f1960f88460031b161c191690555f808062000b77565b8181015183556020948501946001909301929091019062000b5a565b600289529091505f80516020620040ec833981519152601f840160051c81016020851062000c11575b90849392915b601f830160051c8201811062000c0257505062000193565b8a815585945060010162000bea565b508062000be4565b634e487b7160e01b87526041600452602487fd5b50600c88529087905f805160206200410c8339815191525b81831062000c6057505090602062000168928201016200015a565b602091935080600191548385890101520191019091849262000c45565b602092506200016894915060ff191682840152151560051b8201016200015a565b50600b87529086905f805160206200416c8339815191525b81831062000cd15750509060206200012b928201016200011d565b602091935080600191548385880101520191019091839262000cb6565b602092506200012b94915060ff191682840152151560051b8201016200011d565b8280fd5b5080fd5b80fd5b5f80fd5b601f909101601f19168101906001600160401b03821190821017620004e557604052565b919080601f8401121562000d1a578251906001600160401b038211620004e5576040519160209162000d7e601f8301601f191684018562000d1e565b81845282828701011162000d1a575f5b81811062000da35750825f9394955001015290565b858101830151848201840152820162000d8e565b90600182811c9216801562000de7575b602083101462000dd357565b634e487b7160e01b5f52602260045260245ffd5b91607f169162000dc756fe60806040526004361015610011575f80fd5b5f3560e01c806301ffc9a7146102c457806306fdde03146102bf578063081812fc146102ba578063084b731a146102b5578063095ea7b3146102b057806317eb66c7146102ab57806318160ddd146102a657806323b872dd146102a1578063276a28a31461029c5780632a55205a146102975780633f4ba83a146102925780634029a3ce1461028d57806341f434341461028857806342842e0e146102835780635a4462151461027e5780635bbb2177146102795780635c5fd91c146102745780635c975abb1461026f5780636352211e1461026a57806370a0823114610265578063715018a614610260578063793577c91461025b5780638456cb59146102565780638462151c146102515780638da5cb5b1461024c5780638ff30c4914610247578063938e3d7b1461024257806395d89b411461023d57806399a2557a146102385780639abc832014610233578063a0bcfc7f1461022e578063a22cb46514610229578063aed7310d14610224578063b88d4fde1461021f578063be7d23661461021a578063c21b471b14610215578063c23dc68f14610210578063c87b56dd1461020b578063cbd5d40314610206578063e8a3d48514610201578063e985e9c5146101fc578063f15f32cb146101f75763f2fde38b146101f2575f80fd5b612383565b612321565b6122bd565b612217565b61213e565b612077565b612014565b611f0c565b611ed6565b611e4c565b611d1e565b611c79565b611b83565b611b54565b611873565b6117cd565b6116e1565b6115de565b6115b6565b61142a565b6113c9565b6112f0565b611259565b61122a565b6111fb565b6111d6565b6110dd565b611013565b610edc565b610cbd565b610c95565b610b04565b610a69565b6109d7565b610997565b6107fe565b6107b1565b610771565b61068c565b610564565b6104b7565b6103d3565b6102df565b6001600160e01b03198116036102db57565b5f80fd5b346102db5760203660031901126102db5760206004356102fe816102c9565b63ffffffff60e01b166301ffc9a760e01b81149081908215610368575b8215610357575b8215610335575b50506040519015158152f35b63152a902d60e11b149150811561034f575b505f80610329565b90505f610347565b635b5e139f60e01b81149250610322565b6380ac58cd60e01b8114925061031b565b5f5b83811061038a5750505f910152565b818101518382015260200161037b565b906020916103b381518092818552858086019101610379565b601f01601f1916010190565b9060206103d092818152019061039a565b90565b346102db575f806003193601126104b4576040519080600b546103f5816119f5565b8085529160019180831690811561048a575060011461042f575b61042b8561041f81870382611a77565b604051918291826103bf565b0390f35b9250600b83527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db95b82841061047257505050810160200161041f8261042b61040f565b80546020858701810191909152909301928101610457565b86955061042b9693506020925061041f94915060ff191682840152151560051b820101929361040f565b80fd5b346102db5760203660031901126102db576004356104d481612cdd565b156104f7575f526006602052602060018060a01b0360405f205416604051908152f35b6333d1c03960e21b5f5260045ffd5b9181601f840112156102db578235916001600160401b0383116102db576020808501948460051b0101116102db57565b60206003198201126102db57600435906001600160401b0382116102db5761056091600401610506565b9091565b346102db5761057236610536565b90335f526020906011825260409160ff835f2054168015610667575b6105979061285f565b5f5b8481106105a257005b6105b66105b08287866127f4565b35612cdd565b1561062b57806105f96105f46105f06105d26001958a896127f4565b3560ff6001918060081c5f52600f602052161b60405f205416151590565b1590565b6128ab565b6106256106078288876127f4565b358060081c5f52600f602052600160ff60405f2092161b8154179055565b01610599565b835162461bcd60e51b81526004810183905260156024820152742a37b5b2b7103237b2b9903737ba1032bc34b9ba1760591b6044820152606490fd5b50600a546001600160a01b0316331461058e565b6001600160a01b038116036102db57565b60403660031901126102db576004356106a48161067b565b6024356106b0826131ee565b6106b8612799565b6106d98160ff6001918060081c5f52600f602052161b60405f205416151590565b6106e9575b6106e791612c4b565b005b335f52601160205260ff60405f205416801561075d575b6106de5760405162461bcd60e51b815260206004820152602b60248201527f546f6b656e206d757374206e6f74206265206c6f636b656420746f206772616e60448201526a3a1030b8383937bb30b61760a91b6064820152608490fd5b50600a546001600160a01b03163314610700565b346102db5760203660031901126102db5760043561078e8161067b565b60018060a01b03165f526011602052602060ff60405f2054166040519015158152f35b346102db575f3660031901126102db5760205f546001549003604051908152f35b60609060031901126102db576004356107ea8161067b565b906024356107f78161067b565b9060443590565b610807366107d2565b6001600160a01b0392831692909190338403610989575b610826612799565b61082f83612bc5565b918482841603610984575f84815260066020526040902080546108616001600160a01b03881633908114908314171590565b610939575b61086f86612d8f565b610930575b506001600160a01b038581165f90815260056020908152604080832080545f19019055928416825282822080546001019055868252600490522091169384929091600160e11b904260a01b8517821790558116156108eb575b505f805160206132a48339815191525f80a4156108e657005b6130a0565b60018401610901815f52600460205260405f2090565b541561090e575b506108cd565b5f54811461090857610928905f52600460205260405f2090565b555f80610908565b5f90555f610874565b6109796105f06109723361095d8b60018060a01b03165f52600760205260405f2090565b9060018060a01b03165f5260205260405f2090565b5460ff1690565b15610866575b613091565b613083565b610992336131ee565b61081e565b346102db5760203660031901126102db5760206109cd60043560ff6001918060081c5f52600f602052161b60405f205416151590565b6040519015158152f35b346102db5760403660031901126102db576024356004355f526009602052610a0160405f206124c8565b80519091906001600160a01b031615610a59575b6001600160601b0360208301511690818102918183041490151715610a54579051604080516001600160a01b0390921682526127109092046020820152f35b6124ed565b9050610a636124a2565b90610a15565b346102db575f3660031901126102db57610a8161244a565b600a5460ff8160a01c1615610ac85760ff60a01b1916600a556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b346102db5760403660031901126102db576001600160401b036004358181116102db57610b35903690600401610506565b916024359081116102db57610b4e903690600401610506565b9092610b5861244a565b818103610c5b5790914260a01b91905f5b828110610b7257005b610b7d8184846127f4565b35610b878161067b565b610b928287896127f4565b355f54918115610c5657610ba68284612e0d565b600191610bec60018060a01b0383169284831460e11b8a178417610bd2875f52600460205260405f2090565b556001600160a01b03165f90815260056020526040902090565b68010000000000000001820281540190558115610c51578301929180805b610c1f575b50505050906001915f5501610b69565b15610c40575b5f818484835f805160206132a48339815191528180a4610c0a565b80920191838303610c255780610c0f565b6130be565b6130af565b60405162461bcd60e51b81526020600482015260126024820152714d69736d617463686564206c656e6774687360701b6044820152606490fd5b346102db575f3660031901126102db5760206040516daaeb6d7670e522a718067333cd4e8152f35b610cc6366107d2565b6001600160a01b038381163381141594929085610ea1575b610ce6612799565b60405192610cf384611a5c565b5f9680888652610e93575b610d06612799565b610e85575b610d13612799565b610d1c83612bc5565b828282160361098457839188610d3d845f52600660205260405f2090815490565b610d566001600160a01b03881633908114908314171590565b610e50575b610d6486612d8f565b610e48575b50506001600160a01b038481165f90815260056020908152604080832080545f19019055928b1682528282208054600101905585825260049052209088169384929091600160e11b904260a01b851782179055811615610e03575b505f805160206132a48339815191528980a4156108e657833b610de5578480f35b610df2936105f093612ed8565b610dfe575f8080808480f35b6130cc565b60018401610e19815f52600460205260405f2090565b5415610e26575b50610dc4565b8a548114610e2057610e40905f52600460205260405f2090565b555f80610e20565b55885f610d69565b91509350610e786105f06109723361095d8960018060a01b03165f52600760205260405f2090565b61097f5785938a91610d5b565b610e8e336131ee565b610d0b565b610e9c336131ee565b610cfe565b610eaa336131ee565b610cde565b9181601f840112156102db578235916001600160401b0383116102db57602083818601950101116102db57565b346102db5760403660031901126102db576001600160401b036004358181116102db57610f0d903690600401610eaf565b916024358181116102db57610f26903690600401610eaf565b929091610f3161244a565b841161100e57610f4b84610f46600b546119f5565b612501565b5f90601f8511600114610f89576106e794915f9183610f7e575b50508160011b915f199060031b1c191617600b556126c1565b013590505f80610f65565b600b5f527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db991601f198616815b818110610ff657509160019391876106e7989410610fdd575b505050811b01600b556126c1565b01355f19600384901b60f8161c191690555f8080610fcf565b91936020600181928787013581550195019201610fb6565b611a2d565b346102db5761102136610536565b906040519180835260051b9060209182818501016040525b8081801561105e5761105590601f19809101938501013561316a565b90850152611039565b60408051868152875181880181905288880192820190885f5b8281106110845784840385f35b909192826080826110ce6001948a5162ffffff6060809260018060a01b0381511685526001600160401b036020820151166020860152604081015115156040860152015116910152565b01960191019492919094611077565b346102db576110eb36610536565b906110f461244a565b5f5b8281106110ff57005b61110a8184846127f4565b356111148161067b565b60018060a01b03165f52602060118152604060ff815f2054166111805750508061117661116961115061114b61117b9588886127f4565b612809565b6001600160a01b03165f90815260116020526040902090565b805460ff19166001179055565b6129b3565b6110f6565b60849250519062461bcd60e51b82526004820152602a60248201527f4174206c65617374206f6e65206f70657261746f7220697320616c7265616479604482015269081c195c9b5a5d1d195960b21b6064820152fd5b346102db575f3660031901126102db57602060ff600a5460a01c166040519015158152f35b346102db5760203660031901126102db5760206001600160a01b03611221600435612bc5565b16604051908152f35b346102db5760203660031901126102db57602061125160043561124c8161067b565b612b78565b604051908152f35b346102db575f806003193601126104b45761127261244a565b600a80546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b602090816040818301928281528551809452019301915f5b8281106112dc575050505090565b8351855293810193928101926001016112ce565b346102db5760403660031901126102db57600435602435611313828210156128f7565b81810391818311610a5457600192838101809111610a54576113349061296d565b91835f925b828111156113835750505061134d8161296d565b915f5b828110611365576040518061042b86826112b6565b8061137186928461299f565b5161137c828761299f565b5201611350565b6113a48160ff6001918060081c5f526010602052161b60405f205416151590565b6113b0575b8101611339565b928181856113bf83948961299f565b52019390506113a9565b346102db575f3660031901126102db576113e161244a565b6113e9612799565b600a805460ff60a01b1916600160a01b1790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602090a1005b346102db5760203660031901126102db576004356114478161067b565b5f8054906060928392801580159384611469575b6040518061042b88826112b6565b80919293949550916115b157859461148085612b78565b02958661149c575b505050505061042b91505f8080808061145b565b909192939450858411156115a8575b604090815195600197600593898201851b890181526114c861312d565b9186926114da6105f084830151151590565b611596575b50869a97929a50869888805b61150b575b5050505050505050505061042b925081525f80808080611488565b9a99989a15611576575b8a9b889b999a9b9061152686613181565b808601511561153d5750508989955b01949c6114eb565b959095518061156e575b508c878718891b1561155c575b508a90611535565b9b8b01808a1b909c018190528c611554565b95505f611547565b808414801561158d575b156115155788999a6114f0565b50818914611580565b516001600160a01b031692505f6114df565b945082946114ab565b6130ea565b346102db575f3660031901126102db57600a546040516001600160a01b039091168152602090f35b346102db5760403660031901126102db57600435602435611601828210156128f7565b81810391818311610a5457600192838101809111610a54576116229061296d565b91835f925b828111156116715750505061163b8161296d565b915f5b828110611653576040518061042b86826112b6565b8061165f86928461299f565b5161166a828761299f565b520161163e565b6116928160ff6001918060081c5f52600f602052161b60405f205416151590565b61169e575b8101611627565b928181856116ad83948961299f565b5201939050611697565b60206003198201126102db57600435906001600160401b0382116102db5761056091600401610eaf565b346102db576116ef366116b7565b6116f761244a565b6001600160401b03811161100e5761171981611714600d546119f5565b612571565b5f601f82116001146117515781925f92611746575b50505f19600383901b1c191660019190911b17600d55005b013590505f8061172e565b600d5f52601f198216927fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb591805b8581106117b55750836001951061179c575b505050811b01600d55005b01355f19600384901b60f8161c191690555f8080611791565b9092602060018192868601358155019401910161177f565b346102db575f806003193601126104b4576040519080600c546117ef816119f5565b8085529160019180831690811561048a57506001146118185761042b8561041f81870382611a77565b9250600c83527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c75b82841061185b57505050810160200161041f8261042b61040f565b80546020858701810191909152909301928101611840565b346102db576060806003193601126102db57600435906118928261067b565b602435906044358281808510156115b1575f908154809110156119ed575b5083946118bc87612b78565b8482100294856118d5575b6040518061042b89826112b6565b90848193949596975003868111156119e5575b506040968751966001986119066005958b8401871b8b01835261316a565b9186926119186105f084830151151590565b6119d3575b50869a97929a9888805b611948575b5050505050505050505061042b925081525f80808080806118c7565b9a99989a156119b3575b8a9b889b999a9b9061196386613181565b808601511561197a5750508989955b01949c611927565b95909551806119ab575b508c878718891b15611999575b508a90611972565b9b8b01808a1b909c018190528c611991565b95505f611984565b80841480156119ca575b156119525788999a61192c565b508189146119bd565b516001600160a01b031692505f61191d565b95505f6118e8565b92505f6118b0565b90600182811c92168015611a23575b6020831014611a0f57565b634e487b7160e01b5f52602260045260245ffd5b91607f1691611a04565b634e487b7160e01b5f52604160045260245ffd5b604081019081106001600160401b0382111761100e57604052565b602081019081106001600160401b0382111761100e57604052565b90601f801991011681019081106001600160401b0382111761100e57604052565b604051905f82600e5491611aab836119f5565b80835292600190818116908115611b325750600114611ad4575b50611ad292500383611a77565b565b600e5f90815291507fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b848310611b175750611ad293505081016020015f611ac5565b81935090816020925483858a01015201910190918592611afe565b905060209250611ad294915060ff191682840152151560051b8201015f611ac5565b346102db575f3660031901126102db5761042b611b6f611a98565b60405191829160208352602083019061039a565b346102db57611b91366116b7565b611b9961244a565b6001600160401b03811161100e57611bbb81611bb6600e546119f5565b6125e1565b5f601f8211600114611bf35781925f92611be8575b50505f19600383901b1c191660019190911b17600e55005b013590505f80611bd0565b600e5f52601f198216927fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd91805b858110611c5757508360019510611c3e575b505050811b01600e55005b01355f19600384901b60f8161c191690555f8080611c33565b90926020600181928686013581550194019101611c21565b801515036102db57565b346102db5760403660031901126102db57600435611c968161067b565b60243590611ca382611c6f565b611cac816131ee565b611cb4612799565b335f9081526007602090815260408083206001600160a01b038516845290915290209115159160ff1981541660ff841617905560405191825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b346102db57611d2c36610536565b90335f526020906011825260409160ff835f2054168015611e10575b611d519061285f565b5f5b848110611d5c57005b611d6a6105d28287866127f4565b15611db85780611d86611d8060019388876127f4565b35612f8f565b611db2611d948288876127f4565b358060081c5f526010602052600160ff60405f2092161b8154179055565b01611d53565b835162461bcd60e51b815260048101839052602b60248201527f546f6b656e206d757374206265206c6f636b6564206265666f7265206275726e60448201526a17b932b232b6b83a34b7b760a91b6064820152608490fd5b50600a546001600160a01b03163314611d48565b60405190611ad282611a41565b6001600160401b03811161100e57601f01601f191660200190565b60803660031901126102db57600435611e648161067b565b602435611e708161067b565b606435916001600160401b0383116102db57366023840112156102db57826004013591611e9c83611e31565b92611eaa6040519485611a77565b80845236602482870101116102db576020815f9260246106e798018388013785010152604435916129c1565b346102db5760203660031901126102db5760206109cd60043560ff6001918060081c5f526010602052161b60405f205416151590565b346102db5760403660031901126102db57600435611f298161067b565b602435906001600160601b0382168083036102db5761271090611f4a61244a565b11611fbc576106e791611f9590611f6b6001600160a01b0384161515612813565b611f85611f76611e24565b6001600160a01b039094168452565b6001600160601b03166020830152565b805160209091015160a01b6001600160a01b0319166001600160a01b039190911617600855565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b346102db5760203660031901126102db57608061203260043561316a565b612075604051809262ffffff6060809260018060a01b0381511685526001600160401b036020820151166020860152604081015115156040860152015116910152565bf35b346102db5760203660031901126102db5760043561209481612cdd565b1561212f576120a1611a98565b80515f9015612115575060405160a0810160405260808101925f8452925b5f190192600a9060308282060185530492836120bf5761042b93506121039261210961041f936080601f199485810192030181526040519586936020850190612bae565b90612bae565b03908101835282611a77565b60405161042b9350915061212882611a5c565b815261041f565b630a14c4b560e41b5f5260045ffd5b346102db5761214c36610536565b5f9133835260206011815260ff6040938185872054168015612203575b6121729061285f565b855b81811061217f578680f35b61218d6105d28284886127f4565b156121bf57806121a060019284886127f4565b358060081c8952600f86528285898b2092161b19815416905501612174565b855162461bcd60e51b815260048101859052601960248201527f546f6b656e20697320616c726561647920756e6c6f636b6564000000000000006044820152606490fd5b50600a546001600160a01b03163314612169565b346102db575f806003193601126104b4576040519080600d54612239816119f5565b8085529160019180831690811561048a57506001146122625761042b8561041f81870382611a77565b9250600d83527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b8284106122a557505050810160200161041f8261042b61040f565b8054602085870181019190915290930192810161228a565b346102db5760403660031901126102db57602060ff6123156004356122e18161067b565b602435906122ee8261067b565b60018060a01b03165f526007845260405f209060018060a01b03165f5260205260405f2090565b54166040519015158152f35b346102db5761232f36610536565b61233761244a565b5f5b81811061234257005b8061235161237e9284866127f4565b3561235b8161067b565b6001600160a01b03165f908152601160205260409020805460ff191690556129b3565b612339565b346102db5760203660031901126102db576004356123a08161067b565b6123a861244a565b6001600160a01b039081169081156123f657600a54826001600160601b0360a01b821617600a55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b600a546001600160a01b0316330361245e57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b604051906124af82611a41565b6008546001600160a01b038116835260a01c6020830152565b906040516124d581611a41565b91546001600160a01b038116835260a01c6020830152565b634e487b7160e01b5f52601160045260245ffd5b601f811161250d575050565b5f90600b82527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9906020601f850160051c83019410612567575b601f0160051c01915b82811061255c57505050565b818155600101612550565b9092508290612547565b601f811161257d575050565b5f90600d82527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906020601f850160051c830194106125d7575b601f0160051c01915b8281106125cc57505050565b8181556001016125c0565b90925082906125b7565b601f81116125ed575050565b5f90600e82527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd906020601f850160051c83019410612647575b601f0160051c01915b82811061263c57505050565b818155600101612630565b9092508290612627565b601f811161265d575050565b5f90600c82527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7906020601f850160051c830194106126b7575b601f0160051c01915b8281106126ac57505050565b8181556001016126a0565b9092508290612697565b91906001600160401b03811161100e576126e5816126e0600c546119f5565b612651565b5f601f821160011461271c578192935f92612711575b50508160011b915f199060031b1c191617600c55565b013590505f806126fb565b600c5f52601f198216937fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c791805b8681106127815750836001959610612768575b505050811b01600c55565b01355f19600384901b60f8161c191690555f808061275d565b9092602060018192868601358155019401910161274a565b60ff600a5460a01c166127a857565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b634e487b7160e01b5f52603260045260245ffd5b91908110156128045760051b0190565b6127e0565b356103d08161067b565b1561281a57565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b1561286657565b60405162461bcd60e51b815260206004820152601860248201527f4e6f742061207065726d6974746564206f70657261746f7200000000000000006044820152606490fd5b156128b257565b60405162461bcd60e51b815260206004820152601760248201527f546f6b656e20697320616c7265616479206c6f636b65640000000000000000006044820152606490fd5b156128fe57565b60405162461bcd60e51b815260206004820152602a60248201527f456e64206d7573742062652067726561746572207468616e206f7220657175616044820152691b081d1bc81cdd185c9d60b21b6064820152608490fd5b6001600160401b03811161100e5760051b60200190565b9061297782612956565b6129846040519182611a77565b8281528092612995601f1991612956565b0190602036910137565b80518210156128045760209160051b010190565b5f198114610a545760010190565b909290916001600160a01b03808416903382141580612b6a575b6129e3612799565b612b5c575b6129f0612799565b6129f983612bc5565b8282821603610984578391612a19835f52600660205260405f2090815490565b612a326001600160a01b03871633908114908314171590565b612b2b575b612a4085612d8f565b612b22575b506001600160a01b038481165f90815260056020908152604080832080545f19019055928b1682528282208054600101905585825260049052209088169384929091600160e11b904260a01b851782179055811615612add575b505f805160206132a48339815191525f80a4156108e657833b612ac3575b50505050565b612ad0936105f093612ed8565b610dfe575f808080612abd565b60018401612af3815f52600460205260405f2090565b5415612b00575b50612a9f565b5f548114612afa57612b1a905f52600460205260405f2090565b555f80612afa565b5f90555f612a45565b9350612b516105f06109723361095d8960018060a01b03165f52600760205260405f2090565b61097f578593612a37565b612b65336131ee565b6129e8565b612b73336131ee565b6129db565b6001600160a01b03168015612b9f575f5260056020526001600160401b0360405f20541690565b6323d3ad8160e21b5f5260045ffd5b90612bc160209282815194859201610379565b0190565b612bd7815f52600460205260405f2090565b54908115612bee5750600160e01b81166130db5790565b90505f908154811015612c3c575b5f19015f81815260046020526040902054908115612c355750600160e01b811615612c3057636f96cda160e11b8252600482fd5b905090565b9050612bfc565b636f96cda160e11b8252600482fd5b6001600160a01b0380612c5d84612bc5565b1690813303612cae575b835f52600660205260405f20921691826001600160601b0360a01b8254161790557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9255f80a4565b5f82815260076020908152604080832033845290915290205460ff16612c67576367d9dca160e11b5f5260045ffd5b905f915f80548210612ced575050565b92505b8083526004602052604083205480612d1157508015610a54575f1901612cf0565b600160e01b1615925050565b15612d2457565b60405162461bcd60e51b815260206004820152603760248201527f4174206c65617374206f6e6520746f6b656e206973206c6f636b656420616e6460448201527f2063616e6e6f74206265207472616e736665727265642e0000000000000000006064820152608490fd5b805b600182018110612d9f575050565b600181612dc4829360ff6001918060081c5f52600f602052161b60405f205416151590565b612dd1575b019050612d91565b60ff60405f33815260116020522054168015612df6575b612df190612d1d565b612dc9565b50612df1828060a01b03600a541633149050612de8565b90815b8183018110612e1e57505050565b80612e4260019260ff6001918060081c5f52600f602052161b60405f205416151590565b612e4d575b01612e10565b60ff60405f33815260116020522054168015612e72575b612e6d90612d1d565b612e47565b50612e6d828060a01b03600a541633149050612e64565b908160209103126102db57516103d0816102c9565b6040513d5f823e3d90fd5b3d15612ed3573d90612eba82611e31565b91612ec86040519384611a77565b82523d5f602084013e565b606090565b604051630a85bd0160e11b8082523360048301526001600160a01b03928316602483015260448201949094526080606482015292936020928492909183915f918390612f2890608483019061039a565b0393165af15f9181612f5f575b50612f5157612f42612ea9565b805115610dfe57805190602001fd5b6001600160e01b0319161490565b612f8191925060203d8111612f88575b612f798183611a77565b810190612e89565b905f612f35565b503d612f6f565b5f612f9982612bc5565b5f83815260066020526040902080546001600160a01b038316929190612fbe86612d8f565b61307a575b506001600160a01b0382165f90815260056020526040902080546fffffffffffffffffffffffffffffffff0190555f8481526004602052604090204260a01b8317600360e01b179055600160e11b811615613035575b505f805160206132a48339815191528280a46001805401600155565b6001840161304b815f52600460205260405f2090565b5415613058575b50613019565b8354811461305257613072905f52600460205260405f2090565b555f80613052565b8390555f612fc3565b62a1148160e81b5f5260045ffd5b632ce44b5f60e11b5f5260045ffd5b633a954ecd60e21b5f5260045ffd5b63b562e8dd60e01b5f5260045ffd5b622e076360e81b5f5260045ffd5b6368d2bf6b60e11b5f5260045ffd5b636f96cda160e11b5f5260045ffd5b631960ccad60e11b5f5260045ffd5b60405190608082018281106001600160401b0382111761100e576040525f6060838281528260208201528260408201520152565b5f90816131386130f9565b928054613143575050565b92505b8083526004602052604083205461315f575f1901613146565b6103d0919250613181565b906131736130f9565b915f80548210613143575050565b6131896130f9565b505f52600460205260405f205461319e6130f9565b6001600160a01b038216815260a082901c6001600160401b03166020820152600160e01b82161515604082015260e89190911c606082015290565b908160209103126102db57516103d081611c6f565b6daaeb6d7670e522a718067333cd4e803b613207575050565b604051633185c44d60e21b81523060048201526001600160a01b038316602482015290602090829060449082905afa90811561329e575f91613270575b501561324d5750565b604051633b79c77360e21b81526001600160a01b03919091166004820152602490fd5b613291915060203d8111613297575b6132898183611a77565b8101906131d9565b5f613244565b503d61327f565b612e9e56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204753842bb1ef1b52cd6f5a2f0b26ea4b2c5470c8c77b2de101c9cf53e743c80864736f6c63430008140033405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acedf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7bb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fdd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db900000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000d86bdd298defc36d562effd56115cf6c59c4c8900000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000001461646964617320476f6c64656e205469636b6574000000000000000000000000000000000000000000000000000000000000000000000000000000000000000541444947540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b726569626235726e6d7a6262687a626a65777573326469797a74796e71636d7432356270343273777166753375623537326436726978340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656968356f677961716374747664653678777972627473777436676e34747673666277367173326e676e6d357661636c647a6e6d62712f0000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f3560e01c806301ffc9a7146102c457806306fdde03146102bf578063081812fc146102ba578063084b731a146102b5578063095ea7b3146102b057806317eb66c7146102ab57806318160ddd146102a657806323b872dd146102a1578063276a28a31461029c5780632a55205a146102975780633f4ba83a146102925780634029a3ce1461028d57806341f434341461028857806342842e0e146102835780635a4462151461027e5780635bbb2177146102795780635c5fd91c146102745780635c975abb1461026f5780636352211e1461026a57806370a0823114610265578063715018a614610260578063793577c91461025b5780638456cb59146102565780638462151c146102515780638da5cb5b1461024c5780638ff30c4914610247578063938e3d7b1461024257806395d89b411461023d57806399a2557a146102385780639abc832014610233578063a0bcfc7f1461022e578063a22cb46514610229578063aed7310d14610224578063b88d4fde1461021f578063be7d23661461021a578063c21b471b14610215578063c23dc68f14610210578063c87b56dd1461020b578063cbd5d40314610206578063e8a3d48514610201578063e985e9c5146101fc578063f15f32cb146101f75763f2fde38b146101f2575f80fd5b612383565b612321565b6122bd565b612217565b61213e565b612077565b612014565b611f0c565b611ed6565b611e4c565b611d1e565b611c79565b611b83565b611b54565b611873565b6117cd565b6116e1565b6115de565b6115b6565b61142a565b6113c9565b6112f0565b611259565b61122a565b6111fb565b6111d6565b6110dd565b611013565b610edc565b610cbd565b610c95565b610b04565b610a69565b6109d7565b610997565b6107fe565b6107b1565b610771565b61068c565b610564565b6104b7565b6103d3565b6102df565b6001600160e01b03198116036102db57565b5f80fd5b346102db5760203660031901126102db5760206004356102fe816102c9565b63ffffffff60e01b166301ffc9a760e01b81149081908215610368575b8215610357575b8215610335575b50506040519015158152f35b63152a902d60e11b149150811561034f575b505f80610329565b90505f610347565b635b5e139f60e01b81149250610322565b6380ac58cd60e01b8114925061031b565b5f5b83811061038a5750505f910152565b818101518382015260200161037b565b906020916103b381518092818552858086019101610379565b601f01601f1916010190565b9060206103d092818152019061039a565b90565b346102db575f806003193601126104b4576040519080600b546103f5816119f5565b8085529160019180831690811561048a575060011461042f575b61042b8561041f81870382611a77565b604051918291826103bf565b0390f35b9250600b83527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db95b82841061047257505050810160200161041f8261042b61040f565b80546020858701810191909152909301928101610457565b86955061042b9693506020925061041f94915060ff191682840152151560051b820101929361040f565b80fd5b346102db5760203660031901126102db576004356104d481612cdd565b156104f7575f526006602052602060018060a01b0360405f205416604051908152f35b6333d1c03960e21b5f5260045ffd5b9181601f840112156102db578235916001600160401b0383116102db576020808501948460051b0101116102db57565b60206003198201126102db57600435906001600160401b0382116102db5761056091600401610506565b9091565b346102db5761057236610536565b90335f526020906011825260409160ff835f2054168015610667575b6105979061285f565b5f5b8481106105a257005b6105b66105b08287866127f4565b35612cdd565b1561062b57806105f96105f46105f06105d26001958a896127f4565b3560ff6001918060081c5f52600f602052161b60405f205416151590565b1590565b6128ab565b6106256106078288876127f4565b358060081c5f52600f602052600160ff60405f2092161b8154179055565b01610599565b835162461bcd60e51b81526004810183905260156024820152742a37b5b2b7103237b2b9903737ba1032bc34b9ba1760591b6044820152606490fd5b50600a546001600160a01b0316331461058e565b6001600160a01b038116036102db57565b60403660031901126102db576004356106a48161067b565b6024356106b0826131ee565b6106b8612799565b6106d98160ff6001918060081c5f52600f602052161b60405f205416151590565b6106e9575b6106e791612c4b565b005b335f52601160205260ff60405f205416801561075d575b6106de5760405162461bcd60e51b815260206004820152602b60248201527f546f6b656e206d757374206e6f74206265206c6f636b656420746f206772616e60448201526a3a1030b8383937bb30b61760a91b6064820152608490fd5b50600a546001600160a01b03163314610700565b346102db5760203660031901126102db5760043561078e8161067b565b60018060a01b03165f526011602052602060ff60405f2054166040519015158152f35b346102db575f3660031901126102db5760205f546001549003604051908152f35b60609060031901126102db576004356107ea8161067b565b906024356107f78161067b565b9060443590565b610807366107d2565b6001600160a01b0392831692909190338403610989575b610826612799565b61082f83612bc5565b918482841603610984575f84815260066020526040902080546108616001600160a01b03881633908114908314171590565b610939575b61086f86612d8f565b610930575b506001600160a01b038581165f90815260056020908152604080832080545f19019055928416825282822080546001019055868252600490522091169384929091600160e11b904260a01b8517821790558116156108eb575b505f805160206132a48339815191525f80a4156108e657005b6130a0565b60018401610901815f52600460205260405f2090565b541561090e575b506108cd565b5f54811461090857610928905f52600460205260405f2090565b555f80610908565b5f90555f610874565b6109796105f06109723361095d8b60018060a01b03165f52600760205260405f2090565b9060018060a01b03165f5260205260405f2090565b5460ff1690565b15610866575b613091565b613083565b610992336131ee565b61081e565b346102db5760203660031901126102db5760206109cd60043560ff6001918060081c5f52600f602052161b60405f205416151590565b6040519015158152f35b346102db5760403660031901126102db576024356004355f526009602052610a0160405f206124c8565b80519091906001600160a01b031615610a59575b6001600160601b0360208301511690818102918183041490151715610a54579051604080516001600160a01b0390921682526127109092046020820152f35b6124ed565b9050610a636124a2565b90610a15565b346102db575f3660031901126102db57610a8161244a565b600a5460ff8160a01c1615610ac85760ff60a01b1916600a556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b346102db5760403660031901126102db576001600160401b036004358181116102db57610b35903690600401610506565b916024359081116102db57610b4e903690600401610506565b9092610b5861244a565b818103610c5b5790914260a01b91905f5b828110610b7257005b610b7d8184846127f4565b35610b878161067b565b610b928287896127f4565b355f54918115610c5657610ba68284612e0d565b600191610bec60018060a01b0383169284831460e11b8a178417610bd2875f52600460205260405f2090565b556001600160a01b03165f90815260056020526040902090565b68010000000000000001820281540190558115610c51578301929180805b610c1f575b50505050906001915f5501610b69565b15610c40575b5f818484835f805160206132a48339815191528180a4610c0a565b80920191838303610c255780610c0f565b6130be565b6130af565b60405162461bcd60e51b81526020600482015260126024820152714d69736d617463686564206c656e6774687360701b6044820152606490fd5b346102db575f3660031901126102db5760206040516daaeb6d7670e522a718067333cd4e8152f35b610cc6366107d2565b6001600160a01b038381163381141594929085610ea1575b610ce6612799565b60405192610cf384611a5c565b5f9680888652610e93575b610d06612799565b610e85575b610d13612799565b610d1c83612bc5565b828282160361098457839188610d3d845f52600660205260405f2090815490565b610d566001600160a01b03881633908114908314171590565b610e50575b610d6486612d8f565b610e48575b50506001600160a01b038481165f90815260056020908152604080832080545f19019055928b1682528282208054600101905585825260049052209088169384929091600160e11b904260a01b851782179055811615610e03575b505f805160206132a48339815191528980a4156108e657833b610de5578480f35b610df2936105f093612ed8565b610dfe575f8080808480f35b6130cc565b60018401610e19815f52600460205260405f2090565b5415610e26575b50610dc4565b8a548114610e2057610e40905f52600460205260405f2090565b555f80610e20565b55885f610d69565b91509350610e786105f06109723361095d8960018060a01b03165f52600760205260405f2090565b61097f5785938a91610d5b565b610e8e336131ee565b610d0b565b610e9c336131ee565b610cfe565b610eaa336131ee565b610cde565b9181601f840112156102db578235916001600160401b0383116102db57602083818601950101116102db57565b346102db5760403660031901126102db576001600160401b036004358181116102db57610f0d903690600401610eaf565b916024358181116102db57610f26903690600401610eaf565b929091610f3161244a565b841161100e57610f4b84610f46600b546119f5565b612501565b5f90601f8511600114610f89576106e794915f9183610f7e575b50508160011b915f199060031b1c191617600b556126c1565b013590505f80610f65565b600b5f527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db991601f198616815b818110610ff657509160019391876106e7989410610fdd575b505050811b01600b556126c1565b01355f19600384901b60f8161c191690555f8080610fcf565b91936020600181928787013581550195019201610fb6565b611a2d565b346102db5761102136610536565b906040519180835260051b9060209182818501016040525b8081801561105e5761105590601f19809101938501013561316a565b90850152611039565b60408051868152875181880181905288880192820190885f5b8281106110845784840385f35b909192826080826110ce6001948a5162ffffff6060809260018060a01b0381511685526001600160401b036020820151166020860152604081015115156040860152015116910152565b01960191019492919094611077565b346102db576110eb36610536565b906110f461244a565b5f5b8281106110ff57005b61110a8184846127f4565b356111148161067b565b60018060a01b03165f52602060118152604060ff815f2054166111805750508061117661116961115061114b61117b9588886127f4565b612809565b6001600160a01b03165f90815260116020526040902090565b805460ff19166001179055565b6129b3565b6110f6565b60849250519062461bcd60e51b82526004820152602a60248201527f4174206c65617374206f6e65206f70657261746f7220697320616c7265616479604482015269081c195c9b5a5d1d195960b21b6064820152fd5b346102db575f3660031901126102db57602060ff600a5460a01c166040519015158152f35b346102db5760203660031901126102db5760206001600160a01b03611221600435612bc5565b16604051908152f35b346102db5760203660031901126102db57602061125160043561124c8161067b565b612b78565b604051908152f35b346102db575f806003193601126104b45761127261244a565b600a80546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b602090816040818301928281528551809452019301915f5b8281106112dc575050505090565b8351855293810193928101926001016112ce565b346102db5760403660031901126102db57600435602435611313828210156128f7565b81810391818311610a5457600192838101809111610a54576113349061296d565b91835f925b828111156113835750505061134d8161296d565b915f5b828110611365576040518061042b86826112b6565b8061137186928461299f565b5161137c828761299f565b5201611350565b6113a48160ff6001918060081c5f526010602052161b60405f205416151590565b6113b0575b8101611339565b928181856113bf83948961299f565b52019390506113a9565b346102db575f3660031901126102db576113e161244a565b6113e9612799565b600a805460ff60a01b1916600160a01b1790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602090a1005b346102db5760203660031901126102db576004356114478161067b565b5f8054906060928392801580159384611469575b6040518061042b88826112b6565b80919293949550916115b157859461148085612b78565b02958661149c575b505050505061042b91505f8080808061145b565b909192939450858411156115a8575b604090815195600197600593898201851b890181526114c861312d565b9186926114da6105f084830151151590565b611596575b50869a97929a50869888805b61150b575b5050505050505050505061042b925081525f80808080611488565b9a99989a15611576575b8a9b889b999a9b9061152686613181565b808601511561153d5750508989955b01949c6114eb565b959095518061156e575b508c878718891b1561155c575b508a90611535565b9b8b01808a1b909c018190528c611554565b95505f611547565b808414801561158d575b156115155788999a6114f0565b50818914611580565b516001600160a01b031692505f6114df565b945082946114ab565b6130ea565b346102db575f3660031901126102db57600a546040516001600160a01b039091168152602090f35b346102db5760403660031901126102db57600435602435611601828210156128f7565b81810391818311610a5457600192838101809111610a54576116229061296d565b91835f925b828111156116715750505061163b8161296d565b915f5b828110611653576040518061042b86826112b6565b8061165f86928461299f565b5161166a828761299f565b520161163e565b6116928160ff6001918060081c5f52600f602052161b60405f205416151590565b61169e575b8101611627565b928181856116ad83948961299f565b5201939050611697565b60206003198201126102db57600435906001600160401b0382116102db5761056091600401610eaf565b346102db576116ef366116b7565b6116f761244a565b6001600160401b03811161100e5761171981611714600d546119f5565b612571565b5f601f82116001146117515781925f92611746575b50505f19600383901b1c191660019190911b17600d55005b013590505f8061172e565b600d5f52601f198216927fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb591805b8581106117b55750836001951061179c575b505050811b01600d55005b01355f19600384901b60f8161c191690555f8080611791565b9092602060018192868601358155019401910161177f565b346102db575f806003193601126104b4576040519080600c546117ef816119f5565b8085529160019180831690811561048a57506001146118185761042b8561041f81870382611a77565b9250600c83527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c75b82841061185b57505050810160200161041f8261042b61040f565b80546020858701810191909152909301928101611840565b346102db576060806003193601126102db57600435906118928261067b565b602435906044358281808510156115b1575f908154809110156119ed575b5083946118bc87612b78565b8482100294856118d5575b6040518061042b89826112b6565b90848193949596975003868111156119e5575b506040968751966001986119066005958b8401871b8b01835261316a565b9186926119186105f084830151151590565b6119d3575b50869a97929a9888805b611948575b5050505050505050505061042b925081525f80808080806118c7565b9a99989a156119b3575b8a9b889b999a9b9061196386613181565b808601511561197a5750508989955b01949c611927565b95909551806119ab575b508c878718891b15611999575b508a90611972565b9b8b01808a1b909c018190528c611991565b95505f611984565b80841480156119ca575b156119525788999a61192c565b508189146119bd565b516001600160a01b031692505f61191d565b95505f6118e8565b92505f6118b0565b90600182811c92168015611a23575b6020831014611a0f57565b634e487b7160e01b5f52602260045260245ffd5b91607f1691611a04565b634e487b7160e01b5f52604160045260245ffd5b604081019081106001600160401b0382111761100e57604052565b602081019081106001600160401b0382111761100e57604052565b90601f801991011681019081106001600160401b0382111761100e57604052565b604051905f82600e5491611aab836119f5565b80835292600190818116908115611b325750600114611ad4575b50611ad292500383611a77565b565b600e5f90815291507fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b848310611b175750611ad293505081016020015f611ac5565b81935090816020925483858a01015201910190918592611afe565b905060209250611ad294915060ff191682840152151560051b8201015f611ac5565b346102db575f3660031901126102db5761042b611b6f611a98565b60405191829160208352602083019061039a565b346102db57611b91366116b7565b611b9961244a565b6001600160401b03811161100e57611bbb81611bb6600e546119f5565b6125e1565b5f601f8211600114611bf35781925f92611be8575b50505f19600383901b1c191660019190911b17600e55005b013590505f80611bd0565b600e5f52601f198216927fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd91805b858110611c5757508360019510611c3e575b505050811b01600e55005b01355f19600384901b60f8161c191690555f8080611c33565b90926020600181928686013581550194019101611c21565b801515036102db57565b346102db5760403660031901126102db57600435611c968161067b565b60243590611ca382611c6f565b611cac816131ee565b611cb4612799565b335f9081526007602090815260408083206001600160a01b038516845290915290209115159160ff1981541660ff841617905560405191825260018060a01b0316907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b346102db57611d2c36610536565b90335f526020906011825260409160ff835f2054168015611e10575b611d519061285f565b5f5b848110611d5c57005b611d6a6105d28287866127f4565b15611db85780611d86611d8060019388876127f4565b35612f8f565b611db2611d948288876127f4565b358060081c5f526010602052600160ff60405f2092161b8154179055565b01611d53565b835162461bcd60e51b815260048101839052602b60248201527f546f6b656e206d757374206265206c6f636b6564206265666f7265206275726e60448201526a17b932b232b6b83a34b7b760a91b6064820152608490fd5b50600a546001600160a01b03163314611d48565b60405190611ad282611a41565b6001600160401b03811161100e57601f01601f191660200190565b60803660031901126102db57600435611e648161067b565b602435611e708161067b565b606435916001600160401b0383116102db57366023840112156102db57826004013591611e9c83611e31565b92611eaa6040519485611a77565b80845236602482870101116102db576020815f9260246106e798018388013785010152604435916129c1565b346102db5760203660031901126102db5760206109cd60043560ff6001918060081c5f526010602052161b60405f205416151590565b346102db5760403660031901126102db57600435611f298161067b565b602435906001600160601b0382168083036102db5761271090611f4a61244a565b11611fbc576106e791611f9590611f6b6001600160a01b0384161515612813565b611f85611f76611e24565b6001600160a01b039094168452565b6001600160601b03166020830152565b805160209091015160a01b6001600160a01b0319166001600160a01b039190911617600855565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b346102db5760203660031901126102db57608061203260043561316a565b612075604051809262ffffff6060809260018060a01b0381511685526001600160401b036020820151166020860152604081015115156040860152015116910152565bf35b346102db5760203660031901126102db5760043561209481612cdd565b1561212f576120a1611a98565b80515f9015612115575060405160a0810160405260808101925f8452925b5f190192600a9060308282060185530492836120bf5761042b93506121039261210961041f936080601f199485810192030181526040519586936020850190612bae565b90612bae565b03908101835282611a77565b60405161042b9350915061212882611a5c565b815261041f565b630a14c4b560e41b5f5260045ffd5b346102db5761214c36610536565b5f9133835260206011815260ff6040938185872054168015612203575b6121729061285f565b855b81811061217f578680f35b61218d6105d28284886127f4565b156121bf57806121a060019284886127f4565b358060081c8952600f86528285898b2092161b19815416905501612174565b855162461bcd60e51b815260048101859052601960248201527f546f6b656e20697320616c726561647920756e6c6f636b6564000000000000006044820152606490fd5b50600a546001600160a01b03163314612169565b346102db575f806003193601126104b4576040519080600d54612239816119f5565b8085529160019180831690811561048a57506001146122625761042b8561041f81870382611a77565b9250600d83527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b8284106122a557505050810160200161041f8261042b61040f565b8054602085870181019190915290930192810161228a565b346102db5760403660031901126102db57602060ff6123156004356122e18161067b565b602435906122ee8261067b565b60018060a01b03165f526007845260405f209060018060a01b03165f5260205260405f2090565b54166040519015158152f35b346102db5761232f36610536565b61233761244a565b5f5b81811061234257005b8061235161237e9284866127f4565b3561235b8161067b565b6001600160a01b03165f908152601160205260409020805460ff191690556129b3565b612339565b346102db5760203660031901126102db576004356123a08161067b565b6123a861244a565b6001600160a01b039081169081156123f657600a54826001600160601b0360a01b821617600a55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b600a546001600160a01b0316330361245e57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b604051906124af82611a41565b6008546001600160a01b038116835260a01c6020830152565b906040516124d581611a41565b91546001600160a01b038116835260a01c6020830152565b634e487b7160e01b5f52601160045260245ffd5b601f811161250d575050565b5f90600b82527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db9906020601f850160051c83019410612567575b601f0160051c01915b82811061255c57505050565b818155600101612550565b9092508290612547565b601f811161257d575050565b5f90600d82527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906020601f850160051c830194106125d7575b601f0160051c01915b8281106125cc57505050565b8181556001016125c0565b90925082906125b7565b601f81116125ed575050565b5f90600e82527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd906020601f850160051c83019410612647575b601f0160051c01915b82811061263c57505050565b818155600101612630565b9092508290612627565b601f811161265d575050565b5f90600c82527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7906020601f850160051c830194106126b7575b601f0160051c01915b8281106126ac57505050565b8181556001016126a0565b9092508290612697565b91906001600160401b03811161100e576126e5816126e0600c546119f5565b612651565b5f601f821160011461271c578192935f92612711575b50508160011b915f199060031b1c191617600c55565b013590505f806126fb565b600c5f52601f198216937fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c791805b8681106127815750836001959610612768575b505050811b01600c55565b01355f19600384901b60f8161c191690555f808061275d565b9092602060018192868601358155019401910161274a565b60ff600a5460a01c166127a857565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b634e487b7160e01b5f52603260045260245ffd5b91908110156128045760051b0190565b6127e0565b356103d08161067b565b1561281a57565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b1561286657565b60405162461bcd60e51b815260206004820152601860248201527f4e6f742061207065726d6974746564206f70657261746f7200000000000000006044820152606490fd5b156128b257565b60405162461bcd60e51b815260206004820152601760248201527f546f6b656e20697320616c7265616479206c6f636b65640000000000000000006044820152606490fd5b156128fe57565b60405162461bcd60e51b815260206004820152602a60248201527f456e64206d7573742062652067726561746572207468616e206f7220657175616044820152691b081d1bc81cdd185c9d60b21b6064820152608490fd5b6001600160401b03811161100e5760051b60200190565b9061297782612956565b6129846040519182611a77565b8281528092612995601f1991612956565b0190602036910137565b80518210156128045760209160051b010190565b5f198114610a545760010190565b909290916001600160a01b03808416903382141580612b6a575b6129e3612799565b612b5c575b6129f0612799565b6129f983612bc5565b8282821603610984578391612a19835f52600660205260405f2090815490565b612a326001600160a01b03871633908114908314171590565b612b2b575b612a4085612d8f565b612b22575b506001600160a01b038481165f90815260056020908152604080832080545f19019055928b1682528282208054600101905585825260049052209088169384929091600160e11b904260a01b851782179055811615612add575b505f805160206132a48339815191525f80a4156108e657833b612ac3575b50505050565b612ad0936105f093612ed8565b610dfe575f808080612abd565b60018401612af3815f52600460205260405f2090565b5415612b00575b50612a9f565b5f548114612afa57612b1a905f52600460205260405f2090565b555f80612afa565b5f90555f612a45565b9350612b516105f06109723361095d8960018060a01b03165f52600760205260405f2090565b61097f578593612a37565b612b65336131ee565b6129e8565b612b73336131ee565b6129db565b6001600160a01b03168015612b9f575f5260056020526001600160401b0360405f20541690565b6323d3ad8160e21b5f5260045ffd5b90612bc160209282815194859201610379565b0190565b612bd7815f52600460205260405f2090565b54908115612bee5750600160e01b81166130db5790565b90505f908154811015612c3c575b5f19015f81815260046020526040902054908115612c355750600160e01b811615612c3057636f96cda160e11b8252600482fd5b905090565b9050612bfc565b636f96cda160e11b8252600482fd5b6001600160a01b0380612c5d84612bc5565b1690813303612cae575b835f52600660205260405f20921691826001600160601b0360a01b8254161790557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9255f80a4565b5f82815260076020908152604080832033845290915290205460ff16612c67576367d9dca160e11b5f5260045ffd5b905f915f80548210612ced575050565b92505b8083526004602052604083205480612d1157508015610a54575f1901612cf0565b600160e01b1615925050565b15612d2457565b60405162461bcd60e51b815260206004820152603760248201527f4174206c65617374206f6e6520746f6b656e206973206c6f636b656420616e6460448201527f2063616e6e6f74206265207472616e736665727265642e0000000000000000006064820152608490fd5b805b600182018110612d9f575050565b600181612dc4829360ff6001918060081c5f52600f602052161b60405f205416151590565b612dd1575b019050612d91565b60ff60405f33815260116020522054168015612df6575b612df190612d1d565b612dc9565b50612df1828060a01b03600a541633149050612de8565b90815b8183018110612e1e57505050565b80612e4260019260ff6001918060081c5f52600f602052161b60405f205416151590565b612e4d575b01612e10565b60ff60405f33815260116020522054168015612e72575b612e6d90612d1d565b612e47565b50612e6d828060a01b03600a541633149050612e64565b908160209103126102db57516103d0816102c9565b6040513d5f823e3d90fd5b3d15612ed3573d90612eba82611e31565b91612ec86040519384611a77565b82523d5f602084013e565b606090565b604051630a85bd0160e11b8082523360048301526001600160a01b03928316602483015260448201949094526080606482015292936020928492909183915f918390612f2890608483019061039a565b0393165af15f9181612f5f575b50612f5157612f42612ea9565b805115610dfe57805190602001fd5b6001600160e01b0319161490565b612f8191925060203d8111612f88575b612f798183611a77565b810190612e89565b905f612f35565b503d612f6f565b5f612f9982612bc5565b5f83815260066020526040902080546001600160a01b038316929190612fbe86612d8f565b61307a575b506001600160a01b0382165f90815260056020526040902080546fffffffffffffffffffffffffffffffff0190555f8481526004602052604090204260a01b8317600360e01b179055600160e11b811615613035575b505f805160206132a48339815191528280a46001805401600155565b6001840161304b815f52600460205260405f2090565b5415613058575b50613019565b8354811461305257613072905f52600460205260405f2090565b555f80613052565b8390555f612fc3565b62a1148160e81b5f5260045ffd5b632ce44b5f60e11b5f5260045ffd5b633a954ecd60e21b5f5260045ffd5b63b562e8dd60e01b5f5260045ffd5b622e076360e81b5f5260045ffd5b6368d2bf6b60e11b5f5260045ffd5b636f96cda160e11b5f5260045ffd5b631960ccad60e11b5f5260045ffd5b60405190608082018281106001600160401b0382111761100e576040525f6060838281528260208201528260408201520152565b5f90816131386130f9565b928054613143575050565b92505b8083526004602052604083205461315f575f1901613146565b6103d0919250613181565b906131736130f9565b915f80548210613143575050565b6131896130f9565b505f52600460205260405f205461319e6130f9565b6001600160a01b038216815260a082901c6001600160401b03166020820152600160e01b82161515604082015260e89190911c606082015290565b908160209103126102db57516103d081611c6f565b6daaeb6d7670e522a718067333cd4e803b613207575050565b604051633185c44d60e21b81523060048201526001600160a01b038316602482015290602090829060449082905afa90811561329e575f91613270575b501561324d5750565b604051633b79c77360e21b81526001600160a01b03919091166004820152602490fd5b613291915060203d8111613297575b6132898183611a77565b8101906131d9565b5f613244565b503d61327f565b612e9e56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212204753842bb1ef1b52cd6f5a2f0b26ea4b2c5470c8c77b2de101c9cf53e743c80864736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000d86bdd298defc36d562effd56115cf6c59c4c8900000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000001461646964617320476f6c64656e205469636b6574000000000000000000000000000000000000000000000000000000000000000000000000000000000000000541444947540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b726569626235726e6d7a6262687a626a65777573326469797a74796e71636d7432356270343273777166753375623537326436726978340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656968356f677961716374747664653678777972627473777436676e34747673666277367173326e676e6d357661636c647a6e6d62712f0000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : __name (string): adidas Golden Ticket
Arg [1] : __symbol (string): ADIGT
Arg [2] : __contractUri (string): ipfs://bafkreibb5rnmzbbhzbjewus2diyztynqcmt25bp42swqfu3ub572d6rix4
Arg [3] : _baseUri (string): ipfs://bafybeih5ogyaqcttvde6xwyrbtswt6gn4tvsfbw6qs2ngnm5vacldznmbq/
Arg [4] : recipient (address): 0x0d86bdD298DEfC36d562eFFD56115Cf6c59c4c89
Arg [5] : value (uint96): 1000
-----Encoded View---------------
18 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [3] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [4] : 0000000000000000000000000d86bdd298defc36d562effd56115cf6c59c4c89
Arg [5] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000014
Arg [7] : 61646964617320476f6c64656e205469636b6574000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [9] : 4144494754000000000000000000000000000000000000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000042
Arg [11] : 697066733a2f2f6261666b726569626235726e6d7a6262687a626a6577757332
Arg [12] : 6469797a74796e71636d74323562703432737771667533756235373264367269
Arg [13] : 7834000000000000000000000000000000000000000000000000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [15] : 697066733a2f2f6261667962656968356f677961716374747664653678777972
Arg [16] : 627473777436676e34747673666277367173326e676e6d357661636c647a6e6d
Arg [17] : 62712f0000000000000000000000000000000000000000000000000000000000
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.