ERC-721
Overview
Max Total Supply
3,416 BOSOTOKEN
Holders
1,125
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 BOSOTOKENLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
BosoTokyo
Compiler Version
v0.8.13+commit.abaa5c0e
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.10 <0.9.0; import "@divergencetech/ethier/contracts/crypto/SignatureChecker.sol"; import "@divergencetech/ethier/contracts/crypto/SignerManager.sol"; import "@divergencetech/ethier/contracts/erc721/BaseTokenURI.sol"; import "@divergencetech/ethier/contracts/erc721/ERC721ACommon.sol"; import "@divergencetech/ethier/contracts/erc721/ERC721Redeemer.sol"; import "@divergencetech/ethier/contracts/sales/LinearDutchAuction.sol"; import "@divergencetech/ethier/contracts/utils/Monotonic.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; interface ITokenURIGenerator { function tokenURI(uint256 tokenId) external view returns (string memory); } contract BosoTokyo is ERC721ACommon, BaseTokenURI, LinearDutchAuction, SignerManager, ERC2981, AccessControlEnumerable { using EnumerableSet for EnumerableSet.AddressSet; using ERC721Redeemer for ERC721Redeemer.Claims; using Monotonic for Monotonic.Increaser; using SignatureChecker for EnumerableSet.AddressSet; /** @notice Role of administrative users allowed to expel a token from the revving. @dev See expelFromRevving(). */ bytes32 public constant EXPULSION_ROLE = keccak256("EXPULSION_ROLE"); constructor( string memory name, string memory symbol, address payable beneficiary, address payable royaltyReceiver ) ERC721ACommon(name, symbol) BaseTokenURI("") LinearDutchAuction( DutchAuctionConfig( 1659841200, // 12:00, 7 Aug, 2022 (JST) 1.2 ether, 40 minutes, 0.1 ether, 6, LinearDutchAuction.AuctionIntervalUnit.Time ), 0.6 ether, Seller.SellerConfig({ totalInventory: 10_000, lockTotalInventory: true, maxPerAddress: 0, maxPerTx: 10, freeQuota: 10_000, lockFreeQuota: false, reserveFreeQuota: false }), beneficiary ) { _setDefaultRoyalty(royaltyReceiver, 500); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); } /** @dev Mint tokens purchased via the Seller. */ function _handlePurchase( address to, uint256 n, bool ) internal override { _safeMint(to, n); assert(totalSupply() <= 10_000); } function mintPublic( address to, uint256 num ) external payable { _purchase(to, num); } /** @dev tokenId to revving start time (0 = not revving). */ mapping(uint256 => uint256) private revvingStarted; /** @dev Cumulative per-token revving, excluding the current period. */ mapping(uint256 => uint256) private revvingTotal; /** @notice Returns the length of time, in seconds, that the token has revved. @dev Revving is tied to a specific token, not to the owner, so it doesn't reset upon sale. @return revving Whether the token is currently revving. MAY be true with zero current revving if in the same block as revving began. @return current Zero if not currently revving, otherwise the length of time since the most recent revving began. @return total Total period of time for which the token has revved across its life, including the current period. */ function revvingPeriod(uint256 tokenId) external view returns ( bool revving, uint256 current, uint256 total ) { uint256 start = revvingStarted[tokenId]; if (start != 0) { revving = true; current = block.timestamp - start; } total = current + revvingTotal[tokenId]; } /** @dev MUST only be modified by safeTransferWhileRevving(); if set to 2 then the _beforeTokenTransfer() block while revving is disabled. */ uint256 private revvingTransfer = 1; /** @notice Transfer a token between addresses while the token is minting, thus not resetting the revving period. */ function safeTransferWhileRevving( address from, address to, uint256 tokenId ) external { require(ownerOf(tokenId) == _msgSender(), "BosoTokyo: Only owner"); revvingTransfer = 2; safeTransferFrom(from, to, tokenId); revvingTransfer = 1; } /** @dev Block transfers while revving. */ function _beforeTokenTransfers( address, address, uint256 startTokenId, uint256 quantity ) internal view override { uint256 tokenId = startTokenId; for (uint256 end = tokenId + quantity; tokenId < end; ++tokenId) { require( revvingStarted[tokenId] == 0 || revvingTransfer == 2, "BosoTokyo: revving" ); } } /** @dev Emitted when a token begins revving. */ event Revved(uint256 indexed tokenId); /** @dev Emitted when a token stops revving; either through standard means or by expulsion. */ event Unrevved(uint256 indexed tokenId); /** @dev Emitted when a token is expelled from the revving. */ event Expelled(uint256 indexed tokenId); /** @notice Whether revving is currently allowed. @dev If false then revving is blocked, but unrevving is always allowed. */ bool public revvingOpen = false; /** @notice Toggles the `revvingOpen` flag. */ function setRevvingOpen(bool open) external onlyOwner { revvingOpen = open; } /** @notice Changes the token's revving status. */ function toggleRevving(uint256 tokenId) internal onlyApprovedOrOwner(tokenId) { uint256 start = revvingStarted[tokenId]; if (start == 0) { require(revvingOpen, "BosoTokyo: revving closed"); revvingStarted[tokenId] = block.timestamp; emit Revved(tokenId); } else { revvingTotal[tokenId] += block.timestamp - start; revvingStarted[tokenId] = 0; emit Unrevved(tokenId); } } /** @notice Changes the BosoTokyo' revving statuss (what's the plural of status? statii? statuses? status? The plural of sheep is sheep; maybe it's also the plural of status). @dev Changes the BosoTokyo' revving sheep (see @notice). */ function toggleRevving(uint256[] calldata tokenIds) external { uint256 n = tokenIds.length; for (uint256 i = 0; i < n; ++i) { toggleRevving(tokenIds[i]); } } /** @notice Admin-only ability to expel a token from the revving. @dev As most sales listings use off-chain signatures it's impossible to detect someone who has revved and then deliberately undercuts the floor price in the knowledge that the sale can't proceed. This function allows for monitoring of such practices and expulsion if abuse is detected, allowing the undercutting bird to be sold on the open market. Since OpenSea uses isApprovedForAll() in its pre-listing checks, we can't block by that means because revving would then be all-or-nothing for all of a particular owner's BosoTokyo. */ function expelFromRevving(uint256 tokenId) external onlyRole(EXPULSION_ROLE) { require(revvingStarted[tokenId] != 0, "BosoTokyo: not revved"); revvingTotal[tokenId] += block.timestamp - revvingStarted[tokenId]; revvingStarted[tokenId] = 0; emit Unrevved(tokenId); emit Expelled(tokenId); } /** @dev Required override to select the correct baseTokenURI. */ function _baseURI() internal view override(BaseTokenURI, ERC721A) returns (string memory) { return BaseTokenURI._baseURI(); } /** @notice If set, contract to which tokenURI() calls are proxied. */ ITokenURIGenerator public renderingContract; /** @notice Sets the optional tokenURI override contract. */ function setRenderingContract(ITokenURIGenerator _contract) external onlyOwner { renderingContract = _contract; } /** @notice If renderingContract is set then returns its tokenURI(tokenId) return value, otherwise returns the standard baseTokenURI + tokenId. */ function tokenURI(uint256 tokenId) public view override returns (string memory) { if (address(renderingContract) != address(0)) { return renderingContract.tokenURI(tokenId); } return super.tokenURI(tokenId); } /** @notice Sets the contract-wide royalty info. */ function setRoyaltyInfo(address receiver, uint96 feeBasisPoints) external onlyOwner { _setDefaultRoyalty(receiver, feeBasisPoints); } function supportsInterface(bytes4 interfaceId) public view override(ERC721ACommon, ERC2981, AccessControlEnumerable) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol'; /** * @dev Interface of an ERC721A compliant contract. */ interface IERC721A is IERC721, IERC721Metadata { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * The caller cannot approve to their own address. */ error ApproveToCaller(); /** * The caller cannot approve to the current owner. */ error ApprovalToCurrentOwner(); /** * 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(); // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } /** * @dev Returns the total amount of tokens stored by the contract. * * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens. */ function totalSupply() external view returns (uint256); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/utils/Context.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/utils/introspection/ERC165.sol'; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is Context, ERC165, IERC721A { using Address for address; using Strings for uint256; // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _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 _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return _addressData[owner].aux; } /** * Sets the auxillary 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 { _addressData[owner].aux = aux; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _ownershipOf(tokenId).addr; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721A.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner) if(!isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if (to.isContract()) if(!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (to.isContract()) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex < end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @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. */ function _mint(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // 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 { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); address from = prevOwnership.addr; if (approvalCheck) { bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // 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 { AddressData storage addressData = _addressData[from]; addressData.balance -= 1; addressData.numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = from; currSlot.startTimestamp = uint64(block.timestamp); currSlot.burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @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 {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/BitMaps.sol) pragma solidity ^0.8.0; /** * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential. * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor]. */ library BitMaps { struct BitMap { mapping(uint256 => uint256) _data; } /** * @dev Returns whether the bit at `index` is set. */ function get(BitMap storage bitmap, uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); return bitmap._data[bucket] & mask != 0; } /** * @dev Sets the bit at `index` to the boolean `value`. */ function setTo( BitMap storage bitmap, uint256 index, bool value ) internal { if (value) { set(bitmap, index); } else { unset(bitmap, index); } } /** * @dev Sets the bit at `index`. */ function set(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] |= mask; } /** * @dev Unsets the bit at `index`. */ function unset(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] &= ~mask; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `tokenId` must be already minted. * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol) pragma solidity ^0.8.0; import "../token/ERC721/IERC721.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; /// @notice A Pausable contract that can only be toggled by the Owner. contract OwnerPausable is Ownable, Pausable { /// @notice Pauses the contract. function pause() public onlyOwner { Pausable._pause(); } /// @notice Unpauses the contract. function unpause() public onlyOwner { Pausable._unpause(); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; /** @notice Provides monotonic increasing and decreasing values, similar to OpenZeppelin's Counter but (a) limited in direction, and (b) allowing for steps > 1. */ library Monotonic { /** @notice Holds a value that can only increase. @dev The internal value MUST NOT be accessed directly. Instead use current() and add(). */ struct Increaser { uint256 value; } /// @notice Returns the current value of the Increaser. function current(Increaser storage incr) internal view returns (uint256) { return incr.value; } /// @notice Adds x to the Increaser's value. function add(Increaser storage incr, uint256 x) internal { incr.value += x; } /** @notice Holds a value that can only decrease. @dev The internal value MUST NOT be accessed directly. Instead use current() and subtract(). */ struct Decreaser { uint256 value; } /// @notice Returns the current value of the Decreaser. function current(Decreaser storage decr) internal view returns (uint256) { return decr.value; } /// @notice Subtracts x from the Decreaser's value. function subtract(Decreaser storage decr, uint256 x) internal { decr.value -= x; } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; /// @notice A minimal interface describing OpenSea's Wyvern proxy registry. contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } /** @dev This pattern of using an empty contract is cargo-culted directly from OpenSea's example code. TODO: it's likely that the above mapping can be changed to address => address without affecting anything, but further investigation is needed (i.e. is there a subtle reason that OpenSea released it like this?). */ // solhint-disable-next-line no-empty-blocks contract OwnableDelegateProxy { }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; // Inspired by BaseOpenSea by Simon Fremaux (@dievardump) but without the need // to pass specific addresses depending on deployment network. // https://gist.github.com/dievardump/483eb43bc6ed30b14f01e01842e3339b/ import "./ProxyRegistry.sol"; /// @notice Library to achieve gas-free listings on OpenSea. library OpenSeaGasFreeListing { /** @notice Returns whether the operator is an OpenSea proxy for the owner, thus allowing it to list without the token owner paying gas. @dev ERC{721,1155}.isApprovedForAll should be overriden to also check if this function returns true. */ function isApprovedForAll(address owner, address operator) internal view returns (bool) { address proxy = proxyFor(owner); return proxy != address(0) && proxy == operator; } /** @notice Returns the OpenSea proxy address for the owner. */ function proxyFor(address owner) internal view returns (address) { address registry; uint256 chainId; assembly { chainId := chainid() switch chainId // Production networks are placed higher to minimise the number of // checks performed and therefore reduce gas. By the same rationale, // mainnet comes before Polygon as it's more expensive. case 1 { // mainnet registry := 0xa5409ec958c83c3f309868babaca7c86dcb077c1 } case 137 { // polygon registry := 0x58807baD0B376efc12F5AD86aAc70E78ed67deaE } case 4 { // rinkeby registry := 0xf57b2c51ded3a29e6891aba85459d600256cf317 } case 80001 { // mumbai registry := 0xff7Ca10aF37178BdD056628eF42fD7F799fAc77c } case 1337 { // The geth SimulatedBackend iff used with the ethier // openseatest package. This is mocked as a Wyvern proxy as it's // more complex than the 0x ones. registry := 0xE1a2bbc877b29ADBC56D2659DBcb0ae14ee62071 } } // Unlike Wyvern, the registry itself is the proxy for all owners on 0x // chains. if (registry == address(0) || chainId == 137 || chainId == 80001) { return registry; } return address(ProxyRegistry(registry).proxies(owner)); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "../utils/Monotonic.sol"; import "../utils/OwnerPausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; /** @notice An abstract contract providing the _purchase() function to: - Enforce per-wallet / per-transaction limits - Calculate required cost, forwarding to a beneficiary, and refunding extra */ abstract contract Seller is OwnerPausable, ReentrancyGuard { using Address for address payable; using Monotonic for Monotonic.Increaser; using Strings for uint256; /** @dev Note that the address limits are vulnerable to wallet farming. @param maxPerAddress Unlimited if zero. @param maxPerTex Unlimited if zero. @param freeQuota Maximum number that can be purchased free of charge by the contract owner. @param reserveFreeQuota Whether to excplitly reserve the freeQuota amount and not let it be eroded by regular purchases. @param lockFreeQuota If true, calls to setSellerConfig() will ignore changes to freeQuota. Can be locked after initial setting, but not unlocked. This allows a contract owner to commit to a maximum number of reserved items. @param lockTotalInventory Similar to lockFreeQuota but applied to totalInventory. */ struct SellerConfig { uint256 totalInventory; uint256 maxPerAddress; uint256 maxPerTx; uint248 freeQuota; bool reserveFreeQuota; bool lockFreeQuota; bool lockTotalInventory; } constructor(SellerConfig memory config, address payable _beneficiary) { setSellerConfig(config); setBeneficiary(_beneficiary); } /// @notice Configuration of purchase limits. SellerConfig public sellerConfig; /// @notice Sets the seller config. function setSellerConfig(SellerConfig memory config) public onlyOwner { require( config.totalInventory >= config.freeQuota, "Seller: excessive free quota" ); require( config.totalInventory >= _totalSold.current(), "Seller: inventory < already sold" ); require( config.freeQuota >= purchasedFreeOfCharge.current(), "Seller: free quota < already used" ); // Overriding the in-memory fields before copying the whole struct, as // against writing individual fields, gives a greater guarantee of // correctness as the code is simpler to read. if (sellerConfig.lockTotalInventory) { config.lockTotalInventory = true; config.totalInventory = sellerConfig.totalInventory; } if (sellerConfig.lockFreeQuota) { config.lockFreeQuota = true; config.freeQuota = sellerConfig.freeQuota; } sellerConfig = config; } /// @notice Recipient of revenues. address payable public beneficiary; /// @notice Sets the recipient of revenues. function setBeneficiary(address payable _beneficiary) public onlyOwner { beneficiary = _beneficiary; } /** @dev Must return the current cost of a batch of items. This may be constant or, for example, decreasing for a Dutch auction or increasing for a bonding curve. @param n The number of items being purchased. @param metadata Arbitrary data, propagated by the call to _purchase() that can be used to charge different prices. This value is a uint256 instead of bytes as this allows simple passing of a set cost (see ArbitraryPriceSeller). */ function cost(uint256 n, uint256 metadata) public view virtual returns (uint256); /** @dev Called by both _purchase() and purchaseFreeOfCharge() after all limits have been put in place; must perform all contract-specific sale logic, e.g. ERC721 minting. When _handlePurchase() is called, the value returned by Seller.totalSold() will be the pre-purchase amount. @param to The recipient of the item(s). @param n The number of items allowed to be purchased, which MAY be less than to the number passed to _purchase() but SHALL be greater than zero. @param freeOfCharge Indicates that the call originated from purchaseFreeOfCharge() and not _purchase(). */ function _handlePurchase( address to, uint256 n, bool freeOfCharge ) internal virtual; /** @notice Tracks total number of items sold by this contract, including those purchased free of charge by the contract owner. */ Monotonic.Increaser private _totalSold; /// @notice Returns the total number of items sold by this contract. function totalSold() public view returns (uint256) { return _totalSold.current(); } /** @notice Tracks the number of items already bought by an address, regardless of transferring out (in the case of ERC721). @dev This isn't public as it may be skewed due to differences in msg.sender and tx.origin, which it treats in the same way such that sum(_bought)>=totalSold(). */ mapping(address => uint256) private _bought; /** @notice Returns min(n, max(extra items addr can purchase)) and reverts if 0. @param zeroMsg The message with which to revert on 0 extra. */ function _capExtra( uint256 n, address addr, string memory zeroMsg ) internal view returns (uint256) { uint256 extra = sellerConfig.maxPerAddress - _bought[addr]; if (extra == 0) { revert(string(abi.encodePacked("Seller: ", zeroMsg))); } return Math.min(n, extra); } /// @notice Emitted when a buyer is refunded. event Refund(address indexed buyer, uint256 amount); /// @notice Emitted on all purchases of non-zero amount. event Revenue( address indexed beneficiary, uint256 numPurchased, uint256 amount ); /// @notice Tracks number of items purchased free of charge. Monotonic.Increaser private purchasedFreeOfCharge; /** @notice Allows the contract owner to purchase without payment, within the quota enforced by the SellerConfig. */ function purchaseFreeOfCharge(address to, uint256 n) public onlyOwner whenNotPaused { uint256 freeQuota = sellerConfig.freeQuota; n = Math.min(n, freeQuota - purchasedFreeOfCharge.current()); require(n > 0, "Seller: Free quota exceeded"); uint256 totalInventory = sellerConfig.totalInventory; n = Math.min(n, totalInventory - _totalSold.current()); require(n > 0, "Seller: Sold out"); _handlePurchase(to, n, true); _totalSold.add(n); purchasedFreeOfCharge.add(n); assert(_totalSold.current() <= totalInventory); assert(purchasedFreeOfCharge.current() <= freeQuota); } /** @notice Convenience function for calling _purchase() with empty costMetadata when unneeded. */ function _purchase(address to, uint256 requested) internal virtual { _purchase(to, requested, 0); } /** @notice Enforces all purchase limits (counts and costs) before calling _handlePurchase(), after which the received funds are disbursed to the beneficiary, less any required refunds. @param to The final recipient of the item(s). @param requested The number of items requested for purchase, which MAY be reduced when passed to _handlePurchase(). @param costMetadata Arbitrary data, propagated in the call to cost(), to be optionally used in determining the price. */ function _purchase( address to, uint256 requested, uint256 costMetadata ) internal nonReentrant whenNotPaused { /** * ##### CHECKS */ SellerConfig memory config = sellerConfig; uint256 n = config.maxPerTx == 0 ? requested : Math.min(requested, config.maxPerTx); uint256 maxAvailable; uint256 sold; if (config.reserveFreeQuota) { maxAvailable = config.totalInventory - config.freeQuota; sold = _totalSold.current() - purchasedFreeOfCharge.current(); } else { maxAvailable = config.totalInventory; sold = _totalSold.current(); } n = Math.min(n, maxAvailable - sold); require(n > 0, "Seller: Sold out"); if (config.maxPerAddress > 0) { bool alsoLimitSender = _msgSender() != to; // solhint-disable-next-line avoid-tx-origin bool alsoLimitOrigin = tx.origin != _msgSender() && tx.origin != to; n = _capExtra(n, to, "Buyer limit"); if (alsoLimitSender) { n = _capExtra(n, _msgSender(), "Sender limit"); } if (alsoLimitOrigin) { // solhint-disable-next-line avoid-tx-origin n = _capExtra(n, tx.origin, "Origin limit"); } _bought[to] += n; if (alsoLimitSender) { _bought[_msgSender()] += n; } if (alsoLimitOrigin) { // solhint-disable-next-line avoid-tx-origin _bought[tx.origin] += n; } } uint256 _cost = cost(n, costMetadata); if (msg.value < _cost) { revert( string( abi.encodePacked( "Seller: Costs ", (_cost / 1e9).toString(), " GWei" ) ) ); } /** * ##### EFFECTS */ _handlePurchase(to, n, false); _totalSold.add(n); assert(_totalSold.current() <= config.totalInventory); /** * ##### INTERACTIONS */ // Ideally we'd be using a PullPayment here, but the user experience is // poor when there's a variable cost or the number of items purchased // has been capped. We've addressed reentrancy with both a nonReentrant // modifier and the checks, effects, interactions pattern. if (_cost > 0) { beneficiary.sendValue(_cost); emit Revenue(beneficiary, n, _cost); } if (msg.value > _cost) { address payable reimburse = payable(_msgSender()); uint256 refund = msg.value - _cost; // Using Address.sendValue() here would mask the revertMsg upon // reentrancy, but we want to expose it to allow for more precise // testing. This otherwise uses the exact same pattern as // Address.sendValue(). // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returnData) = reimburse.call{ value: refund }(""); // Although `returnData` will have a spurious prefix, all we really // care about is that it contains the ReentrancyGuard reversion // message so we can check in the tests. require(success, string(returnData)); emit Refund(reimburse, refund); } } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "./Seller.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; /// @notice A Seller with a linearly decreasing price. abstract contract LinearDutchAuction is Seller { /** @param unit The unit of "time" used for decreasing prices, block number or timestamp. NOTE: See the comment on AuctionIntervalUnit re use of Time as a unit. @param startPoint The block or timestamp at which the auction opens. A value of zero disables the auction. See setAuctionStartPoint(). @param startPrice The price at `startPoint`. @param decreaseInterval The number of units to wait before decreasing the price. MUST be non-zero. @param decreaseSize The amount by which price decreases after every `decreaseInterval`. @param numDecreases The maximum number of price decreases before remaining constant. The reserve price is therefore implicit and equal to startPrice-numDecrease*decreaseSize. */ struct DutchAuctionConfig { uint256 startPoint; uint256 startPrice; uint256 decreaseInterval; uint256 decreaseSize; // From https://docs.soliditylang.org/en/v0.8.10/types.html#enums "Enums // cannot have more than 256 members"; presumably they take 8 bits, so // use some of the numDecreases space instead. uint248 numDecreases; AuctionIntervalUnit unit; } /** @notice The unit of "time" along which the cost decreases. @dev If no value is provided then the zero UNSPECIFIED will trigger an error. NOTE: The Block unit is more reliable as it has an explicit progression (simply incrementing). Miners are allowed to have a time drift into the future although which predisposes to unexpected behaviour by which "future" costs are encountered. See the ConsenSys 15-second rule: https://consensys.net/blog/developers/solidity-best-practices-for-smart-contract-security/ */ enum AuctionIntervalUnit { UNSPECIFIED, Block, Time } /// @param expectedReserve See setAuctionConfig(). constructor( DutchAuctionConfig memory config, uint256 expectedReserve, Seller.SellerConfig memory sellerConfig, address payable _beneficiary ) Seller(sellerConfig, _beneficiary) { setAuctionConfig(config, expectedReserve); } /// @notice Configuration of price changes. DutchAuctionConfig public dutchAuctionConfig; /** @notice Sets the auction config. @param expectedReserve A safety check that the reserve, as calculated from the config, is as expected. */ function setAuctionConfig( DutchAuctionConfig memory config, uint256 expectedReserve ) public onlyOwner { // Underflow might occur is size/num decreases is too large. unchecked { require( config.startPrice - config.decreaseSize * config.numDecreases == expectedReserve, "LinearDutchAuction: incorrect reserve" ); } require( config.unit != AuctionIntervalUnit.UNSPECIFIED, "LinearDutchAuction: unspecified unit" ); require( config.decreaseInterval > 0, "LinearDutchAuction: zero decrease interval" ); dutchAuctionConfig = config; } /** @notice Sets the config startPoint. A startPoint of zero disables the auction. @dev The auction can be toggle on and off with this function, without the cost of having to update the entire config. */ function setAuctionStartPoint(uint256 startPoint) public onlyOwner { dutchAuctionConfig.startPoint = startPoint; } /** @notice Override of Seller.cost() with Dutch-auction logic. @dev The second parameter, metadata propagated from the call to _purchase(), is ignored. **/ function cost(uint256 n, uint256) public view override returns (uint256) { DutchAuctionConfig storage cfg = dutchAuctionConfig; uint256 current; if (cfg.unit == AuctionIntervalUnit.Block) { current = block.number; } else if (cfg.unit == AuctionIntervalUnit.Time) { // solhint-disable-next-line not-rely-on-time current = block.timestamp; } require( cfg.startPoint != 0 && current >= cfg.startPoint, "LinearDutchAuction: Not started" ); uint256 decreases = Math.min( (current - cfg.startPoint) / cfg.decreaseInterval, cfg.numDecreases ); return n * (cfg.startPrice - decreases * cfg.decreaseSize); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2022 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/interfaces/IERC721.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/structs/BitMaps.sol"; /** @notice Allows holders of ERC721 tokens to redeem rights to some claim; for example, the right to mint a token of some other collection. */ library ERC721Redeemer { using BitMaps for BitMaps.BitMap; using Strings for uint256; /** @notice Storage value to track already-claimed redemptions for a specific token collection. */ struct Claims { /** @dev This field MUST NOT be considered part of the public API. Instead, prefer `using ERC721Redeemer for ERC721Redeemer.Claims` and utilise the provided functions. */ mapping(uint256 => uint256) _total; } /** @notice Storage value to track already-claimed redemptions for a specific token collection, given that there is only a single claim allowed per tokenId. */ struct SingleClaims { /** @dev This field MUST NOT be considered part of the public API. Instead, prefer `using ERC721Redeemer for ERC721Redeemer.SingleClaims` and utilise the provided functions. */ BitMaps.BitMap _claimed; } /** @notice Emitted when a token's claim is redeemed. */ event Redemption( IERC721 indexed token, address indexed redeemer, uint256 tokenId, uint256 n ); /** @notice Checks that the redeemer is allowed to redeem the claims for the tokenIds by being either the owner or approved address for all tokenIds, and updates the Claims to reflect this. @dev For more efficient gas usage, recurring values in tokenIds SHOULD be adjacent to one another as this will batch expensive operations. The simplest way to achieve this is by sorting tokenIds. @param tokenIds The token IDs for which the claims are being redeemed. If maxAllowance > 1 then identical tokenIds can be passed more than once; see dev comments. @return The number of redeemed claims; either 0 or tokenIds.length; */ function redeem( Claims storage claims, uint256 maxAllowance, address redeemer, IERC721 token, uint256[] calldata tokenIds ) internal returns (uint256) { if (maxAllowance == 0 || tokenIds.length == 0) { return 0; } // See comment for `endSameId`. bool multi = maxAllowance > 1; for ( uint256 i = 0; i < tokenIds.length; /* note increment at end */ ) { uint256 tokenId = tokenIds[i]; requireOwnerOrApproved(token, tokenId, redeemer); uint256 n = 1; if (multi) { // If allowed > 1 we can save on expensive operations like // checking ownership / remaining allowance by batching equal // tokenIds. The algorithm assumes that equal IDs are adjacent // in the array. uint256 endSameId; for ( endSameId = i + 1; endSameId < tokenIds.length && tokenIds[endSameId] == tokenId; endSameId++ ) {} // solhint-disable-line no-empty-blocks n = endSameId - i; } claims._total[tokenId] += n; if (claims._total[tokenId] > maxAllowance) { revertWithTokenId( "ERC721Redeemer: over allowance for", tokenId ); } i += n; emit Redemption(token, redeemer, tokenId, n); } return tokenIds.length; } /** @notice Checks that the redeemer is allowed to redeem the single claim for each of the tokenIds by being either the owner or approved address for all tokenIds, and updates the SingleClaims to reflect this. @param tokenIds The token IDs for which the claims are being redeemed. Only a single claim can be made against a tokenId. @return The number of redeemed claims; either 0 or tokenIds.length; */ function redeem( SingleClaims storage claims, address redeemer, IERC721 token, uint256[] calldata tokenIds ) internal returns (uint256) { if (tokenIds.length == 0) { return 0; } for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; requireOwnerOrApproved(token, tokenId, redeemer); if (claims._claimed.get(tokenId)) { revertWithTokenId( "ERC721Redeemer: over allowance for", tokenId ); } claims._claimed.set(tokenId); emit Redemption(token, redeemer, tokenId, 1); } return tokenIds.length; } /** @dev Reverts if neither the owner nor approved for the tokenId. */ function requireOwnerOrApproved( IERC721 token, uint256 tokenId, address redeemer ) private view { if ( token.ownerOf(tokenId) != redeemer && token.getApproved(tokenId) != redeemer ) { revertWithTokenId( "ERC721Redeemer: not approved nor owner of", tokenId ); } } /** @notice Reverts with the concatenation of revertMsg and tokenId.toString(). @dev Used to save gas by constructing the revert message only as required, instead of passing it to require(). */ function revertWithTokenId(string memory revertMsg, uint256 tokenId) private pure { revert(string(abi.encodePacked(revertMsg, " ", tokenId.toString()))); } /** @notice Returns the number of claimed redemptions for the token. */ function claimed(Claims storage claims, uint256 tokenId) internal view returns (uint256) { return claims._total[tokenId]; } /** @notice Returns whether the token has had a claim made against it. */ function claimed(SingleClaims storage claims, uint256 tokenId) internal view returns (bool) { return claims._claimed.get(tokenId); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "../thirdparty/opensea/OpenSeaGasFreeListing.sol"; import "erc721a/contracts/ERC721A.sol"; /// @notice Pre-approval of OpenSea proxies for gas-less listing /// @dev This wrapper allows users to revoke the pre-approval of their /// associated proxy and emits the corresponding events. This is necessary for /// external tools to index approvals correctly and inform the user. /// @dev The pre-approval is triggered on a per-wallet basis during the first /// transfer transactions. It will only be enabled for wallets with an existing /// proxy. Not having a proxy incurs a gas overhead. /// @dev This wrapper optimizes for the following scenario: /// - The majority of users already have a wyvern proxy /// - Most of them want to transfer tokens via wyvern exchanges abstract contract ERC721APreApproval is ERC721A { /// @dev It is important that Active remains at first position, since this /// is the scenario that we are trying to optimize for. enum State { Active, Inactive } /// @notice The state of the pre-approval for a given owner mapping(address => State) private state; /// @dev Returns true if either standard `isApprovedForAll()` or if the /// `operator` is the OpenSea proxy for the `owner` provided the /// pre-approval is active. function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { if (super.isApprovedForAll(owner, operator)) { return true; } return state[owner] == State.Active && OpenSeaGasFreeListing.isApprovedForAll(owner, operator); } /// @dev Uses the standard `setApprovalForAll` or toggles the pre-approval /// state if `operator` is the OpenSea proxy for the sender. function setApprovalForAll(address operator, bool approved) public virtual override { address owner = _msgSender(); if (operator == OpenSeaGasFreeListing.proxyFor(owner)) { state[owner] = approved ? State.Active : State.Inactive; emit ApprovalForAll(owner, operator, approved); } else { super.setApprovalForAll(operator, approved); } } /// @dev Checks if the receiver has an existing proxy. If not, the /// pre-approval is disabled. function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { super._beforeTokenTransfers(from, to, startTokenId, quantity); // Exclude burns and inactive pre-approvals if (to == address(0) || state[to] == State.Inactive) { return; } address operator = OpenSeaGasFreeListing.proxyFor(to); // Disable if `to` has no proxy if (operator == address(0)) { state[to] = State.Inactive; return; } // Avoid emitting unnecessary events. if (balanceOf(to) == 0) { emit ApprovalForAll(to, operator, true); } } }
// SPDX-License-Identifier: MIT // Copyright (c) 2022 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "./ERC721APreApproval.sol"; import "../utils/OwnerPausable.sol"; /** @notice An ERC721A contract with common functionality: - OpenSea gas-free listings - Pausable with toggling functions exposed to Owner only */ contract ERC721ACommon is ERC721APreApproval, OwnerPausable { constructor(string memory name, string memory symbol) ERC721A(name, symbol) {} // solhint-disable-line no-empty-blocks /// @notice Requires that the token exists. modifier tokenExists(uint256 tokenId) { require(ERC721A._exists(tokenId), "ERC721ACommon: Token doesn't exist"); _; } /// @notice Requires that msg.sender owns or is approved for the token. modifier onlyApprovedOrOwner(uint256 tokenId) { require( _ownershipOf(tokenId).addr == _msgSender() || getApproved(tokenId) == _msgSender(), "ERC721ACommon: Not approved nor owner" ); _; } function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual override { require(!paused(), "ERC721ACommon: paused"); super._beforeTokenTransfers(from, to, startTokenId, quantity); } /// @notice Overrides supportsInterface as required by inheritance. function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; /** @notice ERC721 extension that overrides the OpenZeppelin _baseURI() function to return a prefix that can be set by the contract owner. */ contract BaseTokenURI is Ownable { /// @notice Base token URI used as a prefix by tokenURI(). string public baseTokenURI; constructor(string memory _baseTokenURI) { setBaseTokenURI(_baseTokenURI); } /// @notice Sets the base token URI prefix. function setBaseTokenURI(string memory _baseTokenURI) public onlyOwner { baseTokenURI = _baseTokenURI; } /** @notice Concatenates and returns the base token URI and the token ID without any additional characters (e.g. a slash). @dev This requires that an inheriting contract that also inherits from OZ's ERC721 will have to override both contracts; although we could simply require that users implement their own _baseURI() as here, this can easily be forgotten and the current approach guides them with compiler errors. This favours the latter half of "APIs should be easy to use and hard to misuse" from https://www.infoq.com/articles/API-Design-Joshua-Bloch/. */ function _baseURI() internal view virtual returns (string memory) { return baseTokenURI; } }
// SPDX-License-Identifier: MIT // Copyright (c) 2022 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; /** @title SignerManager @notice Manges addition and removal of a core set of addresses from which valid ECDSA signatures can be accepted; see SignatureChecker. */ contract SignerManager is Ownable { using EnumerableSet for EnumerableSet.AddressSet; /** @dev Addresses from which signatures can be accepted. */ EnumerableSet.AddressSet internal signers; /** @notice Add an address to the set of accepted signers. */ function addSigner(address signer) external onlyOwner { signers.add(signer); } /** @notice Remove an address previously added with addSigner(). */ function removeSigner(address signer) external onlyOwner { signers.remove(signer); } }
// SPDX-License-Identifier: MIT // Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier) pragma solidity >=0.8.0 <0.9.0; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; /** @title SignatureChecker @notice Additional functions for EnumerableSet.Addresset that require a valid ECDSA signature of a standardized message, signed by any member of the set. */ library SignatureChecker { using EnumerableSet for EnumerableSet.AddressSet; /** @notice Requires that the message has not been used previously and that the recovered signer is contained in the signers AddressSet. @dev Convenience wrapper for message generation + signature verification + marking message as used @param signers Set of addresses from which signatures are accepted. @param usedMessages Set of already-used messages. @param signature ECDSA signature of message. */ function requireValidSignature( EnumerableSet.AddressSet storage signers, bytes memory data, bytes calldata signature, mapping(bytes32 => bool) storage usedMessages ) internal { bytes32 message = generateMessage(data); require( !usedMessages[message], "SignatureChecker: Message already used" ); usedMessages[message] = true; requireValidSignature(signers, message, signature); } /** @notice Requires that the message has not been used previously and that the recovered signer is contained in the signers AddressSet. @dev Convenience wrapper for message generation + signature verification. */ function requireValidSignature( EnumerableSet.AddressSet storage signers, bytes memory data, bytes calldata signature ) internal view { bytes32 message = generateMessage(data); requireValidSignature(signers, message, signature); } /** @notice Requires that the message has not been used previously and that the recovered signer is contained in the signers AddressSet. @dev Convenience wrapper for message generation from address + signature verification. */ function requireValidSignature( EnumerableSet.AddressSet storage signers, address a, bytes calldata signature ) internal view { bytes32 message = generateMessage(abi.encodePacked(a)); requireValidSignature(signers, message, signature); } /** @notice Common validator logic, checking if the recovered signer is contained in the signers AddressSet. */ function validSignature( EnumerableSet.AddressSet storage signers, bytes32 message, bytes calldata signature ) internal view returns (bool) { return signers.contains(ECDSA.recover(message, signature)); } /** @notice Requires that the recovered signer is contained in the signers AddressSet. @dev Convenience wrapper that reverts if the signature validation fails. */ function requireValidSignature( EnumerableSet.AddressSet storage signers, bytes32 message, bytes calldata signature ) internal view { require( validSignature(signers, message, signature), "SignatureChecker: Invalid signature" ); } /** @notice Generates a message for a given data input that will be signed off-chain using ECDSA. @dev For multiple data fields, a standard concatenation using `abi.encodePacked` is commonly used to build data. */ function generateMessage(bytes memory data) internal pure returns (bytes32) { return ECDSA.toEthSignedMessageHash(data); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"internalType":"address payable","name":"royaltyReceiver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Expelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Refund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"numPurchased","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Revenue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Revved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unrevved","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EXPULSION_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"addSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beneficiary","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"n","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dutchAuctionConfig","outputs":[{"internalType":"uint256","name":"startPoint","type":"uint256"},{"internalType":"uint256","name":"startPrice","type":"uint256"},{"internalType":"uint256","name":"decreaseInterval","type":"uint256"},{"internalType":"uint256","name":"decreaseSize","type":"uint256"},{"internalType":"uint248","name":"numDecreases","type":"uint248"},{"internalType":"enum LinearDutchAuction.AuctionIntervalUnit","name":"unit","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"expelFromRevving","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"address","name":"to","type":"address"},{"internalType":"uint256","name":"num","type":"uint256"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"n","type":"uint256"}],"name":"purchaseFreeOfCharge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"removeSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renderingContract","outputs":[{"internalType":"contract ITokenURIGenerator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revvingOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"revvingPeriod","outputs":[{"internalType":"bool","name":"revving","type":"bool"},{"internalType":"uint256","name":"current","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferWhileRevving","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellerConfig","outputs":[{"internalType":"uint256","name":"totalInventory","type":"uint256"},{"internalType":"uint256","name":"maxPerAddress","type":"uint256"},{"internalType":"uint256","name":"maxPerTx","type":"uint256"},{"internalType":"uint248","name":"freeQuota","type":"uint248"},{"internalType":"bool","name":"reserveFreeQuota","type":"bool"},{"internalType":"bool","name":"lockFreeQuota","type":"bool"},{"internalType":"bool","name":"lockTotalInventory","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"startPoint","type":"uint256"},{"internalType":"uint256","name":"startPrice","type":"uint256"},{"internalType":"uint256","name":"decreaseInterval","type":"uint256"},{"internalType":"uint256","name":"decreaseSize","type":"uint256"},{"internalType":"uint248","name":"numDecreases","type":"uint248"},{"internalType":"enum LinearDutchAuction.AuctionIntervalUnit","name":"unit","type":"uint8"}],"internalType":"struct LinearDutchAuction.DutchAuctionConfig","name":"config","type":"tuple"},{"internalType":"uint256","name":"expectedReserve","type":"uint256"}],"name":"setAuctionConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startPoint","type":"uint256"}],"name":"setAuctionStartPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseTokenURI","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_beneficiary","type":"address"}],"name":"setBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITokenURIGenerator","name":"_contract","type":"address"}],"name":"setRenderingContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"open","type":"bool"}],"name":"setRevvingOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeBasisPoints","type":"uint96"}],"name":"setRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"totalInventory","type":"uint256"},{"internalType":"uint256","name":"maxPerAddress","type":"uint256"},{"internalType":"uint256","name":"maxPerTx","type":"uint256"},{"internalType":"uint248","name":"freeQuota","type":"uint248"},{"internalType":"bool","name":"reserveFreeQuota","type":"bool"},{"internalType":"bool","name":"lockFreeQuota","type":"bool"},{"internalType":"bool","name":"lockTotalInventory","type":"bool"}],"internalType":"struct Seller.SellerConfig","name":"config","type":"tuple"}],"name":"setSellerConfig","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":"tokenIds","type":"uint256[]"}],"name":"toggleRevving","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSold","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405260016022556023805460ff191690553480156200002057600080fd5b5060405162004ed438038062004ed4833981016040819052620000439162000b29565b6040805160c0810182526362ef2ab081526710a741a46278000060208201526109609181019190915267016345785d8a000060608201526006608082015260a081016002815250670853a0d2313c00006040518060e00160405280612710815260200160008152602001600a81526020016127106001600160f81b0316815260200160001515815260200160001515815260200160011515815250848181604051806020016040528060008152508a8a818181600290805190602001906200010d92919062000999565b5080516200012390600390602084019062000999565b505060008055506200013533620001a9565b50506009805460ff60a01b191690556200014f81620001fb565b506001600b55620001608262000263565b6200016b81620004a2565b506200017a905084846200050f565b5050505062000192816101f46200073b60201b60201c565b6200019f6000336200083c565b5050505062000c0a565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6009546001600160a01b031633146200024a5760405162461bcd60e51b8152602060048201819052602482015260008051602062004eb483398151915260448201526064015b60405180910390fd5b80516200025f90600a90602084019062000999565b5050565b6009546001600160a01b03163314620002ae5760405162461bcd60e51b8152602060048201819052602482015260008051602062004eb4833981519152604482015260640162000241565b80606001516001600160f81b031681600001511015620003115760405162461bcd60e51b815260206004820152601c60248201527f53656c6c65723a2065786365737369766520667265652071756f746100000000604482015260640162000241565b6200032860126200087f60201b62001d0f1760201c565b815110156200037a5760405162461bcd60e51b815260206004820181905260248201527f53656c6c65723a20696e76656e746f7279203c20616c726561647920736f6c64604482015260640162000241565b6200039160146200087f60201b62001d0f1760201c565b81606001516001600160f81b03161015620003f95760405162461bcd60e51b815260206004820152602160248201527f53656c6c65723a20667265652071756f7461203c20616c7265616479207573656044820152601960fa1b606482015260840162000241565b601054610100900460ff16156200041757600160c0820152600c5481525b60105460ff16156200043c57600160a0820152600f546001600160f81b031660608201525b8051600c556020810151600d556040810151600e55606081015160808201511515600160f81b026001600160f81b0390911617600f5560a08101516010805460c09093015115156101000261ff00199215159290921661ffff1990931692909217179055565b6009546001600160a01b03163314620004ed5760405162461bcd60e51b8152602060048201819052602482015260008051602062004eb4833981519152604482015260640162000241565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b031633146200055a5760405162461bcd60e51b8152602060048201819052602482015260008051602062004eb4833981519152604482015260640162000241565b8082608001516001600160f81b031683606001510283602001510314620005d25760405162461bcd60e51b815260206004820152602560248201527f4c696e656172447574636841756374696f6e3a20696e636f7272656374207265604482015264736572766560d81b606482015260840162000241565b60008260a001516002811115620005ed57620005ed62000bb8565b03620006485760405162461bcd60e51b8152602060048201526024808201527f4c696e656172447574636841756374696f6e3a20756e737065636966696564206044820152631d5b9a5d60e21b606482015260840162000241565b6000826040015111620006b15760405162461bcd60e51b815260206004820152602a60248201527f4c696e656172447574636841756374696f6e3a207a65726f206465637265617360448201526919481a5b9d195c9d985b60b21b606482015260840162000241565b815160159081556020830151601655604083015160175560608301516018556080830151601980547fff00000000000000000000000000000000000000000000000000000000000000166001600160f81b03909216918217815560a0850151859392909190600160f81b83600281111562000730576200073062000bb8565b021790555050505050565b6127106001600160601b0382161115620007ab5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b606482015260840162000241565b6001600160a01b038216620008035760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640162000241565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601c55565b6200085382826200088360201b62001d131760201c565b6000828152601f602090815260409091206200087a91839062001d9962000927821b17901c565b505050565b5490565b6000828152601e602090815260408083206001600160a01b038516845290915290205460ff166200025f576000828152601e602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620008e33390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006200093e836001600160a01b03841662000947565b90505b92915050565b6000818152600183016020526040812054620009905750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000941565b50600062000941565b828054620009a79062000bce565b90600052602060002090601f016020900481019282620009cb576000855562000a16565b82601f10620009e657805160ff191683800117855562000a16565b8280016001018555821562000a16579182015b8281111562000a16578251825591602001919060010190620009f9565b5062000a2492915062000a28565b5090565b5b8082111562000a24576000815560010162000a29565b634e487b7160e01b600052604160045260246000fd5b600082601f83011262000a6757600080fd5b81516001600160401b038082111562000a845762000a8462000a3f565b604051601f8301601f19908116603f0116810190828211818310171562000aaf5762000aaf62000a3f565b8160405283815260209250868385880101111562000acc57600080fd5b600091505b8382101562000af0578582018301518183018401529082019062000ad1565b8382111562000b025760008385830101525b9695505050505050565b80516001600160a01b038116811462000b2457600080fd5b919050565b6000806000806080858703121562000b4057600080fd5b84516001600160401b038082111562000b5857600080fd5b62000b668883890162000a55565b9550602087015191508082111562000b7d57600080fd5b5062000b8c8782880162000a55565b93505062000b9d6040860162000b0c565b915062000bad6060860162000b0c565b905092959194509250565b634e487b7160e01b600052602160045260246000fd5b600181811c9082168062000be357607f821691505b60208210810362000c0457634e487b7160e01b600052602260045260246000fd5b50919050565b61429a8062000c1a6000396000f3fe6080604052600436106103355760003560e01c8063715018a6116101ab578063bb69b7ef116100f7578063d547741f11610095578063e985e9c51161006f578063e985e9c514610a49578063eb12d61e14610a69578063f2fde38b14610a89578063f5ec598914610aa957600080fd5b8063d547741f146109f4578063d547cfb714610a14578063e0c5b0ed14610a2957600080fd5b8063c85b380d116100d1578063c85b380d14610957578063c87b56dd14610977578063ca15c87314610997578063d017315d146109b757600080fd5b8063bb69b7ef14610887578063bf62e21d14610912578063c7fecbcc1461093257600080fd5b806391d1485411610164578063a217fddf1161013e578063a217fddf14610812578063a22cb46514610827578063b7f1d07214610847578063b88d4fde1461086757600080fd5b806391d14854146107ca57806395d89b41146107ea5780639f93f779146107ff57600080fd5b8063715018a6146106ff5780637bd07f8b146107145780638456cb59146107625780638da5cb5b146107775780639010d07c146107955780639106d7ba146107b557600080fd5b80632f2ff15d11610285578063408bca65116102235780634f9ce53d116101fd5780634f9ce53d146106865780635c975abb146106a05780636352211e146106bf57806370a08231146106df57600080fd5b8063408bca651461061257806340b625c01461063257806342842e0e1461066657600080fd5b806338af3eed1161025f57806338af3eed1461059d57806338e39ac3146105bd5780633ec02e14146105dd5780633f4ba83a146105fd57600080fd5b80632f2ff15d1461053d57806330176e131461055d57806336568abe1461057d57600080fd5b80630e316ab7116102f257806323b872dd116102cc57806323b872dd1461048e578063248a9ca3146104ae5780632a55205a146104de5780632f274bd41461051d57600080fd5b80630e316ab71461042b57806318160ddd1461044b5780631c31f7101461046e57600080fd5b806301ffc9a71461033a57806302fa7c471461036f57806306fdde0314610391578063081812fc146103b357806308a30e52146103eb578063095ea7b31461040b575b600080fd5b34801561034657600080fd5b5061035a6103553660046138b1565b610ac9565b60405190151581526020015b60405180910390f35b34801561037b57600080fd5b5061038f61038a3660046138e3565b610ada565b005b34801561039d57600080fd5b506103a6610b1b565b6040516103669190613980565b3480156103bf57600080fd5b506103d36103ce366004613993565b610bad565b6040516001600160a01b039091168152602001610366565b3480156103f757600080fd5b5061038f6104063660046139c1565b610bf1565b34801561041757600080fd5b5061038f6104263660046139dc565b610c2e565b34801561043757600080fd5b5061038f610446366004613a08565b610cb4565b34801561045757600080fd5b50600154600054035b604051908152602001610366565b34801561047a57600080fd5b5061038f610489366004613a08565b610ce9565b34801561049a57600080fd5b5061038f6104a9366004613a25565b610d35565b3480156104ba57600080fd5b506104606104c9366004613993565b6000908152601e602052604090206001015490565b3480156104ea57600080fd5b506104fe6104f9366004613a66565b610d40565b604080516001600160a01b039093168352602083019190915201610366565b34801561052957600080fd5b5061038f610538366004613b0d565b610dec565b34801561054957600080fd5b5061038f610558366004613ba9565b610fda565b34801561056957600080fd5b5061038f610578366004613c33565b610fff565b34801561058957600080fd5b5061038f610598366004613ba9565b61103c565b3480156105a957600080fd5b506011546103d3906001600160a01b031681565b3480156105c957600080fd5b5061038f6105d8366004613a25565b6110b6565b3480156105e957600080fd5b506104606105f8366004613a66565b611128565b34801561060957600080fd5b5061038f61124c565b34801561061e57600080fd5b5061038f61062d366004613c7b565b611280565b34801561063e57600080fd5b506104607f7904e9328f622335e3d715af4f9d4b4147d279485bd5be001b80efa4da608a2981565b34801561067257600080fd5b5061038f610681366004613a25565b6112c3565b34801561069257600080fd5b5060235461035a9060ff1681565b3480156106ac57600080fd5b50600954600160a01b900460ff1661035a565b3480156106cb57600080fd5b506103d36106da366004613993565b6112de565b3480156106eb57600080fd5b506104606106fa366004613a08565b6112f0565b34801561070b57600080fd5b5061038f61133e565b34801561072057600080fd5b5060155460165460175460185460195461075094939291906001600160f81b03811690600160f81b900460ff1686565b60405161036696959493929190613d05565b34801561076e57600080fd5b5061038f611372565b34801561078357600080fd5b506009546001600160a01b03166103d3565b3480156107a157600080fd5b506103d36107b0366004613a66565b6113a4565b3480156107c157600080fd5b506104606113c3565b3480156107d657600080fd5b5061035a6107e5366004613ba9565b6113d3565b3480156107f657600080fd5b506103a66113fe565b61038f61080d3660046139dc565b61140d565b34801561081e57600080fd5b50610460600081565b34801561083357600080fd5b5061038f610842366004613d5f565b611417565b34801561085357600080fd5b5061038f610862366004613a08565b6114dc565b34801561087357600080fd5b5061038f610882366004613d94565b61152e565b34801561089357600080fd5b50600c54600d54600e54600f546010546108cf949392916001600160f81b0381169160ff600160f81b9092048216918181169161010090041687565b604080519788526020880196909652948601939093526001600160f81b03909116606085015215156080840152151560a0830152151560c082015260e001610366565b34801561091e57600080fd5b5061038f61092d3660046139dc565b611572565b34801561093e57600080fd5b506023546103d39061010090046001600160a01b031681565b34801561096357600080fd5b5061038f610972366004613e13565b6116e7565b34801561098357600080fd5b506103a6610992366004613993565b6118ce565b3480156109a357600080fd5b506104606109b2366004613993565b611965565b3480156109c357600080fd5b506109d76109d2366004613993565b61197c565b604080519315158452602084019290925290820152606001610366565b348015610a0057600080fd5b5061038f610a0f366004613ba9565b6119c7565b348015610a2057600080fd5b506103a66119ec565b348015610a3557600080fd5b5061038f610a44366004613993565b611a7a565b348015610a5557600080fd5b5061035a610a64366004613e96565b611aa9565b348015610a7557600080fd5b5061038f610a84366004613a08565b611b20565b348015610a9557600080fd5b5061038f610aa4366004613a08565b611b55565b348015610ab557600080fd5b5061038f610ac4366004613993565b611bf0565b6000610ad482611dae565b92915050565b6009546001600160a01b03163314610b0d5760405162461bcd60e51b8152600401610b0490613ec4565b60405180910390fd5b610b178282611dd3565b5050565b606060028054610b2a90613ef9565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5690613ef9565b8015610ba35780601f10610b7857610100808354040283529160200191610ba3565b820191906000526020600020905b815481529060010190602001808311610b8657829003601f168201915b5050505050905090565b6000610bb882611ed0565b610bd5576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6009546001600160a01b03163314610c1b5760405162461bcd60e51b8152600401610b0490613ec4565b6023805460ff1916911515919091179055565b6000610c39826112de565b9050806001600160a01b0316836001600160a01b031603610c6d5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614610ca457610c878133611aa9565b610ca4576040516367d9dca160e11b815260040160405180910390fd5b610caf838383611efb565b505050565b6009546001600160a01b03163314610cde5760405162461bcd60e51b8152600401610b0490613ec4565b610b17601a82611f57565b6009546001600160a01b03163314610d135760405162461bcd60e51b8152600401610b0490613ec4565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b610caf838383611f6c565b6000828152601d602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610db5575060408051808201909152601c546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610dd4906001600160601b031687613f49565b610dde9190613f7e565b915196919550909350505050565b6009546001600160a01b03163314610e165760405162461bcd60e51b8152600401610b0490613ec4565b80606001516001600160f81b031681600001511015610e775760405162461bcd60e51b815260206004820152601c60248201527f53656c6c65723a2065786365737369766520667265652071756f7461000000006044820152606401610b04565b60125481511015610eca5760405162461bcd60e51b815260206004820181905260248201527f53656c6c65723a20696e76656e746f7279203c20616c726561647920736f6c646044820152606401610b04565b60145481606001516001600160f81b03161015610f335760405162461bcd60e51b815260206004820152602160248201527f53656c6c65723a20667265652071756f7461203c20616c7265616479207573656044820152601960fa1b6064820152608401610b04565b601054610100900460ff1615610f5057600160c0820152600c5481525b60105460ff1615610f7457600160a0820152600f546001600160f81b031660608201525b8051600c556020810151600d556040810151600e55606081015160808201511515600160f81b026001600160f81b0390911617600f5560a08101516010805460c09093015115156101000261ff00199215159290921661ffff1990931692909217179055565b6000828152601e6020526040902060010154610ff581612166565b610caf8383612170565b6009546001600160a01b031633146110295760405162461bcd60e51b8152600401610b0490613ec4565b8051610b1790600a906020840190613802565b6001600160a01b03811633146110ac5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b04565b610b178282612192565b336110c0826112de565b6001600160a01b03161461110e5760405162461bcd60e51b81526020600482015260156024820152742137b9b7aa37b5bcb79d1027b7363c9037bbb732b960591b6044820152606401610b04565b600260225561111e8383836112c3565b5050600160225550565b600060158160016004830154600160f81b900460ff16600281111561114f5761114f613cef565b0361115b575043611185565b60026004830154600160f81b900460ff16600281111561117d5761117d613cef565b036111855750425b815415801590611196575081548110155b6111e25760405162461bcd60e51b815260206004820152601f60248201527f4c696e656172447574636841756374696f6e3a204e6f742073746172746564006044820152606401610b04565b60028201548254600091611217916111fa9085613f92565b6112049190613f7e565b60048501546001600160f81b03166121b4565b90508260030154816112299190613f49565b83600101546112389190613f92565b6112429087613f49565b9695505050505050565b6009546001600160a01b031633146112765760405162461bcd60e51b8152600401610b0490613ec4565b61127e6121ca565b565b8060005b818110156112bd576112ad8484838181106112a1576112a1613fa9565b90506020020135612267565b6112b681613fbf565b9050611284565b50505050565b610caf8383836040518060200160405280600081525061152e565b60006112e9826123ff565b5192915050565b60006001600160a01b038216611319576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6009546001600160a01b031633146113685760405162461bcd60e51b8152600401610b0490613ec4565b61127e6000612519565b6009546001600160a01b0316331461139c5760405162461bcd60e51b8152600401610b0490613ec4565b61127e61256b565b6000828152601f602052604081206113bc90836125d0565b9392505050565b60006113ce60125490565b905090565b6000918252601e602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060038054610b2a90613ef9565b610b1782826125dc565b33611421816125e8565b6001600160a01b0316836001600160a01b0316036114d25781611445576001611448565b60005b6001600160a01b0382166000908152600860205260409020805460ff19166001838181111561147957611479613cef565b0217905550826001600160a01b0316816001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31846040516114c5911515815260200190565b60405180910390a3505050565b610caf8383612747565b6009546001600160a01b031633146115065760405162461bcd60e51b8152600401610b0490613ec4565b602380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b611539848484611f6c565b6001600160a01b0383163b156112bd57611555848484846127dc565b6112bd576040516368d2bf6b60e11b815260040160405180910390fd5b6009546001600160a01b0316331461159c5760405162461bcd60e51b8152600401610b0490613ec4565b600954600160a01b900460ff16156115c65760405162461bcd60e51b8152600401610b0490613fd8565b600f546001600160f81b03166115ee826115df60145490565b6115e99084613f92565b6121b4565b9150600082116116405760405162461bcd60e51b815260206004820152601b60248201527f53656c6c65723a20467265652071756f746120657863656564656400000000006044820152606401610b04565b600c54611650836115df60125490565b9250600083116116955760405162461bcd60e51b815260206004820152601060248201526f14d95b1b195c8e8814dbdb19081bdd5d60821b6044820152606401610b04565b6116a1848460016128c7565b6116ac6012846128ef565b6116b76014846128ef565b806116c160125490565b11156116cf576116cf614002565b816116d960145490565b11156112bd576112bd614002565b6009546001600160a01b031633146117115760405162461bcd60e51b8152600401610b0490613ec4565b8082608001516001600160f81b0316836060015102836020015103146117875760405162461bcd60e51b815260206004820152602560248201527f4c696e656172447574636841756374696f6e3a20696e636f7272656374207265604482015264736572766560d81b6064820152608401610b04565b60008260a00151600281111561179f5761179f613cef565b036117f85760405162461bcd60e51b8152602060048201526024808201527f4c696e656172447574636841756374696f6e3a20756e737065636966696564206044820152631d5b9a5d60e21b6064820152608401610b04565b600082604001511161185f5760405162461bcd60e51b815260206004820152602a60248201527f4c696e656172447574636841756374696f6e3a207a65726f206465637265617360448201526919481a5b9d195c9d985b60b21b6064820152608401610b04565b815160159081556020830151601655604083015160175560608301516018556080830151601980546001600160f81b0319166001600160f81b03909216918217815560a0850151859392909190600160f81b8360028111156118c3576118c3613cef565b021790555050505050565b60235460609061010090046001600160a01b03161561195c5760235460405163c87b56dd60e01b8152600481018490526101009091046001600160a01b03169063c87b56dd90602401600060405180830381865afa158015611934573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ad49190810190614018565b610ad48261290c565b6000818152601f60205260408120610ad49061298f565b60008181526020805260408120548190819080156119a557600193506119a28142613f92565b92505b6000858152602160205260409020546119be9084614085565b93959294505050565b6000828152601e60205260409020600101546119e281612166565b610caf8383612192565b600a80546119f990613ef9565b80601f0160208091040260200160405190810160405280929190818152602001828054611a2590613ef9565b8015611a725780601f10611a4757610100808354040283529160200191611a72565b820191906000526020600020905b815481529060010190602001808311611a5557829003601f168201915b505050505081565b6009546001600160a01b03163314611aa45760405162461bcd60e51b8152600401610b0490613ec4565b601555565b6001600160a01b03808316600090815260076020908152604080832093851683529290529081205460ff1615611ae157506001610ad4565b6001600160a01b03831660009081526008602052604081205460ff166001811115611b0e57611b0e613cef565b1480156113bc57506113bc8383612999565b6009546001600160a01b03163314611b4a5760405162461bcd60e51b8152600401610b0490613ec4565b610b17601a82611d99565b6009546001600160a01b03163314611b7f5760405162461bcd60e51b8152600401610b0490613ec4565b6001600160a01b038116611be45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b04565b611bed81612519565b50565b7f7904e9328f622335e3d715af4f9d4b4147d279485bd5be001b80efa4da608a29611c1a81612166565b60008281526020805260408120549003611c6e5760405162461bcd60e51b8152602060048201526015602482015274109bdcdbd51bdade5bce881b9bdd081c995d9d9959605a1b6044820152606401610b04565b6000828152602080526040902054611c869042613f92565b60008381526021602052604081208054909190611ca4908490614085565b909155505060008281526020805260408082208290555183917f7077956e4319f76b3034df8947246abc73ad8bf6046fba870be6cec7b7feda7c91a260405182907f3ebee94e74ea24f711b5876dca724062e18b7b37b6883e686a92f093248a4fcf90600090a25050565b5490565b611d1d82826113d3565b610b17576000828152601e602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611d553390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006113bc836001600160a01b0384166129d7565b60006001600160e01b03198216635a05180f60e01b1480610ad45750610ad482612a26565b6127106001600160601b0382161115611e415760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610b04565b6001600160a01b038216611e975760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610b04565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601c55565b6000805482108015610ad4575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006113bc836001600160a01b038416612a4b565b6000611f77826123ff565b9050836001600160a01b031681600001516001600160a01b031614611fae5760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611fcc5750611fcc8533611aa9565b80611fe7575033611fdc84610bad565b6001600160a01b0316145b90508061200757604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03841661202e57604051633a954ecd60e21b815260040160405180910390fd5b61203b8585856001612b3e565b61204760008487611efb565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b4290921691909102178355870180845292208054919390911661211b57600054821461211b57805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b611bed8133612bcb565b61217a8282611d13565b6000828152601f60205260409020610caf9082611d99565b61219c8282612c2f565b6000828152601f60205260409020610caf9082611f57565b60008183106121c357816113bc565b5090919050565b600954600160a01b900460ff1661221a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b04565b6009805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b8033612272826123ff565b516001600160a01b0316148061229857503361228d82610bad565b6001600160a01b0316145b6122f25760405162461bcd60e51b815260206004820152602560248201527f45524337323141436f6d6d6f6e3a204e6f7420617070726f766564206e6f722060448201526437bbb732b960d91b6064820152608401610b04565b6000828152602080526040812054908190036123965760235460ff1661235a5760405162461bcd60e51b815260206004820152601960248201527f426f736f546f6b796f3a2072657676696e6720636c6f736564000000000000006044820152606401610b04565b60008381526020805260408082204290555184917f1995f526bf899c52ff9f616c286f1f0d71293afde3a1d72b0193829b5a67d07491a2505050565b6123a08142613f92565b600084815260216020526040812080549091906123be908490614085565b909155505060008381526020805260408082208290555184917f7077956e4319f76b3034df8947246abc73ad8bf6046fba870be6cec7b7feda7c91a2505050565b60408051606081018252600080825260208201819052918101919091528160005481101561250057600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906124fe5780516001600160a01b031615612495579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff16151592810192909252156124f9579392505050565b612495565b505b604051636f96cda160e11b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a01b900460ff16156125955760405162461bcd60e51b8152600401610b0490613fd8565b6009805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861224a3390565b60006113bc8383612c96565b610b1782826000612cc0565b60008046806001811461261d576089811461263957600481146126555762013881811461267157610539811461268d576126a5565b73a5409ec958c83c3f309868babaca7c86dcb077c192506126a5565b7358807bad0b376efc12f5ad86aac70e78ed67deae92506126a5565b73f57b2c51ded3a29e6891aba85459d600256cf31792506126a5565b73ff7ca10af37178bdd056628ef42fd7f799fac77c92506126a5565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b03821615806126bc5750806089145b806126c957508062013881145b156126d5575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa15801561271b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061273f919061409d565b949350505050565b336001600160a01b038316036127705760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906128119033908990889088906004016140ba565b6020604051808303816000875af192505050801561284c575060408051601f3d908101601f19168201909252612849918101906140ed565b60015b6128aa573d80801561287a576040519150601f19603f3d011682016040523d82523d6000602084013e61287f565b606091505b5080516000036128a2576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6128d18383613177565b6127106128e16001546000540390565b1115610caf57610caf614002565b808260000160008282546129039190614085565b90915550505050565b606061291782611ed0565b61293457604051630a14c4b560e41b815260040160405180910390fd5b600061293e613191565b9050805160000361295e57604051806020016040528060008152506113bc565b806129688461319b565b60405160200161297992919061410a565b6040516020818303038152906040529392505050565b6000610ad4825490565b6000806129a5846125e8565b90506001600160a01b0381161580159061273f5750826001600160a01b0316816001600160a01b031614949350505050565b6000818152600183016020526040812054612a1e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610ad4565b506000610ad4565b60006001600160e01b03198216637965db0b60e01b1480610ad45750610ad48261329b565b60008181526001830160205260408120548015612b34576000612a6f600183613f92565b8554909150600090612a8390600190613f92565b9050818114612ae8576000866000018281548110612aa357612aa3613fa9565b9060005260206000200154905080876000018481548110612ac657612ac6613fa9565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612af957612af9614139565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610ad4565b6000915050610ad4565b816000612b4b8383614085565b90505b80821015612bc35760008281526020805260409020541580612b7257506022546002145b612bb35760405162461bcd60e51b8152602060048201526012602482015271426f736f546f6b796f3a2072657676696e6760701b6044820152606401610b04565b612bbc82613fbf565b9150612b4e565b505050505050565b612bd582826113d3565b610b1757612bed816001600160a01b031660146132c0565b612bf88360206132c0565b604051602001612c0992919061414f565b60408051601f198184030181529082905262461bcd60e51b8252610b0491600401613980565b612c3982826113d3565b15610b17576000828152601e602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000826000018281548110612cad57612cad613fa9565b9060005260206000200154905092915050565b6002600b5403612d125760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b04565b6002600b55600954600160a01b900460ff1615612d415760405162461bcd60e51b8152600401610b0490613fd8565b6040805160e081018252600c548152600d546020820152600e54918101829052600f546001600160f81b038116606083015260ff600160f81b909104811615156080830152601054808216151560a0840152610100900416151560c08201529060009015612dbc57612db78483604001516121b4565b612dbe565b835b9050600080836080015115612e065760608401518451612de7916001600160f81b031690613f92565b9150612df260145490565b601254612dff9190613f92565b9050612e16565b83519150612e1360125490565b90505b612e24836115e98385613f92565b925060008311612e695760405162461bcd60e51b815260206004820152601060248201526f14d95b1b195c8e8814dbdb19081bdd5d60821b6044820152606401610b04565b602084015115612fc557336001600160a01b038816811415906000903214801590612e9d5750326001600160a01b038a1614155b9050612ecd858a6040518060400160405280600b81526020016a109d5e595c881b1a5b5a5d60aa1b81525061345b565b94508115612f0757612f0485336040518060400160405280600c81526020016b14d95b99195c881b1a5b5a5d60a21b81525061345b565b94505b8015612f3f57612f3c85326040518060400160405280600c81526020016b13dc9a59da5b881b1a5b5a5d60a21b81525061345b565b94505b6001600160a01b03891660009081526013602052604081208054879290612f67908490614085565b90915550508115612f97573360009081526013602052604081208054879290612f91908490614085565b90915550505b8015612fc2573260009081526013602052604081208054879290612fbc908490614085565b90915550505b50505b6000612fd18487611128565b90508034101561300157612ff1612fec633b9aca0083613f7e565b61319b565b604051602001612c0991906141c4565b61300d888560006128c7565b6130186012856128ef565b8451601254111561302b5761302b614002565b801561309057601154613047906001600160a01b0316826134b0565b60115460408051868152602081018490526001600160a01b03909216917f01f51b99bd1c3cca301836178e5dee13aadfe44eff06dc3ddcbf3c9d058454f8910160405180910390a25b80341115613168573360006130a58334613f92565b9050600080836001600160a01b03168360405160006040518083038185875af1925050503d80600081146130f5576040519150601f19603f3d011682016040523d82523d6000602084013e6130fa565b606091505b509150915081819061311f5760405162461bcd60e51b8152600401610b049190613980565b50836001600160a01b03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d8460405161315b91815260200190565b60405180910390a2505050505b50506001600b55505050505050565b610b178282604051806020016040528060008152506135c9565b60606113ce61379d565b6060816000036131c25750506040805180820190915260018152600360fc1b602082015290565b8160005b81156131ec57806131d681613fbf565b91506131e59050600a83613f7e565b91506131c6565b6000816001600160401b0381111561320657613206613a88565b6040519080825280601f01601f191660200182016040528015613230576020820181803683370190505b5090505b841561273f57613245600183613f92565b9150613252600a86614209565b61325d906030614085565b60f81b81838151811061327257613272613fa9565b60200101906001600160f81b031916908160001a905350613294600a86613f7e565b9450613234565b60006001600160e01b0319821663152a902d60e11b1480610ad45750610ad4826137ac565b606060006132cf836002613f49565b6132da906002614085565b6001600160401b038111156132f1576132f1613a88565b6040519080825280601f01601f19166020018201604052801561331b576020820181803683370190505b509050600360fc1b8160008151811061333657613336613fa9565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061336557613365613fa9565b60200101906001600160f81b031916908160001a9053506000613389846002613f49565b613394906001614085565b90505b600181111561340c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106133c8576133c8613fa9565b1a60f81b8282815181106133de576133de613fa9565b60200101906001600160f81b031916908160001a90535060049490941c936134058161421d565b9050613397565b5083156113bc5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b04565b6001600160a01b038216600090815260136020526040812054600d54829161348291613f92565b90508060000361349d5782604051602001612c099190614234565b6134a785826121b4565b95945050505050565b804710156135005760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b04565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461354d576040519150601f19603f3d011682016040523d82523d6000602084013e613552565b606091505b5050905080610caf5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b04565b6000546001600160a01b0384166135f257604051622e076360e81b815260040160405180910390fd5b826000036136135760405163b562e8dd60e01b815260040160405180910390fd5b6136206000858386612b3e565b6001600160a01b038416600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168b0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168b01811690920217909155858452600490925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b15613748575b60405182906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461371160008784806001019550876127dc565b61372e576040516368d2bf6b60e11b815260040160405180910390fd5b8082106136c657826000541461374357600080fd5b61378d565b5b6040516001830192906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808210613749575b5060009081556112bd9085838684565b6060600a8054610b2a90613ef9565b6000610ad48260006001600160e01b031982166380ac58cd60e01b14806137e357506001600160e01b03198216635b5e139f60e01b145b80610ad457506301ffc9a760e01b6001600160e01b0319831614610ad4565b82805461380e90613ef9565b90600052602060002090601f0160209004810192826138305760008555613876565b82601f1061384957805160ff1916838001178555613876565b82800160010185558215613876579182015b8281111561387657825182559160200191906001019061385b565b50613882929150613886565b5090565b5b808211156138825760008155600101613887565b6001600160e01b031981168114611bed57600080fd5b6000602082840312156138c357600080fd5b81356113bc8161389b565b6001600160a01b0381168114611bed57600080fd5b600080604083850312156138f657600080fd5b8235613901816138ce565b915060208301356001600160601b038116811461391d57600080fd5b809150509250929050565b60005b8381101561394357818101518382015260200161392b565b838111156112bd5750506000910152565b6000815180845261396c816020860160208601613928565b601f01601f19169290920160200192915050565b6020815260006113bc6020830184613954565b6000602082840312156139a557600080fd5b5035919050565b803580151581146139bc57600080fd5b919050565b6000602082840312156139d357600080fd5b6113bc826139ac565b600080604083850312156139ef57600080fd5b82356139fa816138ce565b946020939093013593505050565b600060208284031215613a1a57600080fd5b81356113bc816138ce565b600080600060608486031215613a3a57600080fd5b8335613a45816138ce565b92506020840135613a55816138ce565b929592945050506040919091013590565b60008060408385031215613a7957600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b0381118282101715613ac057613ac0613a88565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613aee57613aee613a88565b604052919050565b80356001600160f81b03811681146139bc57600080fd5b600060e08284031215613b1f57600080fd5b60405160e081018181106001600160401b0382111715613b4157613b41613a88565b8060405250823581526020830135602082015260408301356040820152613b6a60608401613af6565b6060820152613b7b608084016139ac565b6080820152613b8c60a084016139ac565b60a0820152613b9d60c084016139ac565b60c08201529392505050565b60008060408385031215613bbc57600080fd5b82359150602083013561391d816138ce565b60006001600160401b03821115613be757613be7613a88565b50601f01601f191660200190565b6000613c08613c0384613bce565b613ac6565b9050828152838383011115613c1c57600080fd5b828260208301376000602084830101529392505050565b600060208284031215613c4557600080fd5b81356001600160401b03811115613c5b57600080fd5b8201601f81018413613c6c57600080fd5b61273f84823560208401613bf5565b60008060208385031215613c8e57600080fd5b82356001600160401b0380821115613ca557600080fd5b818501915085601f830112613cb957600080fd5b813581811115613cc857600080fd5b8660208260051b8501011115613cdd57600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052602160045260246000fd5b8681526020810186905260408101859052606081018490526001600160f81b038316608082015260c0810160038310613d4e57634e487b7160e01b600052602160045260246000fd5b8260a0830152979650505050505050565b60008060408385031215613d7257600080fd5b8235613d7d816138ce565b9150613d8b602084016139ac565b90509250929050565b60008060008060808587031215613daa57600080fd5b8435613db5816138ce565b93506020850135613dc5816138ce565b92506040850135915060608501356001600160401b03811115613de757600080fd5b8501601f81018713613df857600080fd5b613e0787823560208401613bf5565b91505092959194509250565b60008082840360e0811215613e2757600080fd5b60c0811215613e3557600080fd5b50613e3e613a9e565b83358152602084013560208201526040840135604082015260608401356060820152613e6c60808501613af6565b608082015260a084013560038110613e8357600080fd5b60a08201529460c0939093013593505050565b60008060408385031215613ea957600080fd5b8235613eb4816138ce565b9150602083013561391d816138ce565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680613f0d57607f821691505b602082108103613f2d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615613f6357613f63613f33565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613f8d57613f8d613f68565b500490565b600082821015613fa457613fa4613f33565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201613fd157613fd1613f33565b5060010190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052600160045260246000fd5b60006020828403121561402a57600080fd5b81516001600160401b0381111561404057600080fd5b8201601f8101841361405157600080fd5b805161405f613c0382613bce565b81815285602083850101111561407457600080fd5b6134a7826020830160208601613928565b6000821982111561409857614098613f33565b500190565b6000602082840312156140af57600080fd5b81516113bc816138ce565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061124290830184613954565b6000602082840312156140ff57600080fd5b81516113bc8161389b565b6000835161411c818460208801613928565b835190830190614130818360208801613928565b01949350505050565b634e487b7160e01b600052603160045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614187816017850160208801613928565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516141b8816028840160208801613928565b01602801949350505050565b6d029b2b63632b91d1021b7b9ba39960951b8152600082516141ed81600e850160208701613928565b64204757656960d81b600e939091019283015250601301919050565b60008261421857614218613f68565b500690565b60008161422c5761422c613f33565b506000190190565b67029b2b63632b91d160c51b815260008251614257816008850160208701613928565b919091016008019291505056fea2646970667358221220a30eb57a58113b02307d878366527a2a1a5461efcfee9492536aa600d2f2187364736f6c634300080d00334f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000f7ea51d1a06bcfb7ed3b1095e65b194ebd040ad0000000000000000000000000f7ea51d1a06bcfb7ed3b1095e65b194ebd040ad0000000000000000000000000000000000000000000000000000000000000009424f534f544f4b594f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009424f534f544f4b454e0000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103355760003560e01c8063715018a6116101ab578063bb69b7ef116100f7578063d547741f11610095578063e985e9c51161006f578063e985e9c514610a49578063eb12d61e14610a69578063f2fde38b14610a89578063f5ec598914610aa957600080fd5b8063d547741f146109f4578063d547cfb714610a14578063e0c5b0ed14610a2957600080fd5b8063c85b380d116100d1578063c85b380d14610957578063c87b56dd14610977578063ca15c87314610997578063d017315d146109b757600080fd5b8063bb69b7ef14610887578063bf62e21d14610912578063c7fecbcc1461093257600080fd5b806391d1485411610164578063a217fddf1161013e578063a217fddf14610812578063a22cb46514610827578063b7f1d07214610847578063b88d4fde1461086757600080fd5b806391d14854146107ca57806395d89b41146107ea5780639f93f779146107ff57600080fd5b8063715018a6146106ff5780637bd07f8b146107145780638456cb59146107625780638da5cb5b146107775780639010d07c146107955780639106d7ba146107b557600080fd5b80632f2ff15d11610285578063408bca65116102235780634f9ce53d116101fd5780634f9ce53d146106865780635c975abb146106a05780636352211e146106bf57806370a08231146106df57600080fd5b8063408bca651461061257806340b625c01461063257806342842e0e1461066657600080fd5b806338af3eed1161025f57806338af3eed1461059d57806338e39ac3146105bd5780633ec02e14146105dd5780633f4ba83a146105fd57600080fd5b80632f2ff15d1461053d57806330176e131461055d57806336568abe1461057d57600080fd5b80630e316ab7116102f257806323b872dd116102cc57806323b872dd1461048e578063248a9ca3146104ae5780632a55205a146104de5780632f274bd41461051d57600080fd5b80630e316ab71461042b57806318160ddd1461044b5780631c31f7101461046e57600080fd5b806301ffc9a71461033a57806302fa7c471461036f57806306fdde0314610391578063081812fc146103b357806308a30e52146103eb578063095ea7b31461040b575b600080fd5b34801561034657600080fd5b5061035a6103553660046138b1565b610ac9565b60405190151581526020015b60405180910390f35b34801561037b57600080fd5b5061038f61038a3660046138e3565b610ada565b005b34801561039d57600080fd5b506103a6610b1b565b6040516103669190613980565b3480156103bf57600080fd5b506103d36103ce366004613993565b610bad565b6040516001600160a01b039091168152602001610366565b3480156103f757600080fd5b5061038f6104063660046139c1565b610bf1565b34801561041757600080fd5b5061038f6104263660046139dc565b610c2e565b34801561043757600080fd5b5061038f610446366004613a08565b610cb4565b34801561045757600080fd5b50600154600054035b604051908152602001610366565b34801561047a57600080fd5b5061038f610489366004613a08565b610ce9565b34801561049a57600080fd5b5061038f6104a9366004613a25565b610d35565b3480156104ba57600080fd5b506104606104c9366004613993565b6000908152601e602052604090206001015490565b3480156104ea57600080fd5b506104fe6104f9366004613a66565b610d40565b604080516001600160a01b039093168352602083019190915201610366565b34801561052957600080fd5b5061038f610538366004613b0d565b610dec565b34801561054957600080fd5b5061038f610558366004613ba9565b610fda565b34801561056957600080fd5b5061038f610578366004613c33565b610fff565b34801561058957600080fd5b5061038f610598366004613ba9565b61103c565b3480156105a957600080fd5b506011546103d3906001600160a01b031681565b3480156105c957600080fd5b5061038f6105d8366004613a25565b6110b6565b3480156105e957600080fd5b506104606105f8366004613a66565b611128565b34801561060957600080fd5b5061038f61124c565b34801561061e57600080fd5b5061038f61062d366004613c7b565b611280565b34801561063e57600080fd5b506104607f7904e9328f622335e3d715af4f9d4b4147d279485bd5be001b80efa4da608a2981565b34801561067257600080fd5b5061038f610681366004613a25565b6112c3565b34801561069257600080fd5b5060235461035a9060ff1681565b3480156106ac57600080fd5b50600954600160a01b900460ff1661035a565b3480156106cb57600080fd5b506103d36106da366004613993565b6112de565b3480156106eb57600080fd5b506104606106fa366004613a08565b6112f0565b34801561070b57600080fd5b5061038f61133e565b34801561072057600080fd5b5060155460165460175460185460195461075094939291906001600160f81b03811690600160f81b900460ff1686565b60405161036696959493929190613d05565b34801561076e57600080fd5b5061038f611372565b34801561078357600080fd5b506009546001600160a01b03166103d3565b3480156107a157600080fd5b506103d36107b0366004613a66565b6113a4565b3480156107c157600080fd5b506104606113c3565b3480156107d657600080fd5b5061035a6107e5366004613ba9565b6113d3565b3480156107f657600080fd5b506103a66113fe565b61038f61080d3660046139dc565b61140d565b34801561081e57600080fd5b50610460600081565b34801561083357600080fd5b5061038f610842366004613d5f565b611417565b34801561085357600080fd5b5061038f610862366004613a08565b6114dc565b34801561087357600080fd5b5061038f610882366004613d94565b61152e565b34801561089357600080fd5b50600c54600d54600e54600f546010546108cf949392916001600160f81b0381169160ff600160f81b9092048216918181169161010090041687565b604080519788526020880196909652948601939093526001600160f81b03909116606085015215156080840152151560a0830152151560c082015260e001610366565b34801561091e57600080fd5b5061038f61092d3660046139dc565b611572565b34801561093e57600080fd5b506023546103d39061010090046001600160a01b031681565b34801561096357600080fd5b5061038f610972366004613e13565b6116e7565b34801561098357600080fd5b506103a6610992366004613993565b6118ce565b3480156109a357600080fd5b506104606109b2366004613993565b611965565b3480156109c357600080fd5b506109d76109d2366004613993565b61197c565b604080519315158452602084019290925290820152606001610366565b348015610a0057600080fd5b5061038f610a0f366004613ba9565b6119c7565b348015610a2057600080fd5b506103a66119ec565b348015610a3557600080fd5b5061038f610a44366004613993565b611a7a565b348015610a5557600080fd5b5061035a610a64366004613e96565b611aa9565b348015610a7557600080fd5b5061038f610a84366004613a08565b611b20565b348015610a9557600080fd5b5061038f610aa4366004613a08565b611b55565b348015610ab557600080fd5b5061038f610ac4366004613993565b611bf0565b6000610ad482611dae565b92915050565b6009546001600160a01b03163314610b0d5760405162461bcd60e51b8152600401610b0490613ec4565b60405180910390fd5b610b178282611dd3565b5050565b606060028054610b2a90613ef9565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5690613ef9565b8015610ba35780601f10610b7857610100808354040283529160200191610ba3565b820191906000526020600020905b815481529060010190602001808311610b8657829003601f168201915b5050505050905090565b6000610bb882611ed0565b610bd5576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6009546001600160a01b03163314610c1b5760405162461bcd60e51b8152600401610b0490613ec4565b6023805460ff1916911515919091179055565b6000610c39826112de565b9050806001600160a01b0316836001600160a01b031603610c6d5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614610ca457610c878133611aa9565b610ca4576040516367d9dca160e11b815260040160405180910390fd5b610caf838383611efb565b505050565b6009546001600160a01b03163314610cde5760405162461bcd60e51b8152600401610b0490613ec4565b610b17601a82611f57565b6009546001600160a01b03163314610d135760405162461bcd60e51b8152600401610b0490613ec4565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b610caf838383611f6c565b6000828152601d602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610db5575060408051808201909152601c546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610dd4906001600160601b031687613f49565b610dde9190613f7e565b915196919550909350505050565b6009546001600160a01b03163314610e165760405162461bcd60e51b8152600401610b0490613ec4565b80606001516001600160f81b031681600001511015610e775760405162461bcd60e51b815260206004820152601c60248201527f53656c6c65723a2065786365737369766520667265652071756f7461000000006044820152606401610b04565b60125481511015610eca5760405162461bcd60e51b815260206004820181905260248201527f53656c6c65723a20696e76656e746f7279203c20616c726561647920736f6c646044820152606401610b04565b60145481606001516001600160f81b03161015610f335760405162461bcd60e51b815260206004820152602160248201527f53656c6c65723a20667265652071756f7461203c20616c7265616479207573656044820152601960fa1b6064820152608401610b04565b601054610100900460ff1615610f5057600160c0820152600c5481525b60105460ff1615610f7457600160a0820152600f546001600160f81b031660608201525b8051600c556020810151600d556040810151600e55606081015160808201511515600160f81b026001600160f81b0390911617600f5560a08101516010805460c09093015115156101000261ff00199215159290921661ffff1990931692909217179055565b6000828152601e6020526040902060010154610ff581612166565b610caf8383612170565b6009546001600160a01b031633146110295760405162461bcd60e51b8152600401610b0490613ec4565b8051610b1790600a906020840190613802565b6001600160a01b03811633146110ac5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b04565b610b178282612192565b336110c0826112de565b6001600160a01b03161461110e5760405162461bcd60e51b81526020600482015260156024820152742137b9b7aa37b5bcb79d1027b7363c9037bbb732b960591b6044820152606401610b04565b600260225561111e8383836112c3565b5050600160225550565b600060158160016004830154600160f81b900460ff16600281111561114f5761114f613cef565b0361115b575043611185565b60026004830154600160f81b900460ff16600281111561117d5761117d613cef565b036111855750425b815415801590611196575081548110155b6111e25760405162461bcd60e51b815260206004820152601f60248201527f4c696e656172447574636841756374696f6e3a204e6f742073746172746564006044820152606401610b04565b60028201548254600091611217916111fa9085613f92565b6112049190613f7e565b60048501546001600160f81b03166121b4565b90508260030154816112299190613f49565b83600101546112389190613f92565b6112429087613f49565b9695505050505050565b6009546001600160a01b031633146112765760405162461bcd60e51b8152600401610b0490613ec4565b61127e6121ca565b565b8060005b818110156112bd576112ad8484838181106112a1576112a1613fa9565b90506020020135612267565b6112b681613fbf565b9050611284565b50505050565b610caf8383836040518060200160405280600081525061152e565b60006112e9826123ff565b5192915050565b60006001600160a01b038216611319576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6009546001600160a01b031633146113685760405162461bcd60e51b8152600401610b0490613ec4565b61127e6000612519565b6009546001600160a01b0316331461139c5760405162461bcd60e51b8152600401610b0490613ec4565b61127e61256b565b6000828152601f602052604081206113bc90836125d0565b9392505050565b60006113ce60125490565b905090565b6000918252601e602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060038054610b2a90613ef9565b610b1782826125dc565b33611421816125e8565b6001600160a01b0316836001600160a01b0316036114d25781611445576001611448565b60005b6001600160a01b0382166000908152600860205260409020805460ff19166001838181111561147957611479613cef565b0217905550826001600160a01b0316816001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31846040516114c5911515815260200190565b60405180910390a3505050565b610caf8383612747565b6009546001600160a01b031633146115065760405162461bcd60e51b8152600401610b0490613ec4565b602380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b611539848484611f6c565b6001600160a01b0383163b156112bd57611555848484846127dc565b6112bd576040516368d2bf6b60e11b815260040160405180910390fd5b6009546001600160a01b0316331461159c5760405162461bcd60e51b8152600401610b0490613ec4565b600954600160a01b900460ff16156115c65760405162461bcd60e51b8152600401610b0490613fd8565b600f546001600160f81b03166115ee826115df60145490565b6115e99084613f92565b6121b4565b9150600082116116405760405162461bcd60e51b815260206004820152601b60248201527f53656c6c65723a20467265652071756f746120657863656564656400000000006044820152606401610b04565b600c54611650836115df60125490565b9250600083116116955760405162461bcd60e51b815260206004820152601060248201526f14d95b1b195c8e8814dbdb19081bdd5d60821b6044820152606401610b04565b6116a1848460016128c7565b6116ac6012846128ef565b6116b76014846128ef565b806116c160125490565b11156116cf576116cf614002565b816116d960145490565b11156112bd576112bd614002565b6009546001600160a01b031633146117115760405162461bcd60e51b8152600401610b0490613ec4565b8082608001516001600160f81b0316836060015102836020015103146117875760405162461bcd60e51b815260206004820152602560248201527f4c696e656172447574636841756374696f6e3a20696e636f7272656374207265604482015264736572766560d81b6064820152608401610b04565b60008260a00151600281111561179f5761179f613cef565b036117f85760405162461bcd60e51b8152602060048201526024808201527f4c696e656172447574636841756374696f6e3a20756e737065636966696564206044820152631d5b9a5d60e21b6064820152608401610b04565b600082604001511161185f5760405162461bcd60e51b815260206004820152602a60248201527f4c696e656172447574636841756374696f6e3a207a65726f206465637265617360448201526919481a5b9d195c9d985b60b21b6064820152608401610b04565b815160159081556020830151601655604083015160175560608301516018556080830151601980546001600160f81b0319166001600160f81b03909216918217815560a0850151859392909190600160f81b8360028111156118c3576118c3613cef565b021790555050505050565b60235460609061010090046001600160a01b03161561195c5760235460405163c87b56dd60e01b8152600481018490526101009091046001600160a01b03169063c87b56dd90602401600060405180830381865afa158015611934573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ad49190810190614018565b610ad48261290c565b6000818152601f60205260408120610ad49061298f565b60008181526020805260408120548190819080156119a557600193506119a28142613f92565b92505b6000858152602160205260409020546119be9084614085565b93959294505050565b6000828152601e60205260409020600101546119e281612166565b610caf8383612192565b600a80546119f990613ef9565b80601f0160208091040260200160405190810160405280929190818152602001828054611a2590613ef9565b8015611a725780601f10611a4757610100808354040283529160200191611a72565b820191906000526020600020905b815481529060010190602001808311611a5557829003601f168201915b505050505081565b6009546001600160a01b03163314611aa45760405162461bcd60e51b8152600401610b0490613ec4565b601555565b6001600160a01b03808316600090815260076020908152604080832093851683529290529081205460ff1615611ae157506001610ad4565b6001600160a01b03831660009081526008602052604081205460ff166001811115611b0e57611b0e613cef565b1480156113bc57506113bc8383612999565b6009546001600160a01b03163314611b4a5760405162461bcd60e51b8152600401610b0490613ec4565b610b17601a82611d99565b6009546001600160a01b03163314611b7f5760405162461bcd60e51b8152600401610b0490613ec4565b6001600160a01b038116611be45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b04565b611bed81612519565b50565b7f7904e9328f622335e3d715af4f9d4b4147d279485bd5be001b80efa4da608a29611c1a81612166565b60008281526020805260408120549003611c6e5760405162461bcd60e51b8152602060048201526015602482015274109bdcdbd51bdade5bce881b9bdd081c995d9d9959605a1b6044820152606401610b04565b6000828152602080526040902054611c869042613f92565b60008381526021602052604081208054909190611ca4908490614085565b909155505060008281526020805260408082208290555183917f7077956e4319f76b3034df8947246abc73ad8bf6046fba870be6cec7b7feda7c91a260405182907f3ebee94e74ea24f711b5876dca724062e18b7b37b6883e686a92f093248a4fcf90600090a25050565b5490565b611d1d82826113d3565b610b17576000828152601e602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611d553390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006113bc836001600160a01b0384166129d7565b60006001600160e01b03198216635a05180f60e01b1480610ad45750610ad482612a26565b6127106001600160601b0382161115611e415760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610b04565b6001600160a01b038216611e975760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610b04565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601c55565b6000805482108015610ad4575050600090815260046020526040902054600160e01b900460ff161590565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006113bc836001600160a01b038416612a4b565b6000611f77826123ff565b9050836001600160a01b031681600001516001600160a01b031614611fae5760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611fcc5750611fcc8533611aa9565b80611fe7575033611fdc84610bad565b6001600160a01b0316145b90508061200757604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03841661202e57604051633a954ecd60e21b815260040160405180910390fd5b61203b8585856001612b3e565b61204760008487611efb565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b4290921691909102178355870180845292208054919390911661211b57600054821461211b57805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b611bed8133612bcb565b61217a8282611d13565b6000828152601f60205260409020610caf9082611d99565b61219c8282612c2f565b6000828152601f60205260409020610caf9082611f57565b60008183106121c357816113bc565b5090919050565b600954600160a01b900460ff1661221a5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610b04565b6009805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b8033612272826123ff565b516001600160a01b0316148061229857503361228d82610bad565b6001600160a01b0316145b6122f25760405162461bcd60e51b815260206004820152602560248201527f45524337323141436f6d6d6f6e3a204e6f7420617070726f766564206e6f722060448201526437bbb732b960d91b6064820152608401610b04565b6000828152602080526040812054908190036123965760235460ff1661235a5760405162461bcd60e51b815260206004820152601960248201527f426f736f546f6b796f3a2072657676696e6720636c6f736564000000000000006044820152606401610b04565b60008381526020805260408082204290555184917f1995f526bf899c52ff9f616c286f1f0d71293afde3a1d72b0193829b5a67d07491a2505050565b6123a08142613f92565b600084815260216020526040812080549091906123be908490614085565b909155505060008381526020805260408082208290555184917f7077956e4319f76b3034df8947246abc73ad8bf6046fba870be6cec7b7feda7c91a2505050565b60408051606081018252600080825260208201819052918101919091528160005481101561250057600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906124fe5780516001600160a01b031615612495579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff16151592810192909252156124f9579392505050565b612495565b505b604051636f96cda160e11b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a01b900460ff16156125955760405162461bcd60e51b8152600401610b0490613fd8565b6009805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861224a3390565b60006113bc8383612c96565b610b1782826000612cc0565b60008046806001811461261d576089811461263957600481146126555762013881811461267157610539811461268d576126a5565b73a5409ec958c83c3f309868babaca7c86dcb077c192506126a5565b7358807bad0b376efc12f5ad86aac70e78ed67deae92506126a5565b73f57b2c51ded3a29e6891aba85459d600256cf31792506126a5565b73ff7ca10af37178bdd056628ef42fd7f799fac77c92506126a5565b73e1a2bbc877b29adbc56d2659dbcb0ae14ee6207192505b506001600160a01b03821615806126bc5750806089145b806126c957508062013881145b156126d5575092915050565b60405163c455279160e01b81526001600160a01b03858116600483015283169063c455279190602401602060405180830381865afa15801561271b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061273f919061409d565b949350505050565b336001600160a01b038316036127705760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906128119033908990889088906004016140ba565b6020604051808303816000875af192505050801561284c575060408051601f3d908101601f19168201909252612849918101906140ed565b60015b6128aa573d80801561287a576040519150601f19603f3d011682016040523d82523d6000602084013e61287f565b606091505b5080516000036128a2576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6128d18383613177565b6127106128e16001546000540390565b1115610caf57610caf614002565b808260000160008282546129039190614085565b90915550505050565b606061291782611ed0565b61293457604051630a14c4b560e41b815260040160405180910390fd5b600061293e613191565b9050805160000361295e57604051806020016040528060008152506113bc565b806129688461319b565b60405160200161297992919061410a565b6040516020818303038152906040529392505050565b6000610ad4825490565b6000806129a5846125e8565b90506001600160a01b0381161580159061273f5750826001600160a01b0316816001600160a01b031614949350505050565b6000818152600183016020526040812054612a1e57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610ad4565b506000610ad4565b60006001600160e01b03198216637965db0b60e01b1480610ad45750610ad48261329b565b60008181526001830160205260408120548015612b34576000612a6f600183613f92565b8554909150600090612a8390600190613f92565b9050818114612ae8576000866000018281548110612aa357612aa3613fa9565b9060005260206000200154905080876000018481548110612ac657612ac6613fa9565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612af957612af9614139565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610ad4565b6000915050610ad4565b816000612b4b8383614085565b90505b80821015612bc35760008281526020805260409020541580612b7257506022546002145b612bb35760405162461bcd60e51b8152602060048201526012602482015271426f736f546f6b796f3a2072657676696e6760701b6044820152606401610b04565b612bbc82613fbf565b9150612b4e565b505050505050565b612bd582826113d3565b610b1757612bed816001600160a01b031660146132c0565b612bf88360206132c0565b604051602001612c0992919061414f565b60408051601f198184030181529082905262461bcd60e51b8252610b0491600401613980565b612c3982826113d3565b15610b17576000828152601e602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000826000018281548110612cad57612cad613fa9565b9060005260206000200154905092915050565b6002600b5403612d125760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b04565b6002600b55600954600160a01b900460ff1615612d415760405162461bcd60e51b8152600401610b0490613fd8565b6040805160e081018252600c548152600d546020820152600e54918101829052600f546001600160f81b038116606083015260ff600160f81b909104811615156080830152601054808216151560a0840152610100900416151560c08201529060009015612dbc57612db78483604001516121b4565b612dbe565b835b9050600080836080015115612e065760608401518451612de7916001600160f81b031690613f92565b9150612df260145490565b601254612dff9190613f92565b9050612e16565b83519150612e1360125490565b90505b612e24836115e98385613f92565b925060008311612e695760405162461bcd60e51b815260206004820152601060248201526f14d95b1b195c8e8814dbdb19081bdd5d60821b6044820152606401610b04565b602084015115612fc557336001600160a01b038816811415906000903214801590612e9d5750326001600160a01b038a1614155b9050612ecd858a6040518060400160405280600b81526020016a109d5e595c881b1a5b5a5d60aa1b81525061345b565b94508115612f0757612f0485336040518060400160405280600c81526020016b14d95b99195c881b1a5b5a5d60a21b81525061345b565b94505b8015612f3f57612f3c85326040518060400160405280600c81526020016b13dc9a59da5b881b1a5b5a5d60a21b81525061345b565b94505b6001600160a01b03891660009081526013602052604081208054879290612f67908490614085565b90915550508115612f97573360009081526013602052604081208054879290612f91908490614085565b90915550505b8015612fc2573260009081526013602052604081208054879290612fbc908490614085565b90915550505b50505b6000612fd18487611128565b90508034101561300157612ff1612fec633b9aca0083613f7e565b61319b565b604051602001612c0991906141c4565b61300d888560006128c7565b6130186012856128ef565b8451601254111561302b5761302b614002565b801561309057601154613047906001600160a01b0316826134b0565b60115460408051868152602081018490526001600160a01b03909216917f01f51b99bd1c3cca301836178e5dee13aadfe44eff06dc3ddcbf3c9d058454f8910160405180910390a25b80341115613168573360006130a58334613f92565b9050600080836001600160a01b03168360405160006040518083038185875af1925050503d80600081146130f5576040519150601f19603f3d011682016040523d82523d6000602084013e6130fa565b606091505b509150915081819061311f5760405162461bcd60e51b8152600401610b049190613980565b50836001600160a01b03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d8460405161315b91815260200190565b60405180910390a2505050505b50506001600b55505050505050565b610b178282604051806020016040528060008152506135c9565b60606113ce61379d565b6060816000036131c25750506040805180820190915260018152600360fc1b602082015290565b8160005b81156131ec57806131d681613fbf565b91506131e59050600a83613f7e565b91506131c6565b6000816001600160401b0381111561320657613206613a88565b6040519080825280601f01601f191660200182016040528015613230576020820181803683370190505b5090505b841561273f57613245600183613f92565b9150613252600a86614209565b61325d906030614085565b60f81b81838151811061327257613272613fa9565b60200101906001600160f81b031916908160001a905350613294600a86613f7e565b9450613234565b60006001600160e01b0319821663152a902d60e11b1480610ad45750610ad4826137ac565b606060006132cf836002613f49565b6132da906002614085565b6001600160401b038111156132f1576132f1613a88565b6040519080825280601f01601f19166020018201604052801561331b576020820181803683370190505b509050600360fc1b8160008151811061333657613336613fa9565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061336557613365613fa9565b60200101906001600160f81b031916908160001a9053506000613389846002613f49565b613394906001614085565b90505b600181111561340c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106133c8576133c8613fa9565b1a60f81b8282815181106133de576133de613fa9565b60200101906001600160f81b031916908160001a90535060049490941c936134058161421d565b9050613397565b5083156113bc5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b04565b6001600160a01b038216600090815260136020526040812054600d54829161348291613f92565b90508060000361349d5782604051602001612c099190614234565b6134a785826121b4565b95945050505050565b804710156135005760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b04565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461354d576040519150601f19603f3d011682016040523d82523d6000602084013e613552565b606091505b5050905080610caf5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b04565b6000546001600160a01b0384166135f257604051622e076360e81b815260040160405180910390fd5b826000036136135760405163b562e8dd60e01b815260040160405180910390fd5b6136206000858386612b3e565b6001600160a01b038416600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168b0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168b01811690920217909155858452600490925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b15613748575b60405182906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461371160008784806001019550876127dc565b61372e576040516368d2bf6b60e11b815260040160405180910390fd5b8082106136c657826000541461374357600080fd5b61378d565b5b6040516001830192906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808210613749575b5060009081556112bd9085838684565b6060600a8054610b2a90613ef9565b6000610ad48260006001600160e01b031982166380ac58cd60e01b14806137e357506001600160e01b03198216635b5e139f60e01b145b80610ad457506301ffc9a760e01b6001600160e01b0319831614610ad4565b82805461380e90613ef9565b90600052602060002090601f0160209004810192826138305760008555613876565b82601f1061384957805160ff1916838001178555613876565b82800160010185558215613876579182015b8281111561387657825182559160200191906001019061385b565b50613882929150613886565b5090565b5b808211156138825760008155600101613887565b6001600160e01b031981168114611bed57600080fd5b6000602082840312156138c357600080fd5b81356113bc8161389b565b6001600160a01b0381168114611bed57600080fd5b600080604083850312156138f657600080fd5b8235613901816138ce565b915060208301356001600160601b038116811461391d57600080fd5b809150509250929050565b60005b8381101561394357818101518382015260200161392b565b838111156112bd5750506000910152565b6000815180845261396c816020860160208601613928565b601f01601f19169290920160200192915050565b6020815260006113bc6020830184613954565b6000602082840312156139a557600080fd5b5035919050565b803580151581146139bc57600080fd5b919050565b6000602082840312156139d357600080fd5b6113bc826139ac565b600080604083850312156139ef57600080fd5b82356139fa816138ce565b946020939093013593505050565b600060208284031215613a1a57600080fd5b81356113bc816138ce565b600080600060608486031215613a3a57600080fd5b8335613a45816138ce565b92506020840135613a55816138ce565b929592945050506040919091013590565b60008060408385031215613a7957600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b0381118282101715613ac057613ac0613a88565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613aee57613aee613a88565b604052919050565b80356001600160f81b03811681146139bc57600080fd5b600060e08284031215613b1f57600080fd5b60405160e081018181106001600160401b0382111715613b4157613b41613a88565b8060405250823581526020830135602082015260408301356040820152613b6a60608401613af6565b6060820152613b7b608084016139ac565b6080820152613b8c60a084016139ac565b60a0820152613b9d60c084016139ac565b60c08201529392505050565b60008060408385031215613bbc57600080fd5b82359150602083013561391d816138ce565b60006001600160401b03821115613be757613be7613a88565b50601f01601f191660200190565b6000613c08613c0384613bce565b613ac6565b9050828152838383011115613c1c57600080fd5b828260208301376000602084830101529392505050565b600060208284031215613c4557600080fd5b81356001600160401b03811115613c5b57600080fd5b8201601f81018413613c6c57600080fd5b61273f84823560208401613bf5565b60008060208385031215613c8e57600080fd5b82356001600160401b0380821115613ca557600080fd5b818501915085601f830112613cb957600080fd5b813581811115613cc857600080fd5b8660208260051b8501011115613cdd57600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052602160045260246000fd5b8681526020810186905260408101859052606081018490526001600160f81b038316608082015260c0810160038310613d4e57634e487b7160e01b600052602160045260246000fd5b8260a0830152979650505050505050565b60008060408385031215613d7257600080fd5b8235613d7d816138ce565b9150613d8b602084016139ac565b90509250929050565b60008060008060808587031215613daa57600080fd5b8435613db5816138ce565b93506020850135613dc5816138ce565b92506040850135915060608501356001600160401b03811115613de757600080fd5b8501601f81018713613df857600080fd5b613e0787823560208401613bf5565b91505092959194509250565b60008082840360e0811215613e2757600080fd5b60c0811215613e3557600080fd5b50613e3e613a9e565b83358152602084013560208201526040840135604082015260608401356060820152613e6c60808501613af6565b608082015260a084013560038110613e8357600080fd5b60a08201529460c0939093013593505050565b60008060408385031215613ea957600080fd5b8235613eb4816138ce565b9150602083013561391d816138ce565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680613f0d57607f821691505b602082108103613f2d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615613f6357613f63613f33565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613f8d57613f8d613f68565b500490565b600082821015613fa457613fa4613f33565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201613fd157613fd1613f33565b5060010190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052600160045260246000fd5b60006020828403121561402a57600080fd5b81516001600160401b0381111561404057600080fd5b8201601f8101841361405157600080fd5b805161405f613c0382613bce565b81815285602083850101111561407457600080fd5b6134a7826020830160208601613928565b6000821982111561409857614098613f33565b500190565b6000602082840312156140af57600080fd5b81516113bc816138ce565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061124290830184613954565b6000602082840312156140ff57600080fd5b81516113bc8161389b565b6000835161411c818460208801613928565b835190830190614130818360208801613928565b01949350505050565b634e487b7160e01b600052603160045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614187816017850160208801613928565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516141b8816028840160208801613928565b01602801949350505050565b6d029b2b63632b91d1021b7b9ba39960951b8152600082516141ed81600e850160208701613928565b64204757656960d81b600e939091019283015250601301919050565b60008261421857614218613f68565b500690565b60008161422c5761422c613f33565b506000190190565b67029b2b63632b91d160c51b815260008251614257816008850160208701613928565b919091016008019291505056fea2646970667358221220a30eb57a58113b02307d878366527a2a1a5461efcfee9492536aa600d2f2187364736f6c634300080d0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000f7ea51d1a06bcfb7ed3b1095e65b194ebd040ad0000000000000000000000000f7ea51d1a06bcfb7ed3b1095e65b194ebd040ad0000000000000000000000000000000000000000000000000000000000000009424f534f544f4b594f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009424f534f544f4b454e0000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): BOSOTOKYO
Arg [1] : symbol (string): BOSOTOKEN
Arg [2] : beneficiary (address): 0x0f7ea51d1a06bCFB7ed3b1095e65B194Ebd040ad
Arg [3] : royaltyReceiver (address): 0x0f7ea51d1a06bCFB7ed3b1095e65B194Ebd040ad
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000f7ea51d1a06bcfb7ed3b1095e65b194ebd040ad
Arg [3] : 0000000000000000000000000f7ea51d1a06bcfb7ed3b1095e65b194ebd040ad
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [5] : 424f534f544f4b594f0000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [7] : 424f534f544f4b454e0000000000000000000000000000000000000000000000
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.