Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
979 ESOUL
Holders
410
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
0 ESOULLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
NFTContract
Compiler Version
v0.8.23+commit.f704f362
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.23; import "solady/src/utils/ECDSA.sol"; import "solady/src/tokens/ERC2981.sol"; import {ERC721A} from "erc721a/contracts/ERC721A.sol"; import {SharesDistributor} from "./SharesDistributor.sol"; contract NFTContract is ERC721A, ERC2981, SharesDistributor { using ECDSA for bytes32; error CannotUpdateFrozenURI(); error CollectionSoldOut(); error NotPresale(); error MaxPhaseMints(); error NotWhitelisted(); error NotSale(); error MintPaused(); error IncorrectETHValue(); struct SaleConf { uint64 presale1Start; uint64 presale2Start; uint64 saleStart; uint64 presale1Price; uint64 presale2Price; uint64 salePrice; uint8 maxMintsPresale1; uint8 maxMintsPresale2; uint8 maxMintsSale; bool mintPaused; } uint256 private constant _MAX_MINT_MASK = 0xffffffff; uint256 private constant _MAX_MINT_SIZE = 0x20; // TODO address private constant _PRESALE_AUTHORITY = 0x09B49f49767f44908ccD4c1F9A154DE3b30066d3; uint256 private constant _MINT_SUPPLY = 6000; SaleConf public conf; bool public frozenURI; // Metadata data string public hiddenURI = "ipfs://QmchFJ68tvPnXj52NXn9oT5AvHbg8y84WXkxYeze6GeQ26"; string public baseURI; event SaleConfUpdated(SaleConf newConf); event FrozenURI(); event HiddenURIUpdated(string uri); event BaseURIUpdated(string uri); // TODO constructor() payable ERC721A("EternalSoul", "ESOUL") { _setDefaultRoyalty(address(this), 550); conf = SaleConf( 1702818000, 1702823400, 1702827000, 0.015 ether, 0.015 ether, 0.016 ether, 2, 3, 5, false ); _mint(msg.sender, 100); } function setDefaultRoyalty(address _receiver, uint96 _feeNum) external { _checkOwner(); _setDefaultRoyalty(_receiver, _feeNum); } function setConf(SaleConf calldata newConf) external { _checkOwner(); conf = newConf; emit SaleConfUpdated(newConf); } function freezeURI() external { _checkOwner(); if (!frozenURI) { frozenURI = true; emit FrozenURI(); } } function setBaseURI(string calldata uri) external { _checkOwner(); if (frozenURI) _revert(CannotUpdateFrozenURI.selector); baseURI = uri; emit BaseURIUpdated(uri); } function setHiddenURI(string calldata uri) external { _checkOwner(); hiddenURI = uri; emit HiddenURIUpdated(uri); } function ownerMint(uint256 amount, address to) external { _checkOwner(); if (isSoldOut(amount)) _revert(CollectionSoldOut.selector); _mint(to, amount); } function isSoldOut(uint256 nftWanted) public view returns (bool) { return _totalMinted() + nftWanted > _MINT_SUPPLY; } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721A, ERC2981) returns (bool) { return ERC721A.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); } function tokenURI( uint256 _nftId ) public view override returns (string memory) { if (!_exists(_nftId)) _revert(URIQueryForNonexistentToken.selector); string memory uri = baseURI; return bytes(uri).length > 0 ? string(abi.encodePacked(uri, _toString(_nftId), ".json")) : hiddenURI; } function burn(uint256 tokenId) public virtual { _burn(tokenId, true); } function totalMinted() external view returns (uint256) { return _totalMinted(); } function currentMints( address owner ) external view returns (uint256, uint256) { SaleConf memory cachedConf = conf; return _currentMints(cachedConf, owner); } function presaleMint( uint256 amount, bytes calldata signature ) external payable { if (isSoldOut(amount)) _revert(CollectionSoldOut.selector); SaleConf memory cConf = conf; if (cConf.mintPaused) _revert(MintPaused.selector); if ( block.timestamp < cConf.presale1Start || block.timestamp >= cConf.saleStart ) _revert(NotPresale.selector); bool isPhase1 = block.timestamp < cConf.presale2Start; // Phase 1 mints auth will be checked off signed data if ( _PRESALE_AUTHORITY != keccak256( abi.encodePacked(msg.sender, isPhase1) ).toEthSignedMessageHash().recover(signature) ) _revert(NotWhitelisted.selector); ( uint256 callerMints, uint256 maxPhase ) = _currentMints(cConf, msg.sender); // Below cannot overflow as it would already have occurred in isSoldOut // function which isn't using unchecked math unchecked { uint256 nextMints = callerMints + amount; if (nextMints > maxPhase) _revert(MaxPhaseMints.selector); uint256 expectedPrice; // No sstore if phase 1, mints will be based off _numberMinted if (!isPhase1) { _setAux(msg.sender, uint64(nextMints)); expectedPrice = cConf.presale2Price; } else { expectedPrice = cConf.presale1Price; } if (msg.value != expectedPrice * amount) _revert(IncorrectETHValue.selector); } _mint(msg.sender, amount); } function saleMint(uint256 amount) external payable { if (isSoldOut(amount)) _revert(CollectionSoldOut.selector); SaleConf memory cConf = conf; if (cConf.mintPaused) _revert(MintPaused.selector); if (block.timestamp < cConf.saleStart) _revert(NotSale.selector); // Here to avoid extra sload, we repeat the whole logic here uint64 aux = _getAux(msg.sender); uint256 callerMints = aux >> _MAX_MINT_SIZE; // Same for unchecked as presaleMint unchecked { uint256 nextMints = callerMints + amount; if (nextMints > cConf.maxMintsSale) _revert(MaxPhaseMints.selector); _setAux( msg.sender, uint64((nextMints << _MAX_MINT_SIZE) | (aux & _MAX_MINT_MASK)) ); if (msg.value != cConf.salePrice * amount) _revert(IncorrectETHValue.selector); } _mint(msg.sender, amount); } function _startTokenId() internal pure override returns (uint256) { return 1; } function _currentMints( SaleConf memory cConf, address owner ) private view returns (uint256, uint256) { // Presale phase 1 if (block.timestamp < cConf.presale2Start) return (_numberMinted(owner), cConf.maxMintsPresale1); // Presale phase 2 if (block.timestamp < cConf.saleStart) return ( _getAux(owner) & _MAX_MINT_MASK, cConf.maxMintsPresale2 ); // Else, sale phase return ( _getAux(owner) >> _MAX_MINT_SIZE, cConf.maxMintsSale ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import "solady/src/auth/Ownable.sol"; interface IERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 amount) external returns (bool); } interface IBlurPool { function withdraw(uint256 amount) external; } contract SharesDistributor is Ownable { error ZeroBalance(); error TransferFailed(); struct Part { address wallet; uint16 salesPart; uint16 royaltiesPart; } address private blurPool = 0x0000000000A39bb272e79075ade125fd351887Ac; Part[] public parts; mapping(address => bool) public callers; constructor() payable { _initializeOwner(msg.sender); parts.push(Part(0x1B6af8B8FbbEc3126909C7367F60c118FE8A1Fa8, 15, 30)); callers[0x1B6af8B8FbbEc3126909C7367F60c118FE8A1Fa8] = true; parts.push(Part(0xf542Ade0A6DB200a8001B3DFb344f42AB8485382, 23, 20)); parts.push(Part(0x2A56ff7364498249851821061cb33Bac9a9F51c0, 54, 50)); parts.push(Part(0xA7C1AE6d073f22E3F9576C6C431644E90530C74F, 7, 0)); parts.push(Part(0xC9fD9E362aAaaF8C2cbDFeBff2763d44630aA0f2, 1, 0)); } function setCaller(address addr, bool allow) external { _checkOwner(); callers[addr] = allow; } function setRoyaltiesPart(uint256 index, uint256 shares) external { _checkOwner(); parts[index].royaltiesPart = uint16(shares); } function setBlurPool(address addr) external { _checkOwner(); blurPool = addr; } function shareETHSalesPart() external { _checkCaller(); uint256 balance = address(this).balance; if (balance == 0) revert ZeroBalance(); for (uint256 i; i < parts.length;++i) { Part memory part = parts[i]; unchecked { if (part.salesPart > 0) { _withdraw( part.wallet, balance * part.salesPart / 100 ); } } } } function shareETHRoyaltiesPart() external { _checkCaller(); uint256 balance = address(this).balance; if (balance == 0) _revert(ZeroBalance.selector); for (uint256 i; i < parts.length;++i) { Part memory part = parts[i]; unchecked { if (part.royaltiesPart > 0) { _withdraw( part.wallet, balance * part.royaltiesPart / 100 ); } } } } function shareTokenRoyaltiesPart(address token) external { _checkCaller(); IERC20 tokenContract = IERC20(token); uint256 balance = tokenContract.balanceOf(address(this)); if (balance == 0) _revert(ZeroBalance.selector); for (uint256 i; i < parts.length;++i) { Part memory part = parts[i]; if (part.royaltiesPart > 0) { unchecked { if (!tokenContract.transfer( part.wallet, balance * part.royaltiesPart / 100 )) _revert(TransferFailed.selector); } } } } function withdrawFromBlurPool() external { address pool = blurPool; IBlurPool(pool).withdraw(IERC20(pool).balanceOf(address(this))); } function _withdraw(address _address, uint256 _amount) private { (bool success, ) = _address.call{value: _amount}(""); if (!success) _revert(TransferFailed.selector); } function _checkCaller() private view { if (!callers[msg.sender]) _revert(Unauthorized.selector); } function _revert(bytes4 errSel) internal pure { assembly { mstore(0x0, errSel) revert(0x0, 0x4) } } receive() external payable {} }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( bytes4 retval ) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitializedForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Simple ERC2981 NFT Royalty Standard implementation. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC2981.sol) /// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/common/ERC2981.sol) abstract contract ERC2981 { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The royalty fee numerator exceeds the fee denominator. error RoyaltyOverflow(); /// @dev The royalty receiver cannot be the zero address. error RoyaltyReceiverIsZeroAddress(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STORAGE */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The default royalty info is given by: /// ``` /// let packed := sload(_ERC2981_MASTER_SLOT_SEED) /// let receiver := shr(96, packed) /// let royaltyFraction := xor(packed, shl(96, receiver)) /// ``` /// /// The per token royalty info is given by. /// ``` /// mstore(0x00, tokenId) /// mstore(0x20, _ERC2981_MASTER_SLOT_SEED) /// let packed := sload(keccak256(0x00, 0x40)) /// let receiver := shr(96, packed) /// let royaltyFraction := xor(packed, shl(96, receiver)) /// ``` uint256 private constant _ERC2981_MASTER_SLOT_SEED = 0xaa4ec00224afccfdb7; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ERC2981 */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Checks that `_feeDenominator` is non-zero. constructor() { require(_feeDenominator() != 0, "Fee denominator cannot be zero."); } /// @dev Returns the denominator for the royalty amount. /// Defaults to 10000, which represents fees in basis points. /// Override this function to return a custom amount if needed. function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /// @dev Returns true if this contract implements the interface defined by `interfaceId`. /// See: https://eips.ethereum.org/EIPS/eip-165 /// This function call must use less than 30000 gas. function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) { /// @solidity memory-safe-assembly assembly { let s := shr(224, interfaceId) // ERC165: 0x01ffc9a7, ERC2981: 0x2a55205a. result := or(eq(s, 0x01ffc9a7), eq(s, 0x2a55205a)) } } /// @dev Returns the `receiver` and `royaltyAmount` for `tokenId` sold at `salePrice`. function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address receiver, uint256 royaltyAmount) { uint256 feeDenominator = _feeDenominator(); /// @solidity memory-safe-assembly assembly { mstore(0x00, tokenId) mstore(0x20, _ERC2981_MASTER_SLOT_SEED) let packed := sload(keccak256(0x00, 0x40)) receiver := shr(96, packed) if iszero(receiver) { packed := sload(mload(0x20)) receiver := shr(96, packed) } let x := salePrice let y := xor(packed, shl(96, receiver)) // `feeNumerator`. // Overflow check, equivalent to `require(y == 0 || x <= type(uint256).max / y)`. // Out-of-gas revert. Should not be triggered in practice, but included for safety. returndatacopy(returndatasize(), returndatasize(), mul(y, gt(x, div(not(0), y)))) royaltyAmount := div(mul(x, y), feeDenominator) } } /// @dev Sets the default royalty `receiver` and `feeNumerator`. /// /// Requirements: /// - `receiver` must not be the zero address. /// - `feeNumerator` must not be greater than the fee denominator. function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { uint256 feeDenominator = _feeDenominator(); /// @solidity memory-safe-assembly assembly { feeNumerator := shr(160, shl(160, feeNumerator)) if gt(feeNumerator, feeDenominator) { mstore(0x00, 0x350a88b3) // `RoyaltyOverflow()`. revert(0x1c, 0x04) } let packed := shl(96, receiver) if iszero(packed) { mstore(0x00, 0xb4457eaa) // `RoyaltyReceiverIsZeroAddress()`. revert(0x1c, 0x04) } sstore(_ERC2981_MASTER_SLOT_SEED, or(packed, feeNumerator)) } } /// @dev Sets the default royalty `receiver` and `feeNumerator` to zero. function _deleteDefaultRoyalty() internal virtual { /// @solidity memory-safe-assembly assembly { sstore(_ERC2981_MASTER_SLOT_SEED, 0) } } /// @dev Sets the royalty `receiver` and `feeNumerator` for `tokenId`. /// /// Requirements: /// - `receiver` must not be the zero address. /// - `feeNumerator` must not be greater than the fee denominator. function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { uint256 feeDenominator = _feeDenominator(); /// @solidity memory-safe-assembly assembly { feeNumerator := shr(160, shl(160, feeNumerator)) if gt(feeNumerator, feeDenominator) { mstore(0x00, 0x350a88b3) // `RoyaltyOverflow()`. revert(0x1c, 0x04) } let packed := shl(96, receiver) if iszero(packed) { mstore(0x00, 0xb4457eaa) // `RoyaltyReceiverIsZeroAddress()`. revert(0x1c, 0x04) } mstore(0x00, tokenId) mstore(0x20, _ERC2981_MASTER_SLOT_SEED) sstore(keccak256(0x00, 0x40), or(packed, feeNumerator)) } } /// @dev Sets the royalty `receiver` and `feeNumerator` for `tokenId` to zero. function _resetTokenRoyalty(uint256 tokenId) internal virtual { /// @solidity memory-safe-assembly assembly { mstore(0x00, tokenId) mstore(0x20, _ERC2981_MASTER_SLOT_SEED) sstore(keccak256(0x00, 0x40), 0) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Gas optimized ECDSA wrapper. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/ECDSA.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ECDSA.sol) /// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/ECDSA.sol) /// /// @dev Note: /// - The recovery functions use the ecrecover precompile (0x1). /// - As of Solady version 0.0.68, the `recover` variants will revert upon recovery failure. /// This is for more safety by default. /// Use the `tryRecover` variants if you need to get the zero address back /// upon recovery failure instead. /// - As of Solady version 0.0.134, all `bytes signature` variants accept both /// regular 65-byte `(r, s, v)` and EIP-2098 `(r, vs)` short form signatures. /// See: https://eips.ethereum.org/EIPS/eip-2098 /// This is for calldata efficiency on smart accounts prevalent on L2s. /// /// WARNING! Do NOT use signatures as unique identifiers: /// - Use a nonce in the digest to prevent replay attacks on the same contract. /// - Use EIP-712 for the digest to prevent replay attacks across different chains and contracts. /// EIP-712 also enables readable signing of typed data for better user safety. /// This implementation does NOT check if a signature is non-malleable. library ECDSA { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The signature is invalid. error InvalidSignature(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* RECOVERY OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Recovers the signer's address from a message digest `hash`, and the `signature`. function recover(bytes32 hash, bytes memory signature) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { result := 1 let m := mload(0x40) // Cache the free memory pointer. for {} 1 {} { mstore(0x00, hash) mstore(0x40, mload(add(signature, 0x20))) // `r`. if eq(mload(signature), 64) { let vs := mload(add(signature, 0x40)) mstore(0x20, add(shr(255, vs), 27)) // `v`. mstore(0x60, shr(1, shl(1, vs))) // `s`. break } if eq(mload(signature), 65) { mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`. mstore(0x60, mload(add(signature, 0x40))) // `s`. break } result := 0 break } result := mload( staticcall( gas(), // Amount of gas left for the transaction. result, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x01, // Start of output. 0x20 // Size of output. ) ) // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. if iszero(returndatasize()) { mstore(0x00, 0x8baa579f) // `InvalidSignature()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Recovers the signer's address from a message digest `hash`, and the `signature`. function recoverCalldata(bytes32 hash, bytes calldata signature) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { result := 1 let m := mload(0x40) // Cache the free memory pointer. mstore(0x00, hash) for {} 1 {} { if eq(signature.length, 64) { let vs := calldataload(add(signature.offset, 0x20)) mstore(0x20, add(shr(255, vs), 27)) // `v`. mstore(0x40, calldataload(signature.offset)) // `r`. mstore(0x60, shr(1, shl(1, vs))) // `s`. break } if eq(signature.length, 65) { mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`. calldatacopy(0x40, signature.offset, 0x40) // Copy `r` and `s`. break } result := 0 break } result := mload( staticcall( gas(), // Amount of gas left for the transaction. result, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x01, // Start of output. 0x20 // Size of output. ) ) // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. if iszero(returndatasize()) { mstore(0x00, 0x8baa579f) // `InvalidSignature()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Recovers the signer's address from a message digest `hash`, /// and the EIP-2098 short form signature defined by `r` and `vs`. function recover(bytes32 hash, bytes32 r, bytes32 vs) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x00, hash) mstore(0x20, add(shr(255, vs), 27)) // `v`. mstore(0x40, r) mstore(0x60, shr(1, shl(1, vs))) // `s`. result := mload( staticcall( gas(), // Amount of gas left for the transaction. 1, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x01, // Start of output. 0x20 // Size of output. ) ) // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. if iszero(returndatasize()) { mstore(0x00, 0x8baa579f) // `InvalidSignature()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Recovers the signer's address from a message digest `hash`, /// and the signature defined by `v`, `r`, `s`. function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x00, hash) mstore(0x20, and(v, 0xff)) mstore(0x40, r) mstore(0x60, s) result := mload( staticcall( gas(), // Amount of gas left for the transaction. 1, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x01, // Start of output. 0x20 // Size of output. ) ) // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. if iszero(returndatasize()) { mstore(0x00, 0x8baa579f) // `InvalidSignature()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot. mstore(0x40, m) // Restore the free memory pointer. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* TRY-RECOVER OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // WARNING! // These functions will NOT revert upon recovery failure. // Instead, they will return the zero address upon recovery failure. // It is critical that the returned address is NEVER compared against // a zero address (e.g. an uninitialized address variable). /// @dev Recovers the signer's address from a message digest `hash`, and the `signature`. function tryRecover(bytes32 hash, bytes memory signature) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { result := 1 let m := mload(0x40) // Cache the free memory pointer. for {} 1 {} { mstore(0x00, hash) mstore(0x40, mload(add(signature, 0x20))) // `r`. if eq(mload(signature), 64) { let vs := mload(add(signature, 0x40)) mstore(0x20, add(shr(255, vs), 27)) // `v`. mstore(0x60, shr(1, shl(1, vs))) // `s`. break } if eq(mload(signature), 65) { mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`. mstore(0x60, mload(add(signature, 0x40))) // `s`. break } result := 0 break } pop( staticcall( gas(), // Amount of gas left for the transaction. result, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x40, // Start of output. 0x20 // Size of output. ) ) mstore(0x60, 0) // Restore the zero slot. // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. result := mload(xor(0x60, returndatasize())) mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Recovers the signer's address from a message digest `hash`, and the `signature`. function tryRecoverCalldata(bytes32 hash, bytes calldata signature) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { result := 1 let m := mload(0x40) // Cache the free memory pointer. mstore(0x00, hash) for {} 1 {} { if eq(signature.length, 64) { let vs := calldataload(add(signature.offset, 0x20)) mstore(0x20, add(shr(255, vs), 27)) // `v`. mstore(0x40, calldataload(signature.offset)) // `r`. mstore(0x60, shr(1, shl(1, vs))) // `s`. break } if eq(signature.length, 65) { mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`. calldatacopy(0x40, signature.offset, 0x40) // Copy `r` and `s`. break } result := 0 break } pop( staticcall( gas(), // Amount of gas left for the transaction. result, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x40, // Start of output. 0x20 // Size of output. ) ) mstore(0x60, 0) // Restore the zero slot. // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. result := mload(xor(0x60, returndatasize())) mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Recovers the signer's address from a message digest `hash`, /// and the EIP-2098 short form signature defined by `r` and `vs`. function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x00, hash) mstore(0x20, add(shr(255, vs), 27)) // `v`. mstore(0x40, r) mstore(0x60, shr(1, shl(1, vs))) // `s`. pop( staticcall( gas(), // Amount of gas left for the transaction. 1, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x40, // Start of output. 0x20 // Size of output. ) ) mstore(0x60, 0) // Restore the zero slot. // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. result := mload(xor(0x60, returndatasize())) mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Recovers the signer's address from a message digest `hash`, /// and the signature defined by `v`, `r`, `s`. function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal view returns (address result) { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x00, hash) mstore(0x20, and(v, 0xff)) mstore(0x40, r) mstore(0x60, s) pop( staticcall( gas(), // Amount of gas left for the transaction. 1, // Address of `ecrecover`. 0x00, // Start of input. 0x80, // Size of input. 0x40, // Start of output. 0x20 // Size of output. ) ) mstore(0x60, 0) // Restore the zero slot. // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise. result := mload(xor(0x60, returndatasize())) mstore(0x40, m) // Restore the free memory pointer. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HASHING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns an Ethereum Signed Message, created from a `hash`. /// This produces a hash corresponding to the one signed with the /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign) /// JSON-RPC method as part of EIP-191. function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { mstore(0x20, hash) // Store into scratch space for keccak256. mstore(0x00, "\x00\x00\x00\x00\x19Ethereum Signed Message:\n32") // 28 bytes. result := keccak256(0x04, 0x3c) // `32 * 2 - (32 - 28) = 60 = 0x3c`. } } /// @dev Returns an Ethereum Signed Message, created from `s`. /// This produces a hash corresponding to the one signed with the /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign) /// JSON-RPC method as part of EIP-191. /// Note: Supports lengths of `s` up to 999999 bytes. function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { let sLength := mload(s) let o := 0x20 mstore(o, "\x19Ethereum Signed Message:\n") // 26 bytes, zero-right-padded. mstore(0x00, 0x00) // Convert the `s.length` to ASCII decimal representation: `base10(s.length)`. for { let temp := sLength } 1 {} { o := sub(o, 1) mstore8(o, add(48, mod(temp, 10))) temp := div(temp, 10) if iszero(temp) { break } } let n := sub(0x3a, o) // Header length: `26 + 32 - o`. // Throw an out-of-offset error (consumes all gas) if the header exceeds 32 bytes. returndatacopy(returndatasize(), returndatasize(), gt(n, 0x20)) mstore(s, or(mload(0x00), mload(n))) // Temporarily store the header. result := keccak256(add(s, sub(0x20, n)), add(n, sLength)) mstore(s, sLength) // Restore the length. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EMPTY CALLDATA HELPERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns an empty calldata bytes. function emptySignature() internal pure returns (bytes calldata signature) { /// @solidity memory-safe-assembly assembly { signature.length := 0 } } }
// 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.4; /// @notice Simple single owner authorization mixin. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol) /// /// @dev Note: /// This implementation does NOT auto-initialize the owner to `msg.sender`. /// You MUST call the `_initializeOwner` in the constructor / initializer. /// /// While the ownable portion follows /// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility, /// the nomenclature for the 2-step ownership handover may be unique to this codebase. abstract contract Ownable { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The caller is not authorized to call the function. error Unauthorized(); /// @dev The `newOwner` cannot be the zero address. error NewOwnerIsZeroAddress(); /// @dev The `pendingOwner` does not have a valid handover request. error NoHandoverRequest(); /// @dev Cannot double-initialize. error AlreadyInitialized(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EVENTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The ownership is transferred from `oldOwner` to `newOwner`. /// This event is intentionally kept the same as OpenZeppelin's Ownable to be /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173), /// despite it not being as lightweight as a single argument event. event OwnershipTransferred(address indexed oldOwner, address indexed newOwner); /// @dev An ownership handover to `pendingOwner` has been requested. event OwnershipHandoverRequested(address indexed pendingOwner); /// @dev The ownership handover to `pendingOwner` has been canceled. event OwnershipHandoverCanceled(address indexed pendingOwner); /// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`. uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE = 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0; /// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`. uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE = 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d; /// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`. uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE = 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STORAGE */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The owner slot is given by: /// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`. /// It is intentionally chosen to be a high value /// to avoid collision with lower slots. /// The choice of manual storage layout is to enable compatibility /// with both regular and upgradeable contracts. bytes32 internal constant _OWNER_SLOT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927; /// The ownership handover slot of `newOwner` is given by: /// ``` /// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED)) /// let handoverSlot := keccak256(0x00, 0x20) /// ``` /// It stores the expiry timestamp of the two-step ownership handover. uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* INTERNAL FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Override to return true to make `_initializeOwner` prevent double-initialization. function _guardInitializeOwner() internal pure virtual returns (bool guard) {} /// @dev Initializes the owner directly without authorization guard. /// This function must be called upon initialization, /// regardless of whether the contract is upgradeable or not. /// This is to enable generalization to both regular and upgradeable contracts, /// and to save gas in case the initial owner is not the caller. /// For performance reasons, this function will not check if there /// is an existing owner. function _initializeOwner(address newOwner) internal virtual { if (_guardInitializeOwner()) { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT if sload(ownerSlot) { mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`. revert(0x1c, 0x04) } // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Store the new value. sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner)))) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner) } } else { /// @solidity memory-safe-assembly assembly { // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Store the new value. sstore(_OWNER_SLOT, newOwner) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner) } } } /// @dev Sets the owner directly without authorization guard. function _setOwner(address newOwner) internal virtual { if (_guardInitializeOwner()) { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner) // Store the new value. sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner)))) } } else { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner) // Store the new value. sstore(ownerSlot, newOwner) } } } /// @dev Throws if the sender is not the owner. function _checkOwner() internal view virtual { /// @solidity memory-safe-assembly assembly { // If the caller is not the stored owner, revert. if iszero(eq(caller(), sload(_OWNER_SLOT))) { mstore(0x00, 0x82b42900) // `Unauthorized()`. revert(0x1c, 0x04) } } } /// @dev Returns how long a two-step ownership handover is valid for in seconds. /// Override to return a different value if needed. /// Made internal to conserve bytecode. Wrap it in a public function if needed. function _ownershipHandoverValidFor() internal view virtual returns (uint64) { return 48 * 3600; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC UPDATE FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Allows the owner to transfer the ownership to `newOwner`. function transferOwnership(address newOwner) public payable virtual onlyOwner { /// @solidity memory-safe-assembly assembly { if iszero(shl(96, newOwner)) { mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`. revert(0x1c, 0x04) } } _setOwner(newOwner); } /// @dev Allows the owner to renounce their ownership. function renounceOwnership() public payable virtual onlyOwner { _setOwner(address(0)); } /// @dev Request a two-step ownership handover to the caller. /// The request will automatically expire in 48 hours (172800 seconds) by default. function requestOwnershipHandover() public payable virtual { unchecked { uint256 expires = block.timestamp + _ownershipHandoverValidFor(); /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to `expires`. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, caller()) sstore(keccak256(0x0c, 0x20), expires) // Emit the {OwnershipHandoverRequested} event. log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller()) } } } /// @dev Cancels the two-step ownership handover to the caller, if any. function cancelOwnershipHandover() public payable virtual { /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to 0. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, caller()) sstore(keccak256(0x0c, 0x20), 0) // Emit the {OwnershipHandoverCanceled} event. log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller()) } } /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`. /// Reverts if there is no existing ownership handover requested by `pendingOwner`. function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner { /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to 0. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, pendingOwner) let handoverSlot := keccak256(0x0c, 0x20) // If the handover does not exist, or has expired. if gt(timestamp(), sload(handoverSlot)) { mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`. revert(0x1c, 0x04) } // Set the handover slot to 0. sstore(handoverSlot, 0) } _setOwner(pendingOwner); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC READ FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the owner of the contract. function owner() public view virtual returns (address result) { /// @solidity memory-safe-assembly assembly { result := sload(_OWNER_SLOT) } } /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`. function ownershipHandoverExpiresAt(address pendingOwner) public view virtual returns (uint256 result) { /// @solidity memory-safe-assembly assembly { // Compute the handover slot. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, pendingOwner) // Load the handover slot. result := sload(keccak256(0x0c, 0x20)) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* MODIFIERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Marks a function as only callable by the owner. modifier onlyOwner() virtual { _checkOwner(); _; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"payable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CannotUpdateFrozenURI","type":"error"},{"inputs":[],"name":"CollectionSoldOut","type":"error"},{"inputs":[],"name":"IncorrectETHValue","type":"error"},{"inputs":[],"name":"MaxPhaseMints","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintPaused","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"NotPresale","type":"error"},{"inputs":[],"name":"NotSale","type":"error"},{"inputs":[],"name":"NotWhitelisted","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"RoyaltyOverflow","type":"error"},{"inputs":[],"name":"RoyaltyReceiverIsZeroAddress","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ZeroBalance","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":false,"internalType":"string","name":"uri","type":"string"}],"name":"BaseURIUpdated","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":[],"name":"FrozenURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"HiddenURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint64","name":"presale1Start","type":"uint64"},{"internalType":"uint64","name":"presale2Start","type":"uint64"},{"internalType":"uint64","name":"saleStart","type":"uint64"},{"internalType":"uint64","name":"presale1Price","type":"uint64"},{"internalType":"uint64","name":"presale2Price","type":"uint64"},{"internalType":"uint64","name":"salePrice","type":"uint64"},{"internalType":"uint8","name":"maxMintsPresale1","type":"uint8"},{"internalType":"uint8","name":"maxMintsPresale2","type":"uint8"},{"internalType":"uint8","name":"maxMintsSale","type":"uint8"},{"internalType":"bool","name":"mintPaused","type":"bool"}],"indexed":false,"internalType":"struct NFTContract.SaleConf","name":"newConf","type":"tuple"}],"name":"SaleConfUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"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":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"callers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"conf","outputs":[{"internalType":"uint64","name":"presale1Start","type":"uint64"},{"internalType":"uint64","name":"presale2Start","type":"uint64"},{"internalType":"uint64","name":"saleStart","type":"uint64"},{"internalType":"uint64","name":"presale1Price","type":"uint64"},{"internalType":"uint64","name":"presale2Price","type":"uint64"},{"internalType":"uint64","name":"salePrice","type":"uint64"},{"internalType":"uint8","name":"maxMintsPresale1","type":"uint8"},{"internalType":"uint8","name":"maxMintsPresale2","type":"uint8"},{"internalType":"uint8","name":"maxMintsSale","type":"uint8"},{"internalType":"bool","name":"mintPaused","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"currentMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"frozenURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hiddenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"nftWanted","type":"uint256"}],"name":"isSoldOut","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"parts","outputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint16","name":"salesPart","type":"uint16"},{"internalType":"uint16","name":"royaltiesPart","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"presaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","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":"uint256","name":"amount","type":"uint256"}],"name":"saleMint","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":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setBlurPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"allow","type":"bool"}],"name":"setCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"presale1Start","type":"uint64"},{"internalType":"uint64","name":"presale2Start","type":"uint64"},{"internalType":"uint64","name":"saleStart","type":"uint64"},{"internalType":"uint64","name":"presale1Price","type":"uint64"},{"internalType":"uint64","name":"presale2Price","type":"uint64"},{"internalType":"uint64","name":"salePrice","type":"uint64"},{"internalType":"uint8","name":"maxMintsPresale1","type":"uint8"},{"internalType":"uint8","name":"maxMintsPresale2","type":"uint8"},{"internalType":"uint8","name":"maxMintsSale","type":"uint8"},{"internalType":"bool","name":"mintPaused","type":"bool"}],"internalType":"struct NFTContract.SaleConf","name":"newConf","type":"tuple"}],"name":"setConf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint96","name":"_feeNum","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setHiddenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"setRoyaltiesPart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shareETHRoyaltiesPart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shareETHSalesPart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"shareTokenRoyaltiesPart","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":"_nftId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMinted","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":"payable","type":"function"},{"inputs":[],"name":"withdrawFromBlurPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
600880546001600160a01b0319166ea39bb272e79075ade125fd351887ac17905560e06040526035608081815290620035b360a039600e9062000043908262000809565b506040518060400160405280600b81526020016a115d195c9b985b14dbdd5b60aa1b815250604051806040016040528060058152602001641154d3d55360da1b815250816002908162000097919062000809565b506003620000a6828262000809565b505060015f5550620000b83362000609565b60096040518060600160405280731b6af8b8fbbec3126909c7367f60c118fe8a1fa86001600160a01b03168152602001600f61ffff168152602001601e61ffff16815250908060018154018082558091505060019003905f5260205f20015f909190919091505f820151815f015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151815f0160146101000a81548161ffff021916908361ffff1602179055506040820151815f0160166101000a81548161ffff021916908361ffff16021790555050506001600a5f731b6af8b8fbbec3126909c7367f60c118fe8a1fa86001600160a01b03166001600160a01b031681526020019081526020015f205f6101000a81548160ff0219169083151502179055506009604051806060016040528073f542ade0a6db200a8001b3dfb344f42ab84853826001600160a01b03168152602001601761ffff168152602001601461ffff16815250908060018154018082558091505060019003905f5260205f20015f909190919091505f820151815f015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151815f0160146101000a81548161ffff021916908361ffff1602179055506040820151815f0160166101000a81548161ffff021916908361ffff160217905550505060096040518060600160405280732a56ff7364498249851821061cb33bac9a9f51c06001600160a01b03168152602001603661ffff168152602001603261ffff16815250908060018154018082558091505060019003905f5260205f20015f909190919091505f820151815f015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151815f0160146101000a81548161ffff021916908361ffff1602179055506040820151815f0160166101000a81548161ffff021916908361ffff16021790555050506009604051806060016040528073a7c1ae6d073f22e3f9576c6c431644e90530c74f6001600160a01b03168152602001600761ffff1681526020015f61ffff16815250908060018154018082558091505060019003905f5260205f20015f909190919091505f820151815f015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151815f0160146101000a81548161ffff021916908361ffff1602179055506040820151815f0160166101000a81548161ffff021916908361ffff16021790555050506009604051806060016040528073c9fd9e362aaaaf8c2cbdfebff2763d44630aa0f26001600160a01b03168152602001600161ffff1681526020015f61ffff16815250908060018154018082558091505060019003905f5260205f20015f909190919091505f820151815f015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151815f0160146101000a81548161ffff021916908361ffff1602179055506040820151815f0160166101000a81548161ffff021916908361ffff160217905550505062000547306102266200064460201b60201c565b604080516101408101825263657ef0d0815263657f05e8602082015263657f13f89181019190915266354a6ba7a180006060820181905260808201526638d7ea4c68000060a0820152600260c0820152600360e082015260056101008201525f610120909101527e354a6ba7a1800000000000657f13f800000000657f05e800000000657ef0d0600b55600c80546001600160a01b031916720503020038d7ea4c68000000354a6ba7a18000179055620006033360646200068f565b620008d5565b6001600160a01b0316638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b6001600160601b031661271080821115620006665763350a88b35f526004601cfd5b8260601b806200067d5763b4457eaa5f526004601cfd5b90911768aa4ec00224afccfdb7555050565b5f805490829003620006b45760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0383165f8181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083905f80516020620035938339815191528180a4600183015b8181146200073e5780835f5f80516020620035938339815191525f80a460010162000718565b50815f036200075f57604051622e076360e81b815260040160405180910390fd5b5f5550505050565b505050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200079557607f821691505b602082108103620007b457634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200076757805f5260205f20601f840160051c81016020851015620007e15750805b601f840160051c820191505b8181101562000802575f8155600101620007ed565b5050505050565b81516001600160401b038111156200082557620008256200076c565b6200083d8162000836845462000780565b84620007ba565b602080601f83116001811462000873575f84156200085b5750858301515b5f19600386901b1c1916600185901b178555620008cd565b5f85815260208120601f198616915b82811015620008a35788860151825594840194600190910190840162000882565b5085821015620008c157878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b612cb080620008e35f395ff3fe608060405260043610610283575f3560e01c80638da5cb5b11610155578063c793803c116100be578063e985e9c511610078578063e985e9c514610801578063f04e283e14610820578063f0ba9cb814610833578063f2fde38b14610852578063fd24a85414610865578063fee81cf414610878575f80fd5b8063c793803c14610719578063c87b56dd1461072d578063c9eb46621461074c578063cf0b913114610795578063d52c57e0146107ae578063e73dea67146107cd575f80fd5b80639e3437db1161010f5780639e3437db1461067f578063a22cb46514610693578063a2309ff8146106b2578063b88d4fde146106c8578063bbaac02f146106db578063bf9e9834146106fa575f80fd5b80638da5cb5b146105d757806395d89b41146105ef57806398e5209d146106035780639b58dfba146106225780639cae6eae146106415780639e30751e14610660575f80fd5b806342842e0e116101f75780636c0360eb116101b15780636c0360eb1461054757806370a082311461055b578063715018a61461057a5780637bbf4a3f146105825780638ca887ca146105b05780638cc54e7f146105c3575f80fd5b806342842e0e146104bb57806342966c68146104ce57806354d1f13d146104ed57806355f804b3146104f55780636352211e14610514578063688039b914610533575f80fd5b80631779272911610248578063177927291461034e57806318160ddd1461042a5780631ffa6c6c1461044e57806323b872dd1461046257806325692962146104755780632a55205a1461047d575f80fd5b806301ffc9a71461028e57806304634d8d146102c257806306fdde03146102e3578063081812fc14610304578063095ea7b31461033b575f80fd5b3661028a57005b5f80fd5b348015610299575f80fd5b506102ad6102a83660046122db565b6108a9565b60405190151581526020015b60405180910390f35b3480156102cd575f80fd5b506102e16102dc366004612311565b6108d7565b005b3480156102ee575f80fd5b506102f76108ed565b6040516102b991906123a3565b34801561030f575f80fd5b5061032361031e3660046123b5565b61097d565b6040516001600160a01b0390911681526020016102b9565b6102e16103493660046123cc565b6109bf565b348015610359575f80fd5b50600b54600c546103c3916001600160401b0380821692600160401b808404831693600160801b808204851694600160c01b9092048216938083169381049092169160ff918104821691600160881b8204811691600160901b8104821691600160981b909104168a565b604080516001600160401b039b8c168152998b1660208b0152978a169789019790975294881660608801529287166080870152951660a085015260ff94851660c0850152841660e084015292909216610100820152901515610120820152610140016102b9565b348015610435575f80fd5b506001545f54035f19015b6040519081526020016102b9565b348015610459575f80fd5b506102e1610a5d565b6102e16104703660046123f4565b610b22565b6102e1610ca8565b348015610488575f80fd5b5061049c61049736600461242d565b610cf4565b604080516001600160a01b0390931683526020830191909152016102b9565b6102e16104c93660046123f4565b610d47565b3480156104d9575f80fd5b506102e16104e83660046123b5565b610d66565b6102e1610d74565b348015610500575f80fd5b506102e161050f36600461248a565b610dad565b34801561051f575f80fd5b5061032361052e3660046123b5565b610e1b565b34801561053e575f80fd5b506102e1610e25565b348015610552575f80fd5b506102f7610ee0565b348015610566575f80fd5b506104406105753660046124c8565b610f6c565b6102e1610fb8565b34801561058d575f80fd5b506102ad61059c3660046124c8565b600a6020525f908152604090205460ff1681565b6102e16105be3660046123b5565b610fcb565b3480156105ce575f80fd5b506102f7611146565b3480156105e2575f80fd5b50638b78c6d81954610323565b3480156105fa575f80fd5b506102f7611153565b34801561060e575f80fd5b506102e161061d3660046124c8565b611162565b34801561062d575f80fd5b506102e161063c36600461242d565b61118c565b34801561064c575f80fd5b506102e161065b3660046124f9565b6111d0565b34801561066b575f80fd5b506102e161067a366004612523565b611202565b34801561068a575f80fd5b506102e1611254565b34801561069e575f80fd5b506102e16106ad3660046124f9565b611316565b3480156106bd575f80fd5b505f545f1901610440565b6102e16106d636600461254e565b611381565b3480156106e6575f80fd5b506102e16106f536600461248a565b6113c5565b348015610705575f80fd5b506102e16107143660046124c8565b61140c565b348015610724575f80fd5b506102e16115be565b348015610738575f80fd5b506102f76107473660046123b5565b611607565b348015610757575f80fd5b5061076b6107663660046123b5565b61177a565b604080516001600160a01b03909416845261ffff92831660208501529116908201526060016102b9565b3480156107a0575f80fd5b50600d546102ad9060ff1681565b3480156107b9575f80fd5b506102e16107c8366004612622565b6117b8565b3480156107d8575f80fd5b506107ec6107e73660046124c8565b6117e8565b604080519283526020830191909152016102b9565b34801561080c575f80fd5b506102ad61081b36600461264c565b611899565b6102e161082e3660046124c8565b6118c6565b34801561083e575f80fd5b506102ad61084d3660046123b5565b611900565b6102e16108603660046124c8565b611921565b6102e1610873366004612674565b611947565b348015610883575f80fd5b506104406108923660046124c8565b63389a75e1600c9081525f91909152602090205490565b5f6108b382611bd6565b806108d15750632a55205a60e083901c9081146301ffc9a791909114175b92915050565b6108df611c23565b6108e98282611c3d565b5050565b6060600280546108fc906126bb565b80601f0160208091040260200160405190810160405280929190818152602001828054610928906126bb565b80156109735780601f1061094a57610100808354040283529160200191610973565b820191905f5260205f20905b81548152906001019060200180831161095657829003601f168201915b5050505050905090565b5f61098782611c8b565b6109a4576040516333d1c03960e21b815260040160405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f6109c982610e1b565b9050336001600160a01b03821614610a02576109e58133611899565b610a02576040516367d9dca160e11b815260040160405180910390fd5b5f8281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610a65611cbd565b475f819003610a875760405163334ab3f560e11b815260040160405180910390fd5b5f5b6009548110156108e9575f60098281548110610aa757610aa76126ed565b5f9182526020918290206040805160608101825292909101546001600160a01b038116835261ffff600160a01b82048116948401859052600160b01b9091041690820152915015610b1957610b19815f01516064836020015161ffff16860281610b1357610b13612701565b04611ce2565b50600101610a89565b5f610b2c82611d49565b9050836001600160a01b0316816001600160a01b031614610b5f5760405162a1148160e81b815260040160405180910390fd5b5f8281526006602052604090208054610b8a8187335b6001600160a01b039081169116811491141790565b610bb557610b988633611899565b610bb557604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610bdc57604051633a954ecd60e21b815260040160405180910390fd5b8015610be6575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b84169003610c7257600184015f818152600460205260408120549003610c70575f548114610c70575f8181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03165f80516020612c5b83398151915260405160405180910390a4505050505050565b5f6202a3006001600160401b03164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f82815268aa4ec00224afccfdb76020526040812054606081901c91906127109083610d27576020515490508060601c93505b606084901b18845f19829004811182023d3d3e9396930204935090915050565b610d6183838360405180602001604052805f815250611381565b505050565b610d71816001611db2565b50565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610db5611c23565b600d5460ff1615610dd057610dd063138380c160e01b611edf565b600f610ddd828483612759565b507f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad8282604051610e0f929190612812565b60405180910390a15050565b5f6108d182611d49565b610e2d611cbd565b475f819003610e4657610e4663334ab3f560e11b611edf565b5f5b6009548110156108e9575f60098281548110610e6657610e666126ed565b5f9182526020918290206040805160608101825291909201546001600160a01b038116825261ffff600160a01b8204811694830194909452600160b01b900490921690820181905290915015610ed757610ed7815f01516064836040015161ffff16860281610b1357610b13612701565b50600101610e48565b600f8054610eed906126bb565b80601f0160208091040260200160405190810160405280929190818152602001828054610f19906126bb565b8015610f645780601f10610f3b57610100808354040283529160200191610f64565b820191905f5260205f20905b815481529060010190602001808311610f4757829003601f168201915b505050505081565b5f6001600160a01b038216610f94576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f908152600560205260409020546001600160401b031690565b610fc0611c23565b610fc95f611ee7565b565b610fd481611900565b15610fe957610fe9635fd48f9160e01b611edf565b6040805161014081018252600b546001600160401b038082168352600160401b80830482166020850152600160801b808404831695850195909552600160c01b90920481166060840152600c5480821660808501529182041660a083015260ff928104831660c0830152600160881b8104831660e0830152600160901b81048316610100830152600160981b900490911615801561012083015261109757611097636be9245d60e11b611edf565b80604001516001600160401b03164210156110bc576110bc63a7283fb960e01b611edf565b335f9081526005602052604090205461010082015160c082901c9160e01c908482019060ff168111156110f9576110f9635227d3cf60e11b611edf565b61110f33602083901b63ffffffff861617611f24565b848460a001516001600160401b03160234146111355761113563de94e21360e01b611edf565b506111403385611f55565b50505050565b600e8054610eed906126bb565b6060600380546108fc906126bb565b61116a611c23565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b611194611c23565b80600983815481106111a8576111a86126ed565b905f5260205f20015f0160166101000a81548161ffff021916908361ffff1602179055505050565b6111d8611c23565b6001600160a01b03919091165f908152600a60205260409020805460ff1916911515919091179055565b61120a611c23565b80600b6112178282612886565b9050507f2fcd5868d75e49bb8ef2f6a82f7853b304786d86e803f801cc5fd5a73a914467816040516112499190612a7b565b60405180910390a150565b6008546040516370a0823160e01b81523060048201526001600160a01b03909116908190632e1a7d4d9082906370a0823190602401602060405180830381865afa1580156112a4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112c89190612b74565b6040518263ffffffff1660e01b81526004016112e691815260200190565b5f604051808303815f87803b1580156112fd575f80fd5b505af115801561130f573d5f803e3d5ffd5b5050505050565b335f8181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61138c848484610b22565b6001600160a01b0383163b15611140576113a884848484612027565b611140576040516368d2bf6b60e11b815260040160405180910390fd5b6113cd611c23565b600e6113da828483612759565b507f45369159047c5499b1c9b077b5525862bc88be82363efdd09aaed1cb93f1de118282604051610e0f929190612812565b611414611cbd565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa15801561145a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061147e9190612b74565b9050805f036114975761149763334ab3f560e11b611edf565b5f5b600954811015611140575f600982815481106114b7576114b76126ed565b5f9182526020918290206040805160608101825291909201546001600160a01b038116825261ffff600160a01b8204811694830194909452600160b01b9004909216908201819052909150156115b557836001600160a01b031663a9059cbb825f01516064846040015161ffff1687028161153457611534612701565b6040516001600160e01b031960e086901b1681526001600160a01b0390931660048401520460248201526044016020604051808303815f875af115801561157d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115a19190612b8b565b6115b5576115b56312171d8360e31b611edf565b50600101611499565b6115c6611c23565b600d5460ff16610fc957600d805460ff191660011790556040517f668d78aec4f2992f95f4866cc75cddb478d1f9b1009c4379c2828ff97333156f905f90a1565b606061161282611c8b565b61162657611626630a14c4b560e41b611edf565b5f600f8054611634906126bb565b80601f0160208091040260200160405190810160405280929190818152602001828054611660906126bb565b80156116ab5780601f10611682576101008083540402835291602001916116ab565b820191905f5260205f20905b81548152906001019060200180831161168e57829003601f168201915b505050505090505f81511161174857600e80546116c7906126bb565b80601f01602080910402602001604051908101604052809291908181526020018280546116f3906126bb565b801561173e5780601f106117155761010080835404028352916020019161173e565b820191905f5260205f20905b81548152906001019060200180831161172157829003601f168201915b5050505050611773565b806117528461210e565b604051602001611763929190612ba6565b6040516020818303038152906040525b9392505050565b60098181548110611789575f80fd5b5f918252602090912001546001600160a01b038116915061ffff600160a01b8204811691600160b01b90041683565b6117c0611c23565b6117c982611900565b156117de576117de635fd48f9160e01b611edf565b6108e98183611f55565b6040805161014081018252600b546001600160401b038082168352600160401b80830482166020850152600160801b808404831695850195909552600160c01b90920481166060840152600c5480821660808501529182041660a083015260ff928104831660c0830152600160881b8104831660e0830152600160901b81048316610100830152600160981b900490911615156101208201525f90819061188f8185612151565b9250925050915091565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b6118ce611c23565b63389a75e1600c52805f526020600c2080544211156118f457636f5e88185f526004601cfd5b5f9055610d7181611ee7565b5f611770826119105f545f190190565b61191a9190612be4565b1192915050565b611929611c23565b8060601b61193e57637448fbae5f526004601cfd5b610d7181611ee7565b61195083611900565b1561196557611965635fd48f9160e01b611edf565b6040805161014081018252600b546001600160401b038082168352600160401b80830482166020850152600160801b808404831695850195909552600160c01b90920481166060840152600c5480821660808501529182041660a083015260ff928104831660c0830152600160881b8104831660e0830152600160901b81048316610100830152600160981b9004909116158015610120830152611a1357611a13636be9245d60e11b611edf565b80516001600160401b0316421080611a38575080604001516001600160401b03164210155b15611a4d57611a4d6318852ca560e11b611edf565b5f81602001516001600160401b031642109050611b0c84848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250506040516bffffffffffffffffffffffff193360601b16602082015285151560f81b6034820152611b0692506035019050604051602081830303815290604052805190602001206020527b19457468657265756d205369676e6564204d6573736167653a0a33325f52603c60042090565b9061223b565b6001600160a01b03167309b49f49767f44908ccd4c1f9a154de3b30066d36001600160a01b031614611b4857611b48630b094f2760e31b611edf565b5f80611b548433612151565b909250905086820181811115611b7457611b74635227d3cf60e11b611edf565b5f84611b9857611b843383611f24565b5060808501516001600160401b0316611ba8565b5060608501516001600160401b03165b8881023414611bc157611bc163de94e21360e01b611edf565b5050611bcd3388611f55565b50505050505050565b5f6301ffc9a760e01b6001600160e01b031983161480611c0657506380ac58cd60e01b6001600160e01b03198316145b806108d15750506001600160e01b031916635b5e139f60e01b1490565b638b78c6d819543314610fc9576382b429005f526004601cfd5b6bffffffffffffffffffffffff1661271080821115611c635763350a88b35f526004601cfd5b8260601b80611c795763b4457eaa5f526004601cfd5b90911768aa4ec00224afccfdb7555050565b5f81600111158015611c9d57505f5482105b80156108d15750505f90815260046020526040902054600160e01b161590565b335f908152600a602052604090205460ff16610fc957610fc96282b42960e81b611edf565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114611d2b576040519150601f19603f3d011682016040523d82523d5f602084013e611d30565b606091505b5050905080610d6157610d616312171d8360e31b611edf565b5f8180600111611d99575f54811015611d99575f8181526004602052604081205490600160e01b82169003611d97575b805f0361177357505f19015f81815260046020526040902054611d79565b505b604051636f96cda160e11b815260040160405180910390fd5b5f611dbc83611d49565b9050805f80611dd8865f90815260066020526040902080549091565b915091508415611e1857611ded818433610b75565b611e1857611dfb8333611899565b611e1857604051632ce44b5f60e11b815260040160405180910390fd5b8015611e22575f82555b6001600160a01b0383165f81815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b175f87815260046020526040812091909155600160e11b85169003611eab57600186015f818152600460205260408120549003611ea9575f548114611ea9575f8181526004602052604090208590555b505b60405186905f906001600160a01b038616905f80516020612c5b833981519152908390a45050600180548101905550505050565b805f5260045ffd5b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b6001600160a01b039091165f90815260056020526040902080546001600160c01b031660c09290921b919091179055565b5f805490829003611f795760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0383165f8181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083905f80516020612c5b8339815191528180a4600183015b818114611fff5780835f5f80516020612c5b8339815191525f80a4600101611fdc565b50815f0361201f57604051622e076360e81b815260040160405180910390fd5b5f5550505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a029061205b903390899088908890600401612c03565b6020604051808303815f875af1925050508015612095575060408051601f3d908101601f1916820190925261209291810190612c3f565b60015b6120f1573d8080156120c2576040519150601f19603f3d011682016040523d82523d5f602084013e6120c7565b606091505b5080515f036120e9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806121275750819003601f19909101908152919050565b5f8083602001516001600160401b031642101561219d5750506001600160a01b0381165f90815260056020526040908190205460c0840151911c6001600160401b03169060ff16612234565b83604001516001600160401b03164210156121f45763ffffffff6121d8846001600160a01b03165f9081526005602052604090205460c01c90565b60e086015191166001600160401b0316925060ff169050612234565b6020612217846001600160a01b03165f9081526005602052604090205460c01c90565b6101008601516001600160401b0391821690921c16925060ff1690505b9250929050565b604051600190835f526020830151604052604083510361227657604083015160ff81901c601b016020526001600160ff1b031660605261229a565b60418351036122965760608301515f1a602052604083015160605261229a565b5f91505b6020600160805f855afa5191503d6122b957638baa579f5f526004601cfd5b5f60605260405292915050565b6001600160e01b031981168114610d71575f80fd5b5f602082840312156122eb575f80fd5b8135611773816122c6565b80356001600160a01b038116811461230c575f80fd5b919050565b5f8060408385031215612322575f80fd5b61232b836122f6565b915060208301356bffffffffffffffffffffffff8116811461234b575f80fd5b809150509250929050565b5f5b83811015612370578181015183820152602001612358565b50505f910152565b5f815180845261238f816020860160208601612356565b601f01601f19169290920160200192915050565b602081525f6117736020830184612378565b5f602082840312156123c5575f80fd5b5035919050565b5f80604083850312156123dd575f80fd5b6123e6836122f6565b946020939093013593505050565b5f805f60608486031215612406575f80fd5b61240f846122f6565b925061241d602085016122f6565b9150604084013590509250925092565b5f806040838503121561243e575f80fd5b50508035926020909101359150565b5f8083601f84011261245d575f80fd5b5081356001600160401b03811115612473575f80fd5b602083019150836020828501011115612234575f80fd5b5f806020838503121561249b575f80fd5b82356001600160401b038111156124b0575f80fd5b6124bc8582860161244d565b90969095509350505050565b5f602082840312156124d8575f80fd5b611773826122f6565b8015158114610d71575f80fd5b803561230c816124e1565b5f806040838503121561250a575f80fd5b612513836122f6565b9150602083013561234b816124e1565b5f6101408284031215612534575f80fd5b50919050565b634e487b7160e01b5f52604160045260245ffd5b5f805f8060808587031215612561575f80fd5b61256a856122f6565b9350612578602086016122f6565b92506040850135915060608501356001600160401b038082111561259a575f80fd5b818701915087601f8301126125ad575f80fd5b8135818111156125bf576125bf61253a565b604051601f8201601f19908116603f011681019083821181831017156125e7576125e761253a565b816040528281528a60208487010111156125ff575f80fd5b826020860160208301375f60208483010152809550505050505092959194509250565b5f8060408385031215612633575f80fd5b82359150612643602084016122f6565b90509250929050565b5f806040838503121561265d575f80fd5b612666836122f6565b9150612643602084016122f6565b5f805f60408486031215612686575f80fd5b8335925060208401356001600160401b038111156126a2575f80fd5b6126ae8682870161244d565b9497909650939450505050565b600181811c908216806126cf57607f821691505b60208210810361253457634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601260045260245ffd5b601f821115610d6157805f5260205f20601f840160051c8101602085101561273a5750805b601f840160051c820191505b8181101561130f575f8155600101612746565b6001600160401b038311156127705761277061253a565b6127848361277e83546126bb565b83612715565b5f601f8411600181146127b5575f851561279e5750838201355b5f19600387901b1c1916600186901b17835561130f565b5f83815260208120601f198716915b828110156127e457868501358255602094850194600190920191016127c4565b5086821015612800575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b6001600160401b0381168114610d71575f80fd5b5f81356108d181612840565b60ff81168114610d71575f80fd5b5f81356108d181612860565b5f81356108d1816124e1565b813561289181612840565b815467ffffffffffffffff19166001600160401b0382161782555060208201356128ba81612840565b815467ffffffffffffffff60401b1916604082901b67ffffffffffffffff60401b161782555060408201356128ee81612840565b815467ffffffffffffffff60801b191660809190911b67ffffffffffffffff60801b1617815561294761292360608401612854565b8280546001600160c01b031660c09290921b6001600160c01b031916919091179055565b6001810161297861295a60808501612854565b825467ffffffffffffffff19166001600160401b0391909116178255565b6129af61298760a08501612854565b825467ffffffffffffffff60401b191660409190911b67ffffffffffffffff60401b16178255565b6129dc6129be60c0850161286e565b82805460ff60801b191660809290921b60ff60801b16919091179055565b612a096129eb60e0850161286e565b82805460ff60881b191660889290921b60ff60881b16919091179055565b612a37612a19610100850161286e565b82805460ff60901b191660909290921b60ff60901b16919091179055565b610d61612a47610120850161287a565b82805460ff60981b191691151560981b60ff60981b16919091179055565b803561230c81612840565b803561230c81612860565b6101408101612a9a82612a8d85612a65565b6001600160401b03169052565b612aa660208401612a65565b6001600160401b03166020830152612ac060408401612a65565b6001600160401b03166040830152612ada60608401612a65565b6001600160401b03166060830152612af460808401612a65565b6001600160401b03166080830152612b0e60a08401612a65565b6001600160401b031660a0830152612b2860c08401612a70565b60ff1660c0830152612b3c60e08401612a70565b60ff1660e0830152610100612b52848201612a70565b60ff1690830152610120612b678482016124ee565b1515920191909152919050565b5f60208284031215612b84575f80fd5b5051919050565b5f60208284031215612b9b575f80fd5b8151611773816124e1565b5f8351612bb7818460208801612356565b835190830190612bcb818360208801612356565b64173539b7b760d91b9101908152600501949350505050565b808201808211156108d157634e487b7160e01b5f52601160045260245ffd5b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90612c3590830184612378565b9695505050505050565b5f60208284031215612c4f575f80fd5b8151611773816122c656feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122006fcd379964b503d18badd16850590704ceaefb44327a4913ab22e236852837b64736f6c63430008170033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef697066733a2f2f516d6368464a36387476506e586a35324e586e396f543541764862673879383457586b7859657a65364765513236
Deployed Bytecode
0x608060405260043610610283575f3560e01c80638da5cb5b11610155578063c793803c116100be578063e985e9c511610078578063e985e9c514610801578063f04e283e14610820578063f0ba9cb814610833578063f2fde38b14610852578063fd24a85414610865578063fee81cf414610878575f80fd5b8063c793803c14610719578063c87b56dd1461072d578063c9eb46621461074c578063cf0b913114610795578063d52c57e0146107ae578063e73dea67146107cd575f80fd5b80639e3437db1161010f5780639e3437db1461067f578063a22cb46514610693578063a2309ff8146106b2578063b88d4fde146106c8578063bbaac02f146106db578063bf9e9834146106fa575f80fd5b80638da5cb5b146105d757806395d89b41146105ef57806398e5209d146106035780639b58dfba146106225780639cae6eae146106415780639e30751e14610660575f80fd5b806342842e0e116101f75780636c0360eb116101b15780636c0360eb1461054757806370a082311461055b578063715018a61461057a5780637bbf4a3f146105825780638ca887ca146105b05780638cc54e7f146105c3575f80fd5b806342842e0e146104bb57806342966c68146104ce57806354d1f13d146104ed57806355f804b3146104f55780636352211e14610514578063688039b914610533575f80fd5b80631779272911610248578063177927291461034e57806318160ddd1461042a5780631ffa6c6c1461044e57806323b872dd1461046257806325692962146104755780632a55205a1461047d575f80fd5b806301ffc9a71461028e57806304634d8d146102c257806306fdde03146102e3578063081812fc14610304578063095ea7b31461033b575f80fd5b3661028a57005b5f80fd5b348015610299575f80fd5b506102ad6102a83660046122db565b6108a9565b60405190151581526020015b60405180910390f35b3480156102cd575f80fd5b506102e16102dc366004612311565b6108d7565b005b3480156102ee575f80fd5b506102f76108ed565b6040516102b991906123a3565b34801561030f575f80fd5b5061032361031e3660046123b5565b61097d565b6040516001600160a01b0390911681526020016102b9565b6102e16103493660046123cc565b6109bf565b348015610359575f80fd5b50600b54600c546103c3916001600160401b0380821692600160401b808404831693600160801b808204851694600160c01b9092048216938083169381049092169160ff918104821691600160881b8204811691600160901b8104821691600160981b909104168a565b604080516001600160401b039b8c168152998b1660208b0152978a169789019790975294881660608801529287166080870152951660a085015260ff94851660c0850152841660e084015292909216610100820152901515610120820152610140016102b9565b348015610435575f80fd5b506001545f54035f19015b6040519081526020016102b9565b348015610459575f80fd5b506102e1610a5d565b6102e16104703660046123f4565b610b22565b6102e1610ca8565b348015610488575f80fd5b5061049c61049736600461242d565b610cf4565b604080516001600160a01b0390931683526020830191909152016102b9565b6102e16104c93660046123f4565b610d47565b3480156104d9575f80fd5b506102e16104e83660046123b5565b610d66565b6102e1610d74565b348015610500575f80fd5b506102e161050f36600461248a565b610dad565b34801561051f575f80fd5b5061032361052e3660046123b5565b610e1b565b34801561053e575f80fd5b506102e1610e25565b348015610552575f80fd5b506102f7610ee0565b348015610566575f80fd5b506104406105753660046124c8565b610f6c565b6102e1610fb8565b34801561058d575f80fd5b506102ad61059c3660046124c8565b600a6020525f908152604090205460ff1681565b6102e16105be3660046123b5565b610fcb565b3480156105ce575f80fd5b506102f7611146565b3480156105e2575f80fd5b50638b78c6d81954610323565b3480156105fa575f80fd5b506102f7611153565b34801561060e575f80fd5b506102e161061d3660046124c8565b611162565b34801561062d575f80fd5b506102e161063c36600461242d565b61118c565b34801561064c575f80fd5b506102e161065b3660046124f9565b6111d0565b34801561066b575f80fd5b506102e161067a366004612523565b611202565b34801561068a575f80fd5b506102e1611254565b34801561069e575f80fd5b506102e16106ad3660046124f9565b611316565b3480156106bd575f80fd5b505f545f1901610440565b6102e16106d636600461254e565b611381565b3480156106e6575f80fd5b506102e16106f536600461248a565b6113c5565b348015610705575f80fd5b506102e16107143660046124c8565b61140c565b348015610724575f80fd5b506102e16115be565b348015610738575f80fd5b506102f76107473660046123b5565b611607565b348015610757575f80fd5b5061076b6107663660046123b5565b61177a565b604080516001600160a01b03909416845261ffff92831660208501529116908201526060016102b9565b3480156107a0575f80fd5b50600d546102ad9060ff1681565b3480156107b9575f80fd5b506102e16107c8366004612622565b6117b8565b3480156107d8575f80fd5b506107ec6107e73660046124c8565b6117e8565b604080519283526020830191909152016102b9565b34801561080c575f80fd5b506102ad61081b36600461264c565b611899565b6102e161082e3660046124c8565b6118c6565b34801561083e575f80fd5b506102ad61084d3660046123b5565b611900565b6102e16108603660046124c8565b611921565b6102e1610873366004612674565b611947565b348015610883575f80fd5b506104406108923660046124c8565b63389a75e1600c9081525f91909152602090205490565b5f6108b382611bd6565b806108d15750632a55205a60e083901c9081146301ffc9a791909114175b92915050565b6108df611c23565b6108e98282611c3d565b5050565b6060600280546108fc906126bb565b80601f0160208091040260200160405190810160405280929190818152602001828054610928906126bb565b80156109735780601f1061094a57610100808354040283529160200191610973565b820191905f5260205f20905b81548152906001019060200180831161095657829003601f168201915b5050505050905090565b5f61098782611c8b565b6109a4576040516333d1c03960e21b815260040160405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f6109c982610e1b565b9050336001600160a01b03821614610a02576109e58133611899565b610a02576040516367d9dca160e11b815260040160405180910390fd5b5f8281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b610a65611cbd565b475f819003610a875760405163334ab3f560e11b815260040160405180910390fd5b5f5b6009548110156108e9575f60098281548110610aa757610aa76126ed565b5f9182526020918290206040805160608101825292909101546001600160a01b038116835261ffff600160a01b82048116948401859052600160b01b9091041690820152915015610b1957610b19815f01516064836020015161ffff16860281610b1357610b13612701565b04611ce2565b50600101610a89565b5f610b2c82611d49565b9050836001600160a01b0316816001600160a01b031614610b5f5760405162a1148160e81b815260040160405180910390fd5b5f8281526006602052604090208054610b8a8187335b6001600160a01b039081169116811491141790565b610bb557610b988633611899565b610bb557604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610bdc57604051633a954ecd60e21b815260040160405180910390fd5b8015610be6575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b84169003610c7257600184015f818152600460205260408120549003610c70575f548114610c70575f8181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03165f80516020612c5b83398151915260405160405180910390a4505050505050565b5f6202a3006001600160401b03164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f82815268aa4ec00224afccfdb76020526040812054606081901c91906127109083610d27576020515490508060601c93505b606084901b18845f19829004811182023d3d3e9396930204935090915050565b610d6183838360405180602001604052805f815250611381565b505050565b610d71816001611db2565b50565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610db5611c23565b600d5460ff1615610dd057610dd063138380c160e01b611edf565b600f610ddd828483612759565b507f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad8282604051610e0f929190612812565b60405180910390a15050565b5f6108d182611d49565b610e2d611cbd565b475f819003610e4657610e4663334ab3f560e11b611edf565b5f5b6009548110156108e9575f60098281548110610e6657610e666126ed565b5f9182526020918290206040805160608101825291909201546001600160a01b038116825261ffff600160a01b8204811694830194909452600160b01b900490921690820181905290915015610ed757610ed7815f01516064836040015161ffff16860281610b1357610b13612701565b50600101610e48565b600f8054610eed906126bb565b80601f0160208091040260200160405190810160405280929190818152602001828054610f19906126bb565b8015610f645780601f10610f3b57610100808354040283529160200191610f64565b820191905f5260205f20905b815481529060010190602001808311610f4757829003601f168201915b505050505081565b5f6001600160a01b038216610f94576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f908152600560205260409020546001600160401b031690565b610fc0611c23565b610fc95f611ee7565b565b610fd481611900565b15610fe957610fe9635fd48f9160e01b611edf565b6040805161014081018252600b546001600160401b038082168352600160401b80830482166020850152600160801b808404831695850195909552600160c01b90920481166060840152600c5480821660808501529182041660a083015260ff928104831660c0830152600160881b8104831660e0830152600160901b81048316610100830152600160981b900490911615801561012083015261109757611097636be9245d60e11b611edf565b80604001516001600160401b03164210156110bc576110bc63a7283fb960e01b611edf565b335f9081526005602052604090205461010082015160c082901c9160e01c908482019060ff168111156110f9576110f9635227d3cf60e11b611edf565b61110f33602083901b63ffffffff861617611f24565b848460a001516001600160401b03160234146111355761113563de94e21360e01b611edf565b506111403385611f55565b50505050565b600e8054610eed906126bb565b6060600380546108fc906126bb565b61116a611c23565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b611194611c23565b80600983815481106111a8576111a86126ed565b905f5260205f20015f0160166101000a81548161ffff021916908361ffff1602179055505050565b6111d8611c23565b6001600160a01b03919091165f908152600a60205260409020805460ff1916911515919091179055565b61120a611c23565b80600b6112178282612886565b9050507f2fcd5868d75e49bb8ef2f6a82f7853b304786d86e803f801cc5fd5a73a914467816040516112499190612a7b565b60405180910390a150565b6008546040516370a0823160e01b81523060048201526001600160a01b03909116908190632e1a7d4d9082906370a0823190602401602060405180830381865afa1580156112a4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112c89190612b74565b6040518263ffffffff1660e01b81526004016112e691815260200190565b5f604051808303815f87803b1580156112fd575f80fd5b505af115801561130f573d5f803e3d5ffd5b5050505050565b335f8181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61138c848484610b22565b6001600160a01b0383163b15611140576113a884848484612027565b611140576040516368d2bf6b60e11b815260040160405180910390fd5b6113cd611c23565b600e6113da828483612759565b507f45369159047c5499b1c9b077b5525862bc88be82363efdd09aaed1cb93f1de118282604051610e0f929190612812565b611414611cbd565b6040516370a0823160e01b815230600482015281905f906001600160a01b038316906370a0823190602401602060405180830381865afa15801561145a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061147e9190612b74565b9050805f036114975761149763334ab3f560e11b611edf565b5f5b600954811015611140575f600982815481106114b7576114b76126ed565b5f9182526020918290206040805160608101825291909201546001600160a01b038116825261ffff600160a01b8204811694830194909452600160b01b9004909216908201819052909150156115b557836001600160a01b031663a9059cbb825f01516064846040015161ffff1687028161153457611534612701565b6040516001600160e01b031960e086901b1681526001600160a01b0390931660048401520460248201526044016020604051808303815f875af115801561157d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115a19190612b8b565b6115b5576115b56312171d8360e31b611edf565b50600101611499565b6115c6611c23565b600d5460ff16610fc957600d805460ff191660011790556040517f668d78aec4f2992f95f4866cc75cddb478d1f9b1009c4379c2828ff97333156f905f90a1565b606061161282611c8b565b61162657611626630a14c4b560e41b611edf565b5f600f8054611634906126bb565b80601f0160208091040260200160405190810160405280929190818152602001828054611660906126bb565b80156116ab5780601f10611682576101008083540402835291602001916116ab565b820191905f5260205f20905b81548152906001019060200180831161168e57829003601f168201915b505050505090505f81511161174857600e80546116c7906126bb565b80601f01602080910402602001604051908101604052809291908181526020018280546116f3906126bb565b801561173e5780601f106117155761010080835404028352916020019161173e565b820191905f5260205f20905b81548152906001019060200180831161172157829003601f168201915b5050505050611773565b806117528461210e565b604051602001611763929190612ba6565b6040516020818303038152906040525b9392505050565b60098181548110611789575f80fd5b5f918252602090912001546001600160a01b038116915061ffff600160a01b8204811691600160b01b90041683565b6117c0611c23565b6117c982611900565b156117de576117de635fd48f9160e01b611edf565b6108e98183611f55565b6040805161014081018252600b546001600160401b038082168352600160401b80830482166020850152600160801b808404831695850195909552600160c01b90920481166060840152600c5480821660808501529182041660a083015260ff928104831660c0830152600160881b8104831660e0830152600160901b81048316610100830152600160981b900490911615156101208201525f90819061188f8185612151565b9250925050915091565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b6118ce611c23565b63389a75e1600c52805f526020600c2080544211156118f457636f5e88185f526004601cfd5b5f9055610d7181611ee7565b5f611770826119105f545f190190565b61191a9190612be4565b1192915050565b611929611c23565b8060601b61193e57637448fbae5f526004601cfd5b610d7181611ee7565b61195083611900565b1561196557611965635fd48f9160e01b611edf565b6040805161014081018252600b546001600160401b038082168352600160401b80830482166020850152600160801b808404831695850195909552600160c01b90920481166060840152600c5480821660808501529182041660a083015260ff928104831660c0830152600160881b8104831660e0830152600160901b81048316610100830152600160981b9004909116158015610120830152611a1357611a13636be9245d60e11b611edf565b80516001600160401b0316421080611a38575080604001516001600160401b03164210155b15611a4d57611a4d6318852ca560e11b611edf565b5f81602001516001600160401b031642109050611b0c84848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250506040516bffffffffffffffffffffffff193360601b16602082015285151560f81b6034820152611b0692506035019050604051602081830303815290604052805190602001206020527b19457468657265756d205369676e6564204d6573736167653a0a33325f52603c60042090565b9061223b565b6001600160a01b03167309b49f49767f44908ccd4c1f9a154de3b30066d36001600160a01b031614611b4857611b48630b094f2760e31b611edf565b5f80611b548433612151565b909250905086820181811115611b7457611b74635227d3cf60e11b611edf565b5f84611b9857611b843383611f24565b5060808501516001600160401b0316611ba8565b5060608501516001600160401b03165b8881023414611bc157611bc163de94e21360e01b611edf565b5050611bcd3388611f55565b50505050505050565b5f6301ffc9a760e01b6001600160e01b031983161480611c0657506380ac58cd60e01b6001600160e01b03198316145b806108d15750506001600160e01b031916635b5e139f60e01b1490565b638b78c6d819543314610fc9576382b429005f526004601cfd5b6bffffffffffffffffffffffff1661271080821115611c635763350a88b35f526004601cfd5b8260601b80611c795763b4457eaa5f526004601cfd5b90911768aa4ec00224afccfdb7555050565b5f81600111158015611c9d57505f5482105b80156108d15750505f90815260046020526040902054600160e01b161590565b335f908152600a602052604090205460ff16610fc957610fc96282b42960e81b611edf565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114611d2b576040519150601f19603f3d011682016040523d82523d5f602084013e611d30565b606091505b5050905080610d6157610d616312171d8360e31b611edf565b5f8180600111611d99575f54811015611d99575f8181526004602052604081205490600160e01b82169003611d97575b805f0361177357505f19015f81815260046020526040902054611d79565b505b604051636f96cda160e11b815260040160405180910390fd5b5f611dbc83611d49565b9050805f80611dd8865f90815260066020526040902080549091565b915091508415611e1857611ded818433610b75565b611e1857611dfb8333611899565b611e1857604051632ce44b5f60e11b815260040160405180910390fd5b8015611e22575f82555b6001600160a01b0383165f81815260056020526040902080546fffffffffffffffffffffffffffffffff0190554260a01b17600360e01b175f87815260046020526040812091909155600160e11b85169003611eab57600186015f818152600460205260408120549003611ea9575f548114611ea9575f8181526004602052604090208590555b505b60405186905f906001600160a01b038616905f80516020612c5b833981519152908390a45050600180548101905550505050565b805f5260045ffd5b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b6001600160a01b039091165f90815260056020526040902080546001600160c01b031660c09290921b919091179055565b5f805490829003611f795760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0383165f8181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083905f80516020612c5b8339815191528180a4600183015b818114611fff5780835f5f80516020612c5b8339815191525f80a4600101611fdc565b50815f0361201f57604051622e076360e81b815260040160405180910390fd5b5f5550505050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a029061205b903390899088908890600401612c03565b6020604051808303815f875af1925050508015612095575060408051601f3d908101601f1916820190925261209291810190612c3f565b60015b6120f1573d8080156120c2576040519150601f19603f3d011682016040523d82523d5f602084013e6120c7565b606091505b5080515f036120e9576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806121275750819003601f19909101908152919050565b5f8083602001516001600160401b031642101561219d5750506001600160a01b0381165f90815260056020526040908190205460c0840151911c6001600160401b03169060ff16612234565b83604001516001600160401b03164210156121f45763ffffffff6121d8846001600160a01b03165f9081526005602052604090205460c01c90565b60e086015191166001600160401b0316925060ff169050612234565b6020612217846001600160a01b03165f9081526005602052604090205460c01c90565b6101008601516001600160401b0391821690921c16925060ff1690505b9250929050565b604051600190835f526020830151604052604083510361227657604083015160ff81901c601b016020526001600160ff1b031660605261229a565b60418351036122965760608301515f1a602052604083015160605261229a565b5f91505b6020600160805f855afa5191503d6122b957638baa579f5f526004601cfd5b5f60605260405292915050565b6001600160e01b031981168114610d71575f80fd5b5f602082840312156122eb575f80fd5b8135611773816122c6565b80356001600160a01b038116811461230c575f80fd5b919050565b5f8060408385031215612322575f80fd5b61232b836122f6565b915060208301356bffffffffffffffffffffffff8116811461234b575f80fd5b809150509250929050565b5f5b83811015612370578181015183820152602001612358565b50505f910152565b5f815180845261238f816020860160208601612356565b601f01601f19169290920160200192915050565b602081525f6117736020830184612378565b5f602082840312156123c5575f80fd5b5035919050565b5f80604083850312156123dd575f80fd5b6123e6836122f6565b946020939093013593505050565b5f805f60608486031215612406575f80fd5b61240f846122f6565b925061241d602085016122f6565b9150604084013590509250925092565b5f806040838503121561243e575f80fd5b50508035926020909101359150565b5f8083601f84011261245d575f80fd5b5081356001600160401b03811115612473575f80fd5b602083019150836020828501011115612234575f80fd5b5f806020838503121561249b575f80fd5b82356001600160401b038111156124b0575f80fd5b6124bc8582860161244d565b90969095509350505050565b5f602082840312156124d8575f80fd5b611773826122f6565b8015158114610d71575f80fd5b803561230c816124e1565b5f806040838503121561250a575f80fd5b612513836122f6565b9150602083013561234b816124e1565b5f6101408284031215612534575f80fd5b50919050565b634e487b7160e01b5f52604160045260245ffd5b5f805f8060808587031215612561575f80fd5b61256a856122f6565b9350612578602086016122f6565b92506040850135915060608501356001600160401b038082111561259a575f80fd5b818701915087601f8301126125ad575f80fd5b8135818111156125bf576125bf61253a565b604051601f8201601f19908116603f011681019083821181831017156125e7576125e761253a565b816040528281528a60208487010111156125ff575f80fd5b826020860160208301375f60208483010152809550505050505092959194509250565b5f8060408385031215612633575f80fd5b82359150612643602084016122f6565b90509250929050565b5f806040838503121561265d575f80fd5b612666836122f6565b9150612643602084016122f6565b5f805f60408486031215612686575f80fd5b8335925060208401356001600160401b038111156126a2575f80fd5b6126ae8682870161244d565b9497909650939450505050565b600181811c908216806126cf57607f821691505b60208210810361253457634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601260045260245ffd5b601f821115610d6157805f5260205f20601f840160051c8101602085101561273a5750805b601f840160051c820191505b8181101561130f575f8155600101612746565b6001600160401b038311156127705761277061253a565b6127848361277e83546126bb565b83612715565b5f601f8411600181146127b5575f851561279e5750838201355b5f19600387901b1c1916600186901b17835561130f565b5f83815260208120601f198716915b828110156127e457868501358255602094850194600190920191016127c4565b5086821015612800575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b6001600160401b0381168114610d71575f80fd5b5f81356108d181612840565b60ff81168114610d71575f80fd5b5f81356108d181612860565b5f81356108d1816124e1565b813561289181612840565b815467ffffffffffffffff19166001600160401b0382161782555060208201356128ba81612840565b815467ffffffffffffffff60401b1916604082901b67ffffffffffffffff60401b161782555060408201356128ee81612840565b815467ffffffffffffffff60801b191660809190911b67ffffffffffffffff60801b1617815561294761292360608401612854565b8280546001600160c01b031660c09290921b6001600160c01b031916919091179055565b6001810161297861295a60808501612854565b825467ffffffffffffffff19166001600160401b0391909116178255565b6129af61298760a08501612854565b825467ffffffffffffffff60401b191660409190911b67ffffffffffffffff60401b16178255565b6129dc6129be60c0850161286e565b82805460ff60801b191660809290921b60ff60801b16919091179055565b612a096129eb60e0850161286e565b82805460ff60881b191660889290921b60ff60881b16919091179055565b612a37612a19610100850161286e565b82805460ff60901b191660909290921b60ff60901b16919091179055565b610d61612a47610120850161287a565b82805460ff60981b191691151560981b60ff60981b16919091179055565b803561230c81612840565b803561230c81612860565b6101408101612a9a82612a8d85612a65565b6001600160401b03169052565b612aa660208401612a65565b6001600160401b03166020830152612ac060408401612a65565b6001600160401b03166040830152612ada60608401612a65565b6001600160401b03166060830152612af460808401612a65565b6001600160401b03166080830152612b0e60a08401612a65565b6001600160401b031660a0830152612b2860c08401612a70565b60ff1660c0830152612b3c60e08401612a70565b60ff1660e0830152610100612b52848201612a70565b60ff1690830152610120612b678482016124ee565b1515920191909152919050565b5f60208284031215612b84575f80fd5b5051919050565b5f60208284031215612b9b575f80fd5b8151611773816124e1565b5f8351612bb7818460208801612356565b835190830190612bcb818360208801612356565b64173539b7b760d91b9101908152600501949350505050565b808201808211156108d157634e487b7160e01b5f52601160045260245ffd5b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90612c3590830184612378565b9695505050505050565b5f60208284031215612c4f575f80fd5b8151611773816122c656feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122006fcd379964b503d18badd16850590704ceaefb44327a4913ab22e236852837b64736f6c63430008170033
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.