ERC-721
Overview
Max Total Supply
888 bythen
Holders
351
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 bythenLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
BythenChip
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@thirdweb-dev/contracts/extension/PrimarySale.sol"; import "@thirdweb-dev/contracts/extension/Permissions.sol"; import "@thirdweb-dev/contracts/extension/interface/IPermissions.sol"; import "@thirdweb-dev/contracts/extension/PermissionsEnumerable.sol"; import "./interfaces/ISignatureMintERC721.sol"; import "@thirdweb-dev/contracts/eip/ERC721A.sol"; import "@thirdweb-dev/contracts/external-deps/openzeppelin/utils/cryptography/EIP712.sol"; import "@thirdweb-dev/contracts/external-deps/openzeppelin/utils/cryptography/ECDSA.sol"; import "@thirdweb-dev/contracts/external-deps/openzeppelin/security/ReentrancyGuard.sol"; error NotAllowedToListBurn(); error InvalidRequest(string); error RequestExpired(); error ExceededMaxSupply(); error FailedToCollectPayment(); error LastAdminRemoval(); contract BythenChip is ISignatureMintERC721, ERC721A, EIP712, ReentrancyGuard, PermissionsEnumerable, PrimarySale { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 private constant TYPEHASH = keccak256("MintRequest(address to,uint256 quantity,uint256 pricePerToken,uint256 validityStartTimestamp,uint256 validityEndTimestamp,bytes32 uid)"); mapping(bytes32 => bool) private minted; bool public isAllowedToListorBurn = false; uint256 public maxTotalSupply = 1888; string private collectionURI; constructor(string memory name, string memory symbol, address _primarySaleRecipient, string memory _collectionURI) ERC721A(name, symbol) EIP712(name, "1.0.0") { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); _setRoleAdmin(DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE); _setRoleAdmin(MINTER_ROLE, DEFAULT_ADMIN_ROLE); _setupPrimarySaleRecipient(_primarySaleRecipient); collectionURI = _collectionURI; } function tokenURI(uint256 tokenId) public view virtual override(ERC721A) returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); return collectionURI; } function getMinted(bytes32 uid) public view returns (bool) { return minted[uid]; } function _canSetPrimarySaleRecipient() internal view virtual override(PrimarySale) returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, msg.sender); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A) returns (bool) { return super.supportsInterface(interfaceId); } modifier allowedToListorBurn() { if (!isAllowedToListorBurn) { revert NotAllowedToListBurn(); } _; } function setAllowedToListorBurn(bool value) external onlyRole(DEFAULT_ADMIN_ROLE) { isAllowedToListorBurn = value; } function mintWithSignature( MintRequest calldata _req, bytes calldata _signature ) external payable virtual override returns (address signer) { if(totalSupply() + _req.quantity > maxTotalSupply) { revert ExceededMaxSupply(); } // Verify and process payload. uint256 tokenIdToMint = nextTokenIdToMint(); signer = processRequest(_req, _signature); address receiver = _req.to; collectPriceOnClaim(primarySaleRecipient(), _req.quantity, _req.pricePerToken); _safeMint(receiver, _req.quantity); emit GenesisTokensMintedWithSignature(signer, receiver, tokenIdToMint, _req); } function mint(address to) external virtual override onlyRole(MINTER_ROLE) { if(totalSupply() + 1 > maxTotalSupply) revert ExceededMaxSupply(); uint256 tokenIdToMint = nextTokenIdToMint(); _safeMint(to, 1); emit GenesisTokensMinted(to, tokenIdToMint); } function burn(uint256 tokenId) external virtual override allowedToListorBurn onlyRole(MINTER_ROLE) { _burn(tokenId); emit GenesisTokensBurned(tokenId); } function approve(address to, uint256 tokenId) public virtual override allowedToListorBurn { super.approve(to, tokenId); } function setApprovalForAll(address operator, bool approved) public virtual override allowedToListorBurn { super.setApprovalForAll(operator, approved); } function transferFrom(address from, address to, uint256 tokenId) public virtual override allowedToListorBurn { super.transferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override allowedToListorBurn { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override allowedToListorBurn { super.safeTransferFrom(from, to, tokenId, _data); } function nextTokenIdToMint() public view virtual returns (uint256) { return _currentIndex; } function processRequest(MintRequest calldata req, bytes calldata signature) internal returns (address signer) { bool success; signer = ECDSA.recover(_hashTypedDataV4(keccak256(encodeRequest(req))), signature); success = !minted[req.uid] && hasRole(MINTER_ROLE, signer); if (!success) { revert InvalidRequest("Already Minted or signer doesn't has minter role"); } if (msg.sender != req.to) { revert InvalidRequest("Invalid Recipient"); } if (req.validityStartTimestamp > block.timestamp || block.timestamp > req.validityEndTimestamp) { revert InvalidRequest("Req expired"); } if(req.to == address(0)) { revert InvalidRequest("recipient undefined"); } if(req.quantity == 0) { revert InvalidRequest("0 qty"); } minted[req.uid] = true; } function encodeRequest(MintRequest calldata req) internal pure returns (bytes memory) { return abi.encode( TYPEHASH, req.to, req.quantity, req.pricePerToken, req.validityStartTimestamp, req.validityEndTimestamp, req.uid ); } function collectPriceOnClaim(address saleRecipient, uint256 quantityToClaim, uint256 pricePerToken ) internal virtual { if(pricePerToken == 0) { revert InvalidRequest("Invalid price per token"); } uint256 totalPrice = quantityToClaim * pricePerToken; if(msg.value != totalPrice) { revert InvalidRequest("Invalid msg value"); } safeTransferNativeToken(saleRecipient, totalPrice); } function safeTransferNativeToken(address to, uint256 value) internal { // solhint-disable avoid-low-level-calls // slither-disable-next-line low-level-calls (bool success, ) = to.call{ value: value }(""); if(!success) { revert FailedToCollectPayment(); } require(success, "native token transfer failed"); } function setMaxTotalSupply(uint256 _maxTotalSupply) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { maxTotalSupply = _maxTotalSupply; } function setCollectionURI(string calldata _newURI) external onlyRole(DEFAULT_ADMIN_ROLE) { collectionURI = _newURI; } function revokeRole(bytes32 role, address account) public virtual override(Permissions, IPermissions) { super.revokeRole(role, account); if (role == DEFAULT_ADMIN_ROLE && this.getRoleMemberCount(role) <= 0) { revert LastAdminRemoval(); } } function renounceRole(bytes32 role, address account) public virtual override(Permissions, IPermissions) { super.renounceRole(role, account); if (role == DEFAULT_ADMIN_ROLE && this.getRoleMemberCount(role) <= 0) { revert LastAdminRemoval(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./interface/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 // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "./interface/IERC721A.sol"; import "../external-deps/openzeppelin/token/ERC721/IERC721Receiver.sol"; import "../lib/Address.sol"; import "../external-deps/openzeppelin/utils/Context.sol"; import "../lib/Strings.sol"; import "./ERC165.sol"; /** * @dev Implementation of [ERC721](https://eips.ethereum.org/EIPS/eip-721) 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) 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 virtual 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 v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * [EIP](https://eips.ethereum.org/EIPS/eip-165). * * 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 * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address); /** * @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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "./IERC721.sol"; import "./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: Apache-2.0 pragma solidity ^0.8.0; /// @title ERC-721 Non-Fungible Token Standard, optional metadata extension /// @dev See https://eips.ethereum.org/EIPS/eip-721 /// Note: the ERC-165 identifier for this interface is 0x5b5e139f. /* is ERC721 */ interface IERC721Metadata { /// @notice A descriptive name for a collection of NFTs in this contract function name() external view returns (string memory); /// @notice An abbreviated name for NFTs in this contract function symbol() external view returns (string memory); /// @notice A distinct Uniform Resource Identifier (URI) for a given asset. /// @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC /// 3986. The URI may point to a JSON file that conforms to the "ERC721 /// Metadata JSON Schema". function tokenURI(uint256 _tokenId) external view returns (string memory); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IPermissions { /** * @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: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./IPermissions.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IPermissionsEnumerable is IPermissions { /** * @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 * [forum post](https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296) * 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: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * Thirdweb's `Primary` is a contract extension to be used with any base contract. It exposes functions for setting and reading * the recipient of primary sales, and lets the inheriting contract perform conditional logic that uses information about * primary sales, if desired. */ interface IPrimarySale { /// @dev The adress that receives all primary sales value. function primarySaleRecipient() external view returns (address); /// @dev Lets a module admin set the default recipient of all primary sales. function setPrimarySaleRecipient(address _saleRecipient) external; /// @dev Emitted when a new sale recipient is set. event PrimarySaleRecipientUpdated(address indexed recipient); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IPermissions.sol"; import "../lib/Strings.sol"; /** * @title Permissions * @dev This contracts provides extending-contracts with role-based access control mechanisms */ contract Permissions is IPermissions { /// @dev Map from keccak256 hash of a role => a map from address => whether address has role. mapping(bytes32 => mapping(address => bool)) private _hasRole; /// @dev Map from keccak256 hash of a role to role admin. See {getRoleAdmin}. mapping(bytes32 => bytes32) private _getRoleAdmin; /// @dev Default admin role for all roles. Only accounts with this role can grant/revoke other roles. bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /// @dev Modifier that checks if an account has the specified role; reverts otherwise. modifier onlyRole(bytes32 role) { _checkRole(role, msg.sender); _; } /** * @notice Checks whether an account has a particular role. * @dev Returns `true` if `account` has been granted `role`. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account for which the role is being checked. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _hasRole[role][account]; } /** * @notice Checks whether an account has a particular role; * role restrictions can be swtiched on and off. * * @dev Returns `true` if `account` has been granted `role`. * Role restrictions can be swtiched on and off: * - If address(0) has ROLE, then the ROLE restrictions * don't apply. * - If address(0) does not have ROLE, then the ROLE * restrictions will apply. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account for which the role is being checked. */ function hasRoleWithSwitch(bytes32 role, address account) public view returns (bool) { if (!_hasRole[role][address(0)]) { return _hasRole[role][account]; } return true; } /** * @notice Returns the admin role that controls the specified role. * @dev See {grantRole} and {revokeRole}. * To change a role's admin, use {_setRoleAdmin}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") */ function getRoleAdmin(bytes32 role) external view override returns (bytes32) { return _getRoleAdmin[role]; } /** * @notice Grants a role to an account, if not previously granted. * @dev Caller must have admin role for the `role`. * Emits {RoleGranted Event}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account to which the role is being granted. */ function grantRole(bytes32 role, address account) public virtual override { _checkRole(_getRoleAdmin[role], msg.sender); if (_hasRole[role][account]) { revert("Can only grant to non holders"); } _setupRole(role, account); } /** * @notice Revokes role from an account. * @dev Caller must have admin role for the `role`. * Emits {RoleRevoked Event}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account from which the role is being revoked. */ function revokeRole(bytes32 role, address account) public virtual override { _checkRole(_getRoleAdmin[role], msg.sender); _revokeRole(role, account); } /** * @notice Revokes role from the account. * @dev Caller must have the `role`, with caller being the same as `account`. * Emits {RoleRevoked Event}. * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param account Address of the account from which the role is being revoked. */ function renounceRole(bytes32 role, address account) public virtual override { if (msg.sender != account) { revert("Can only renounce for self"); } _revokeRole(role, account); } /// @dev Sets `adminRole` as `role`'s admin role. function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = _getRoleAdmin[role]; _getRoleAdmin[role] = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /// @dev Sets up `role` for `account` function _setupRole(bytes32 role, address account) internal virtual { _hasRole[role][account] = true; emit RoleGranted(role, account, msg.sender); } /// @dev Revokes `role` from `account` function _revokeRole(bytes32 role, address account) internal virtual { _checkRole(role, account); delete _hasRole[role][account]; emit RoleRevoked(role, account, msg.sender); } /// @dev Checks `role` for `account`. Reverts with a message including the required role. function _checkRole(bytes32 role, address account) internal view virtual { if (!_hasRole[role][account]) { revert( string( abi.encodePacked( "Permissions: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /// @dev Checks `role` for `account`. Reverts with a message including the required role. function _checkRoleWithSwitch(bytes32 role, address account) internal view virtual { if (!hasRoleWithSwitch(role, account)) { revert( string( abi.encodePacked( "Permissions: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IPermissionsEnumerable.sol"; import "./Permissions.sol"; /** * @title PermissionsEnumerable * @dev This contracts provides extending-contracts with role-based access control mechanisms. * Also provides interfaces to view all members with a given role, and total count of members. */ contract PermissionsEnumerable is IPermissionsEnumerable, Permissions { /** * @notice A data structure to store data of members for a given role. * * @param index Current index in the list of accounts that have a role. * @param members map from index => address of account that has a role * @param indexOf map from address => index which the account has. */ struct RoleMembers { uint256 index; mapping(uint256 => address) members; mapping(address => uint256) indexOf; } /// @dev map from keccak256 hash of a role to its members' data. See {RoleMembers}. mapping(bytes32 => RoleMembers) private roleMembers; /** * @notice Returns the role-member from a list of members for a role, * at a given index. * @dev Returns `member` who has `role`, at `index` of role-members list. * See struct {RoleMembers}, and mapping {roleMembers} * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * @param index Index in list of current members for the role. * * @return member Address of account that has `role` */ function getRoleMember(bytes32 role, uint256 index) external view override returns (address member) { uint256 currentIndex = roleMembers[role].index; uint256 check; for (uint256 i = 0; i < currentIndex; i += 1) { if (roleMembers[role].members[i] != address(0)) { if (check == index) { member = roleMembers[role].members[i]; return member; } check += 1; } else if (hasRole(role, address(0)) && i == roleMembers[role].indexOf[address(0)]) { check += 1; } } } /** * @notice Returns total number of accounts that have a role. * @dev Returns `count` of accounts that have `role`. * See struct {RoleMembers}, and mapping {roleMembers} * * @param role keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") * * @return count Total number of accounts that have `role` */ function getRoleMemberCount(bytes32 role) external view override returns (uint256 count) { uint256 currentIndex = roleMembers[role].index; for (uint256 i = 0; i < currentIndex; i += 1) { if (roleMembers[role].members[i] != address(0)) { count += 1; } } if (hasRole(role, address(0))) { count += 1; } } /// @dev Revokes `role` from `account`, and removes `account` from {roleMembers} /// See {_removeMember} function _revokeRole(bytes32 role, address account) internal override { super._revokeRole(role, account); _removeMember(role, account); } /// @dev Grants `role` to `account`, and adds `account` to {roleMembers} /// See {_addMember} function _setupRole(bytes32 role, address account) internal override { super._setupRole(role, account); _addMember(role, account); } /// @dev adds `account` to {roleMembers}, for `role` function _addMember(bytes32 role, address account) internal { uint256 idx = roleMembers[role].index; roleMembers[role].index += 1; roleMembers[role].members[idx] = account; roleMembers[role].indexOf[account] = idx; } /// @dev removes `account` from {roleMembers}, for `role` function _removeMember(bytes32 role, address account) internal { uint256 idx = roleMembers[role].indexOf[account]; delete roleMembers[role].members[idx]; delete roleMembers[role].indexOf[account]; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IPrimarySale.sol"; /** * @title Primary Sale * @notice Thirdweb's `PrimarySale` is a contract extension to be used with any base contract. It exposes functions for setting and reading * the recipient of primary sales, and lets the inheriting contract perform conditional logic that uses information about * primary sales, if desired. */ abstract contract PrimarySale is IPrimarySale { /// @dev The address that receives all primary sales value. address private recipient; /// @dev Returns primary sale recipient address. function primarySaleRecipient() public view override returns (address) { return recipient; } /** * @notice Updates primary sale recipient. * @dev Caller should be authorized to set primary sales info. * See {_canSetPrimarySaleRecipient}. * Emits {PrimarySaleRecipientUpdated Event}; See {_setupPrimarySaleRecipient}. * * @param _saleRecipient Address to be set as new recipient of primary sales. */ function setPrimarySaleRecipient(address _saleRecipient) external override { if (!_canSetPrimarySaleRecipient()) { revert("Not authorized"); } _setupPrimarySaleRecipient(_saleRecipient); } /// @dev Lets a contract admin set the recipient for all primary sales. function _setupPrimarySaleRecipient(address _saleRecipient) internal { if (_saleRecipient == address(0)) { revert("Invalid recipient"); } recipient = _saleRecipient; emit PrimarySaleRecipientUpdated(_saleRecipient); } /// @dev Returns whether primary sale recipient can be set in the given execution context. function _canSetPrimarySaleRecipient() internal view virtual returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; abstract contract ReentrancyGuard { 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. */ 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 (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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../../../../lib/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 // Deprecated in v4.8 } 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"); } } /** * @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) { 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. /// @solidity memory-safe-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 { 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 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 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @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 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.1; /// @author thirdweb, OpenZeppelin Contracts (v4.9.0) /** * @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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{ value: value }(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * @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); } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte, /// and the alphabets are capitalized conditionally according to /// https://eips.ethereum.org/EIPS/eip-55 function toHexStringChecksummed(address value) internal pure returns (string memory str) { str = toHexString(value); /// @solidity memory-safe-assembly assembly { let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...` let o := add(str, 0x22) let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... ` let t := shl(240, 136) // `0b10001000 << 240` for { let i := 0 } 1 { } { mstore(add(i, i), mul(t, byte(i, hashed))) i := add(i, 1) if eq(i, 20) { break } } mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask))))) o := add(o, 0x20) mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask))))) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. function toHexString(address value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(address value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { str := mload(0x40) // Allocate the memory. // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x28 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80. mstore(0x40, add(str, 0x80)) // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) str := add(str, 2) mstore(str, 40) let o := add(str, 0x20) mstore(add(o, 40), 0) value := shl(96, value) // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let i := 0 } 1 { } { let p := add(o, add(i, i)) let temp := byte(i, value) mstore8(add(p, 1), mload(and(temp, 15))) mstore8(p, mload(shr(4, temp))) i := add(i, 1) if eq(i, 20) { break } } } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexString(bytes memory raw) internal pure returns (string memory str) { str = toHexStringNoPrefix(raw); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { let length := mload(raw) str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix. mstore(str, add(length, length)) // Store the length of the output. // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let o := add(str, 0x20) let end := add(raw, length) for { } iszero(eq(raw, end)) { } { raw := add(raw, 1) mstore8(add(o, 1), mload(and(mload(raw), 15))) mstore8(o, mload(and(shr(4, mload(raw)), 15))) o := add(o, 2) } mstore(o, 0) // Zeroize the slot after the string. mstore(0x40, add(o, 0x20)) // Allocate the memory. } } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.20; interface ISignatureMintERC721 { /** * @notice The body of a request to mint tokens. * * @param to The receiver of the tokens to mint. * @param quantity The quantity of tokens to mint. * @param pricePerToken The price to pay per quantity of tokens minted. * @param validityStartTimestamp The unix timestamp after which the payload is valid. * @param validityEndTimestamp The unix timestamp at which the payload expires. * @param uid A unique identifier for the payload. */ struct MintRequest { address to; uint256 quantity; uint256 pricePerToken; uint256 validityStartTimestamp; uint256 validityEndTimestamp; bytes32 uid; } /// @dev Emitted when tokens are minted. event GenesisTokensMintedWithSignature( address indexed signer, address indexed mintedTo, uint256 indexed tokenIdMinted, MintRequest mintRequest ); event GenesisTokensMinted( address indexed mintedTo, uint256 indexed tokenIdMinted ); event GenesisTokensBurned( uint256 indexed tokenIdBurned ); /** * @notice Mints tokens according to the provided mint request. * * @param req The payload / mint request. * @param signature The signature produced by an account signing the mint request. */ function mintWithSignature( MintRequest calldata req, bytes calldata signature ) external payable returns (address signer); function mint(address to) external; function burn(uint256 tokenId) external; function setAllowedToListorBurn(bool value) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"_primarySaleRecipient","type":"address"},{"internalType":"string","name":"_collectionURI","type":"string"}],"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":"ExceededMaxSupply","type":"error"},{"inputs":[],"name":"FailedToCollectPayment","type":"error"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"InvalidRequest","type":"error"},{"inputs":[],"name":"LastAdminRemoval","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotAllowedToListBurn","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":"tokenIdBurned","type":"uint256"}],"name":"GenesisTokensBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"mintedTo","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenIdMinted","type":"uint256"}],"name":"GenesisTokensMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"indexed":true,"internalType":"address","name":"mintedTo","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenIdMinted","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"uint256","name":"validityStartTimestamp","type":"uint256"},{"internalType":"uint256","name":"validityEndTimestamp","type":"uint256"},{"internalType":"bytes32","name":"uid","type":"bytes32"}],"indexed":false,"internalType":"struct ISignatureMintERC721.MintRequest","name":"mintRequest","type":"tuple"}],"name":"GenesisTokensMintedWithSignature","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"PrimarySaleRecipientUpdated","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","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":"uid","type":"bytes32"}],"name":"getMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"member","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"count","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":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRoleWithSwitch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAllowedToListorBurn","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":[],"name":"maxTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"uint256","name":"validityStartTimestamp","type":"uint256"},{"internalType":"uint256","name":"validityEndTimestamp","type":"uint256"},{"internalType":"bytes32","name":"uid","type":"bytes32"}],"internalType":"struct ISignatureMintERC721.MintRequest","name":"_req","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"mintWithSignature","outputs":[{"internalType":"address","name":"signer","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenIdToMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"primarySaleRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":[{"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":"bool","name":"value","type":"bool"}],"name":"setAllowedToListorBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newURI","type":"string"}],"name":"setCollectionURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxTotalSupply","type":"uint256"}],"name":"setMaxTotalSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_saleRecipient","type":"address"}],"name":"setPrimarySaleRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"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"}]
Contract Creation Code
610140604052600e805460ff19169055610760600f553480156200002257600080fd5b50604051620034cc380380620034cc833981016040819052620000459162000421565b6040805180820190915260058152640312e302e360dc1b602082015284908185600262000073838262000563565b50600362000082828262000563565b50506000805550815160208084019190912082518383012060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81880181905281830187905260608201869052608082019490945230818401528151808203909301835260c00190528051940193909320919290916080523060c0526101205250506001600855506200012d905060003362000195565b62000148600080516020620034ac8339815191523362000195565b62000155600080620001b1565b62000171600080516020620034ac8339815191526000620001b1565b6200017c82620001f9565b60106200018a828262000563565b505050505062000657565b620001a1828262000292565b620001ad8282620002ed565b5050565b6000828152600a6020526040808220805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6001600160a01b038116620002485760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b604482015260640160405180910390fd5b600c80546001600160a01b0319166001600160a01b0383169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a250565b60008281526009602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000828152600b60205260408120805491600191906200030e83856200062f565b90915550506000928352600b6020908152604080852083865260018101835281862080546001600160a01b039096166001600160a01b03199096168617905593855260029093019052912055565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200038457600080fd5b81516001600160401b0380821115620003a157620003a16200035c565b604051601f8301601f19908116603f01168101908282118183101715620003cc57620003cc6200035c565b81604052838152602092508683858801011115620003e957600080fd5b600091505b838210156200040d5785820183015181830184015290820190620003ee565b600093810190920192909252949350505050565b600080600080608085870312156200043857600080fd5b84516001600160401b03808211156200045057600080fd5b6200045e8883890162000372565b955060208701519150808211156200047557600080fd5b620004838883890162000372565b604088015190955091506001600160a01b0382168214620004a357600080fd5b606087015191935080821115620004b957600080fd5b50620004c88782880162000372565b91505092959194509250565b600181811c90821680620004e957607f821691505b6020821081036200050a57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200055e57600081815260208120601f850160051c81016020861015620005395750805b601f850160051c820191505b818110156200055a5782815560010162000545565b5050505b505050565b81516001600160401b038111156200057f576200057f6200035c565b6200059781620005908454620004d4565b8462000510565b602080601f831160018114620005cf5760008415620005b65750858301515b600019600386901b1c1916600185901b1785556200055a565b600085815260208120601f198616915b828110156200060057888601518255948401946001909101908401620005df565b50858210156200061f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156200065157634e487b7160e01b600052601160045260246000fd5b92915050565b60805160a05160c05160e0516101005161012051612e05620006a76000396000612363015260006123b20152600061238d015260006122e6015260006123100152600061233a0152612e056000f3fe60806040526004361061020f5760003560e01c80636352211e11610118578063a22cb465116100a0578063c87b56dd1161006f578063c87b56dd14610601578063ca15c87314610621578063d539139314610641578063d547741f14610663578063e985e9c51461068357600080fd5b8063a22cb46514610571578063a2be6bd214610591578063a32fa5b3146105c1578063b88d4fde146105e157600080fd5b80639010d07c116100e75780639010d07c146104ed57806391d148541461050d57806395d89b411461052d5780639abcd7c214610542578063a217fddf1461055c57600080fd5b80636352211e1461046d5780636a6278421461048d5780636f4f2837146104ad57806370a08231146104cd57600080fd5b80632639f4601161019b57806336568abe1161016a57806336568abe146103d85780633b1475a7146103f85780633f3e4c111461040d57806342842e0e1461042d57806342966c681461044d57600080fd5b80632639f460146103625780632ab4d052146103825780632f2ff15d1461039857806335dff9ba146103b857600080fd5b8063095ea7b3116101e2578063095ea7b3146102bd57806318160ddd146102df5780631a23a7eb1461030257806323b872dd14610315578063248a9ca31461033557600080fd5b806301ffc9a71461021457806306fdde0314610249578063079fe40e1461026b578063081812fc1461029d575b600080fd5b34801561022057600080fd5b5061023461022f3660046126cb565b6106cc565b60405190151581526020015b60405180910390f35b34801561025557600080fd5b5061025e6106dd565b6040516102409190612738565b34801561027757600080fd5b50600c546001600160a01b03165b6040516001600160a01b039091168152602001610240565b3480156102a957600080fd5b506102856102b836600461274b565b61076f565b3480156102c957600080fd5b506102dd6102d8366004612780565b6107b3565b005b3480156102eb57600080fd5b50600154600054035b604051908152602001610240565b6102856103103660046127eb565b6107e4565b34801561032157600080fd5b506102dd610330366004612845565b6108cc565b34801561034157600080fd5b506102f461035036600461274b565b6000908152600a602052604090205490565b34801561036e57600080fd5b506102dd61037d366004612881565b6108ff565b34801561038e57600080fd5b506102f4600f5481565b3480156103a457600080fd5b506102dd6103b33660046128c2565b61091e565b3480156103c457600080fd5b506102dd6103d33660046128fe565b6109b9565b3480156103e457600080fd5b506102dd6103f33660046128c2565b6109d9565b34801561040457600080fd5b506000546102f4565b34801561041957600080fd5b506102dd61042836600461274b565b610a70565b34801561043957600080fd5b506102dd610448366004612845565b610a82565b34801561045957600080fd5b506102dd61046836600461274b565b610ab0565b34801561047957600080fd5b5061028561048836600461274b565b610b24565b34801561049957600080fd5b506102dd6104a8366004612919565b610b36565b3480156104b957600080fd5b506102dd6104c8366004612919565b610bcc565b3480156104d957600080fd5b506102f46104e8366004612919565b610c1d565b3480156104f957600080fd5b50610285610508366004612934565b610c6b565b34801561051957600080fd5b506102346105283660046128c2565b610d59565b34801561053957600080fd5b5061025e610d84565b34801561054e57600080fd5b50600e546102349060ff1681565b34801561056857600080fd5b506102f4600081565b34801561057d57600080fd5b506102dd61058c366004612956565b610d93565b34801561059d57600080fd5b506102346105ac36600461274b565b6000908152600d602052604090205460ff1690565b3480156105cd57600080fd5b506102346105dc3660046128c2565b610dc0565b3480156105ed57600080fd5b506102dd6105fc366004612996565b610e16565b34801561060d57600080fd5b5061025e61061c36600461274b565b610e45565b34801561062d57600080fd5b506102f461063c36600461274b565b610f46565b34801561064d57600080fd5b506102f4600080516020612d9083398151915281565b34801561066f57600080fd5b506102dd61067e3660046128c2565b610fcf565b34801561068f57600080fd5b5061023461069e366004612a71565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b60006106d782610fd9565b92915050565b6060600280546106ec90612a9b565b80601f016020809104026020016040519081016040528092919081815260200182805461071890612a9b565b80156107655780601f1061073a57610100808354040283529160200191610765565b820191906000526020600020905b81548152906001019060200180831161074857829003601f168201915b5050505050905090565b600061077a82611029565b610797576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600e5460ff166107d657604051637087ed7f60e01b815260040160405180910390fd5b6107e08282611054565b5050565b6000600f5484602001356107fb6001546000540390565b6108059190612ae5565b11156108245760405163fb88d21560e01b815260040160405180910390fd5b6000546108328585856110d5565b915060006108436020870187612919565b905061086961085a600c546001600160a01b031690565b87602001358860400135611345565b6108778187602001356113f2565b81816001600160a01b0316846001600160a01b03167fbb30f850affc4106b21aa99ef28533a2f3ef9c2ee4abbded1fb71b032db573f3896040516108bb9190612af8565b60405180910390a450509392505050565b600e5460ff166108ef57604051637087ed7f60e01b815260040160405180910390fd5b6108fa83838361140c565b505050565b600061090b8133611417565b6010610918838583612b96565b50505050565b6000828152600a60205260409020546109379033611417565b60008281526009602090815260408083206001600160a01b038516845290915290205460ff16156109af5760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c79206772616e7420746f206e6f6e20686f6c6465727300000060448201526064015b60405180910390fd5b6107e08282611497565b60006109c58133611417565b50600e805460ff1916911515919091179055565b6109e382826114ab565b81158015610a52575060405163ca15c87360e01b815260048101839052600090309063ca15c87390602401602060405180830381865afa158015610a2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4f9190612c55565b11155b156107e0576040516357da812b60e11b815260040160405180910390fd5b6000610a7c8133611417565b50600f55565b600e5460ff16610aa557604051637087ed7f60e01b815260040160405180910390fd5b6108fa83838361150d565b600e5460ff16610ad357604051637087ed7f60e01b815260040160405180910390fd5b600080516020612d90833981519152610aec8133611417565b610af582611528565b60405182907f06e860b9ad1db968f3fa36dba43eeb07f1a10537f916df055fcca7dd93ecbf0c90600090a25050565b6000610b2f82611533565b5192915050565b600080516020612d90833981519152610b4f8133611417565b600f5460015460005403610b64906001612ae5565b1115610b835760405163fb88d21560e01b815260040160405180910390fd5b600054610b918360016113f2565b60405181906001600160a01b038516907f50d5e15fad5d417e23950a1a6b5b018dafb68f36dec91f46ca9e4e8f294010da90600090a3505050565b610bd461164d565b610c115760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b60448201526064016109a6565b610c1a8161165e565b50565b60006001600160a01b038216610c46576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6000828152600b602052604081205481805b82811015610d50576000868152600b602090815260408083208484526001019091529020546001600160a01b031615610cf957848203610ce7576000868152600b602090815260408083209383526001909301905220546001600160a01b031692506106d7915050565b610cf2600183612ae5565b9150610d3e565b610d04866000610d59565b8015610d2b57506000868152600b6020908152604080832083805260020190915290205481145b15610d3e57610d3b600183612ae5565b91505b610d49600182612ae5565b9050610c7d565b50505092915050565b60009182526009602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600380546106ec90612a9b565b600e5460ff16610db657604051637087ed7f60e01b815260040160405180910390fd5b6107e082826116f2565b600082815260096020908152604080832083805290915281205460ff16610e0d575060008281526009602090815260408083206001600160a01b038516845290915290205460ff166106d7565b50600192915050565b600e5460ff16610e3957604051637087ed7f60e01b815260040160405180910390fd5b61091884848484611787565b6060610e5082611029565b610eb45760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016109a6565b60108054610ec190612a9b565b80601f0160208091040260200160405190810160405280929190818152602001828054610eed90612a9b565b8015610f3a5780601f10610f0f57610100808354040283529160200191610f3a565b820191906000526020600020905b815481529060010190602001808311610f1d57829003601f168201915b50505050509050919050565b6000818152600b6020526040812054815b81811015610faa576000848152600b602090815260408083208484526001019091529020546001600160a01b031615610f9857610f95600184612ae5565b92505b610fa3600182612ae5565b9050610f57565b50610fb6836000610d59565b15610fc957610fc6600183612ae5565b91505b50919050565b6109e382826117cb565b60006001600160e01b031982166380ac58cd60e01b148061100a57506001600160e01b03198216635b5e139f60e01b145b806106d757506301ffc9a760e01b6001600160e01b03198316146106d7565b60008054821080156106d7575050600090815260046020526040902054600160e01b900460ff161590565b600061105f82610b24565b9050806001600160a01b0316836001600160a01b0316036110935760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216146110ca576110ad813361069e565b6110ca576040516367d9dca160e11b815260040160405180910390fd5b6108fa8383836117e4565b60008061112f6110f36110e787611840565b805190602001206118e9565b85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061191692505050565b60a08601356000908152600d602052604090205490925060ff161580156111695750611169600080516020612d9083398151915283610d59565b9050806111d2576040516306e0450760e31b815260206004820152603060248201527f416c7265616479204d696e746564206f72207369676e657220646f65736e277460448201526f20686173206d696e74657220726f6c6560801b60648201526084016109a6565b6111df6020860186612919565b6001600160a01b0316336001600160a01b031614611234576040516306e0450760e31b8152602060048201526011602482015270125b9d985b1a5908149958da5c1a595b9d607a1b60448201526064016109a6565b42856060013511806112495750846080013542115b15611285576040516306e0450760e31b815260206004820152600b60248201526a14995c48195e1c1a5c995960aa1b60448201526064016109a6565b60006112946020870187612919565b6001600160a01b0316036112e1576040516306e0450760e31b81526020600482015260136024820152721c9958da5c1a595b9d081d5b9919599a5b9959606a1b60448201526064016109a6565b846020013560000361131e576040516306e0450760e31b8152602060048201526005602482015264302071747960d81b60448201526064016109a6565b5060a0909301356000908152600d60205260409020805460ff191660011790555090919050565b80600003611396576040516306e0450760e31b815260206004820152601760248201527f496e76616c69642070726963652070657220746f6b656e00000000000000000060448201526064016109a6565b60006113a28284612c6e565b90508034146113e8576040516306e0450760e31b8152602060048201526011602482015270496e76616c6964206d73672076616c756560781b60448201526064016109a6565b610918848261193a565b6107e08282604051806020016040528060008152506119fb565b6108fa838383611b9e565b60008281526009602090815260408083206001600160a01b038516845290915290205460ff166107e057611455816001600160a01b03166014611d7a565b611460836020611d7a565b604051602001611471929190612c85565b60408051601f198184030181529082905262461bcd60e51b82526109a691600401612738565b6114a18282611f1c565b6107e08282611f77565b336001600160a01b038216146115035760405162461bcd60e51b815260206004820152601a60248201527f43616e206f6e6c792072656e6f756e636520666f722073656c6600000000000060448201526064016109a6565b6107e08282611fe4565b6108fa83838360405180602001604052806000815250610e16565b610c1a81600061203b565b60408051606081018252600080825260208201819052918101919091528160005481101561163457600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906116325780516001600160a01b0316156115c9579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff161515928101929092521561162d579392505050565b6115c9565b505b604051636f96cda160e11b815260040160405180910390fd5b60006116598133610d59565b905090565b6001600160a01b0381166116a85760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b60448201526064016109a6565b600c80546001600160a01b0319166001600160a01b0383169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a250565b336001600160a01b0383160361171b5760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611792848484611b9e565b6001600160a01b0383163b15610918576117ae848484846121ee565b610918576040516368d2bf6b60e11b815260040160405180910390fd5b6000828152600a60205260409020546115039033611417565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60607fb70e961a7da708f5392e1aaf231c1ee28cb869e664424e1df73a73decfc2a5966118706020840184612919565b83602001358460400135856060013586608001358760a001356040516020016118d397969594939291909687526001600160a01b0395909516602087015260408601939093526060850191909152608084015260a083015260c082015260e00190565b6040516020818303038152906040529050919050565b60006106d76118f66122d9565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060006119258585612400565b9150915061193281612445565b509392505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611987576040519150601f19603f3d011682016040523d82523d6000602084013e61198c565b606091505b50509050806119ae5760405163118b852160e31b815260040160405180910390fd5b806108fa5760405162461bcd60e51b815260206004820152601c60248201527f6e617469766520746f6b656e207472616e73666572206661696c65640000000060448201526064016109a6565b6000546001600160a01b038416611a2457604051622e076360e81b815260040160405180910390fd5b82600003611a455760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038416600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168b0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168b01811690920217909155858452600490925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b15611b5b575b60405182906001600160a01b03881690600090600080516020612db0833981519152908290a4611b2460008784806001019550876121ee565b611b41576040516368d2bf6b60e11b815260040160405180910390fd5b808210611aeb578260005414611b5657600080fd5b611b8e565b5b6040516001830192906001600160a01b03881690600090600080516020612db0833981519152908290a4808210611b5c575b5060009081556109189085838684565b6000611ba982611533565b9050836001600160a01b031681600001516001600160a01b031614611be05760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611bfe5750611bfe853361069e565b80611c19575033611c0e8461076f565b6001600160a01b0316145b905080611c3957604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038416611c6057604051633a954ecd60e21b815260040160405180910390fd5b611c6c600084876117e4565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116611d40576000548214611d4057805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b0316600080516020612db083398151915260405160405180910390a45b5050505050565b60606000611d89836002612c6e565b611d94906002612ae5565b6001600160401b03811115611dab57611dab612980565b6040519080825280601f01601f191660200182016040528015611dd5576020820181803683370190505b509050600360fc1b81600081518110611df057611df0612cf2565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611e1f57611e1f612cf2565b60200101906001600160f81b031916908160001a9053506000611e43846002612c6e565b611e4e906001612ae5565b90505b6001811115611ec6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611e8257611e82612cf2565b1a60f81b828281518110611e9857611e98612cf2565b60200101906001600160f81b031916908160001a90535060049490941c93611ebf81612d08565b9050611e51565b508315611f155760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109a6565b9392505050565b60008281526009602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000828152600b6020526040812080549160019190611f968385612ae5565b90915550506000928352600b6020908152604080852083865260018101835281862080546001600160a01b039096166001600160a01b03199096168617905593855260029093019052912055565b611fee828261258f565b6000828152600b602090815260408083206001600160a01b03851680855260028201808552838620805487526001909301855292852080546001600160a01b031916905584529152555050565b600061204683611533565b805190915082156120ac576000336001600160a01b038316148061206f575061206f823361069e565b8061208a57503361207f8661076f565b6001600160a01b0316145b9050806120aa57604051632ce44b5f60e11b815260040160405180910390fd5b505b6120b8600085836117e4565b6001600160a01b0380821660008181526005602090815260408083208054600160801b6000196001600160401b0380841691909101811667ffffffffffffffff198416811783900482166001908101831690930277ffffffffffffffff0000000000000000ffffffffffffffff19909416179290921783558b86526004909452828520805460ff60e01b1942909316600160a01b026001600160e01b03199091169097179690961716600160e01b1785559189018084529220805491949091166121b65760005482146121b657805460208701516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038716171781555b5050604051869250600091506001600160a01b03841690600080516020612db0833981519152908390a4505060018054810190555050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612223903390899088908890600401612d1f565b6020604051808303816000875af192505050801561225e575060408051601f3d908101601f1916820190925261225b91810190612d5c565b60015b6122bc573d80801561228c576040519150601f19603f3d011682016040523d82523d6000602084013e612291565b606091505b5080516000036122b4576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561233257507f000000000000000000000000000000000000000000000000000000000000000046145b1561235c57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b60008082516041036124365760208301516040840151606085015160001a61242a878285856125f1565b9450945050505061243e565b506000905060025b9250929050565b600081600481111561245957612459612d79565b036124615750565b600181600481111561247557612475612d79565b036124c25760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109a6565b60028160048111156124d6576124d6612d79565b036125235760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109a6565b600381600481111561253757612537612d79565b03610c1a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016109a6565b6125998282611417565b60008281526009602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561262857506000905060036126ac565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561267c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166126a5576000600192509250506126ac565b9150600090505b94509492505050565b6001600160e01b031981168114610c1a57600080fd5b6000602082840312156126dd57600080fd5b8135611f15816126b5565b60005b838110156127035781810151838201526020016126eb565b50506000910152565b600081518084526127248160208601602086016126e8565b601f01601f19169290920160200192915050565b602081526000611f15602083018461270c565b60006020828403121561275d57600080fd5b5035919050565b80356001600160a01b038116811461277b57600080fd5b919050565b6000806040838503121561279357600080fd5b61279c83612764565b946020939093013593505050565b60008083601f8401126127bc57600080fd5b5081356001600160401b038111156127d357600080fd5b60208301915083602082850101111561243e57600080fd5b600080600083850360e081121561280157600080fd5b60c081121561280f57600080fd5b5083925060c08401356001600160401b0381111561282c57600080fd5b612838868287016127aa565b9497909650939450505050565b60008060006060848603121561285a57600080fd5b61286384612764565b925061287160208501612764565b9150604084013590509250925092565b6000806020838503121561289457600080fd5b82356001600160401b038111156128aa57600080fd5b6128b6858286016127aa565b90969095509350505050565b600080604083850312156128d557600080fd5b823591506128e560208401612764565b90509250929050565b8035801515811461277b57600080fd5b60006020828403121561291057600080fd5b611f15826128ee565b60006020828403121561292b57600080fd5b611f1582612764565b6000806040838503121561294757600080fd5b50508035926020909101359150565b6000806040838503121561296957600080fd5b61297283612764565b91506128e5602084016128ee565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156129ac57600080fd5b6129b585612764565b93506129c360208601612764565b92506040850135915060608501356001600160401b03808211156129e657600080fd5b818701915087601f8301126129fa57600080fd5b813581811115612a0c57612a0c612980565b604051601f8201601f19908116603f01168101908382118183101715612a3457612a34612980565b816040528281528a6020848701011115612a4d57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215612a8457600080fd5b612a8d83612764565b91506128e560208401612764565b600181811c90821680612aaf57607f821691505b602082108103610fc957634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156106d7576106d7612acf565b60c081016001600160a01b03612b0d84612764565b1682526020830135602083015260408301356040830152606083013560608301526080830135608083015260a083013560a083015292915050565b601f8211156108fa57600081815260208120601f850160051c81016020861015612b6f5750805b601f850160051c820191505b81811015612b8e57828155600101612b7b565b505050505050565b6001600160401b03831115612bad57612bad612980565b612bc183612bbb8354612a9b565b83612b48565b6000601f841160018114612bf55760008515612bdd5750838201355b600019600387901b1c1916600186901b178355611d73565b600083815260209020601f19861690835b82811015612c265786850135825560209485019460019092019101612c06565b5086821015612c435760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060208284031215612c6757600080fd5b5051919050565b80820281158282048414176106d7576106d7612acf565b7402832b936b4b9b9b4b7b7399d1030b1b1b7bab73a1605d1b815260008351612cb58160158501602088016126e8565b7001034b99036b4b9b9b4b733903937b6329607d1b6015918401918201528351612ce68160268401602088016126e8565b01602601949350505050565b634e487b7160e01b600052603260045260246000fd5b600081612d1757612d17612acf565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d529083018461270c565b9695505050505050565b600060208284031215612d6e57600080fd5b8151611f15816126b5565b634e487b7160e01b600052602160045260246000fdfe9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212200a4e8dc585390ff18b7cecfa48e1388359cef21672724a779d7a94f5c2f7595d64736f6c634300081400339f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000004ebbf1ea0b218ac7fc28ee2b9c057994e341db880000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000b62797468656e2063686970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000662797468656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d4e5152346a44366b594844664e324d466b61524d764a4477725a52676854634a7556417350453273566f79350000000000000000000000
Deployed Bytecode
0x60806040526004361061020f5760003560e01c80636352211e11610118578063a22cb465116100a0578063c87b56dd1161006f578063c87b56dd14610601578063ca15c87314610621578063d539139314610641578063d547741f14610663578063e985e9c51461068357600080fd5b8063a22cb46514610571578063a2be6bd214610591578063a32fa5b3146105c1578063b88d4fde146105e157600080fd5b80639010d07c116100e75780639010d07c146104ed57806391d148541461050d57806395d89b411461052d5780639abcd7c214610542578063a217fddf1461055c57600080fd5b80636352211e1461046d5780636a6278421461048d5780636f4f2837146104ad57806370a08231146104cd57600080fd5b80632639f4601161019b57806336568abe1161016a57806336568abe146103d85780633b1475a7146103f85780633f3e4c111461040d57806342842e0e1461042d57806342966c681461044d57600080fd5b80632639f460146103625780632ab4d052146103825780632f2ff15d1461039857806335dff9ba146103b857600080fd5b8063095ea7b3116101e2578063095ea7b3146102bd57806318160ddd146102df5780631a23a7eb1461030257806323b872dd14610315578063248a9ca31461033557600080fd5b806301ffc9a71461021457806306fdde0314610249578063079fe40e1461026b578063081812fc1461029d575b600080fd5b34801561022057600080fd5b5061023461022f3660046126cb565b6106cc565b60405190151581526020015b60405180910390f35b34801561025557600080fd5b5061025e6106dd565b6040516102409190612738565b34801561027757600080fd5b50600c546001600160a01b03165b6040516001600160a01b039091168152602001610240565b3480156102a957600080fd5b506102856102b836600461274b565b61076f565b3480156102c957600080fd5b506102dd6102d8366004612780565b6107b3565b005b3480156102eb57600080fd5b50600154600054035b604051908152602001610240565b6102856103103660046127eb565b6107e4565b34801561032157600080fd5b506102dd610330366004612845565b6108cc565b34801561034157600080fd5b506102f461035036600461274b565b6000908152600a602052604090205490565b34801561036e57600080fd5b506102dd61037d366004612881565b6108ff565b34801561038e57600080fd5b506102f4600f5481565b3480156103a457600080fd5b506102dd6103b33660046128c2565b61091e565b3480156103c457600080fd5b506102dd6103d33660046128fe565b6109b9565b3480156103e457600080fd5b506102dd6103f33660046128c2565b6109d9565b34801561040457600080fd5b506000546102f4565b34801561041957600080fd5b506102dd61042836600461274b565b610a70565b34801561043957600080fd5b506102dd610448366004612845565b610a82565b34801561045957600080fd5b506102dd61046836600461274b565b610ab0565b34801561047957600080fd5b5061028561048836600461274b565b610b24565b34801561049957600080fd5b506102dd6104a8366004612919565b610b36565b3480156104b957600080fd5b506102dd6104c8366004612919565b610bcc565b3480156104d957600080fd5b506102f46104e8366004612919565b610c1d565b3480156104f957600080fd5b50610285610508366004612934565b610c6b565b34801561051957600080fd5b506102346105283660046128c2565b610d59565b34801561053957600080fd5b5061025e610d84565b34801561054e57600080fd5b50600e546102349060ff1681565b34801561056857600080fd5b506102f4600081565b34801561057d57600080fd5b506102dd61058c366004612956565b610d93565b34801561059d57600080fd5b506102346105ac36600461274b565b6000908152600d602052604090205460ff1690565b3480156105cd57600080fd5b506102346105dc3660046128c2565b610dc0565b3480156105ed57600080fd5b506102dd6105fc366004612996565b610e16565b34801561060d57600080fd5b5061025e61061c36600461274b565b610e45565b34801561062d57600080fd5b506102f461063c36600461274b565b610f46565b34801561064d57600080fd5b506102f4600080516020612d9083398151915281565b34801561066f57600080fd5b506102dd61067e3660046128c2565b610fcf565b34801561068f57600080fd5b5061023461069e366004612a71565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b60006106d782610fd9565b92915050565b6060600280546106ec90612a9b565b80601f016020809104026020016040519081016040528092919081815260200182805461071890612a9b565b80156107655780601f1061073a57610100808354040283529160200191610765565b820191906000526020600020905b81548152906001019060200180831161074857829003601f168201915b5050505050905090565b600061077a82611029565b610797576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600e5460ff166107d657604051637087ed7f60e01b815260040160405180910390fd5b6107e08282611054565b5050565b6000600f5484602001356107fb6001546000540390565b6108059190612ae5565b11156108245760405163fb88d21560e01b815260040160405180910390fd5b6000546108328585856110d5565b915060006108436020870187612919565b905061086961085a600c546001600160a01b031690565b87602001358860400135611345565b6108778187602001356113f2565b81816001600160a01b0316846001600160a01b03167fbb30f850affc4106b21aa99ef28533a2f3ef9c2ee4abbded1fb71b032db573f3896040516108bb9190612af8565b60405180910390a450509392505050565b600e5460ff166108ef57604051637087ed7f60e01b815260040160405180910390fd5b6108fa83838361140c565b505050565b600061090b8133611417565b6010610918838583612b96565b50505050565b6000828152600a60205260409020546109379033611417565b60008281526009602090815260408083206001600160a01b038516845290915290205460ff16156109af5760405162461bcd60e51b815260206004820152601d60248201527f43616e206f6e6c79206772616e7420746f206e6f6e20686f6c6465727300000060448201526064015b60405180910390fd5b6107e08282611497565b60006109c58133611417565b50600e805460ff1916911515919091179055565b6109e382826114ab565b81158015610a52575060405163ca15c87360e01b815260048101839052600090309063ca15c87390602401602060405180830381865afa158015610a2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4f9190612c55565b11155b156107e0576040516357da812b60e11b815260040160405180910390fd5b6000610a7c8133611417565b50600f55565b600e5460ff16610aa557604051637087ed7f60e01b815260040160405180910390fd5b6108fa83838361150d565b600e5460ff16610ad357604051637087ed7f60e01b815260040160405180910390fd5b600080516020612d90833981519152610aec8133611417565b610af582611528565b60405182907f06e860b9ad1db968f3fa36dba43eeb07f1a10537f916df055fcca7dd93ecbf0c90600090a25050565b6000610b2f82611533565b5192915050565b600080516020612d90833981519152610b4f8133611417565b600f5460015460005403610b64906001612ae5565b1115610b835760405163fb88d21560e01b815260040160405180910390fd5b600054610b918360016113f2565b60405181906001600160a01b038516907f50d5e15fad5d417e23950a1a6b5b018dafb68f36dec91f46ca9e4e8f294010da90600090a3505050565b610bd461164d565b610c115760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b60448201526064016109a6565b610c1a8161165e565b50565b60006001600160a01b038216610c46576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6000828152600b602052604081205481805b82811015610d50576000868152600b602090815260408083208484526001019091529020546001600160a01b031615610cf957848203610ce7576000868152600b602090815260408083209383526001909301905220546001600160a01b031692506106d7915050565b610cf2600183612ae5565b9150610d3e565b610d04866000610d59565b8015610d2b57506000868152600b6020908152604080832083805260020190915290205481145b15610d3e57610d3b600183612ae5565b91505b610d49600182612ae5565b9050610c7d565b50505092915050565b60009182526009602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600380546106ec90612a9b565b600e5460ff16610db657604051637087ed7f60e01b815260040160405180910390fd5b6107e082826116f2565b600082815260096020908152604080832083805290915281205460ff16610e0d575060008281526009602090815260408083206001600160a01b038516845290915290205460ff166106d7565b50600192915050565b600e5460ff16610e3957604051637087ed7f60e01b815260040160405180910390fd5b61091884848484611787565b6060610e5082611029565b610eb45760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016109a6565b60108054610ec190612a9b565b80601f0160208091040260200160405190810160405280929190818152602001828054610eed90612a9b565b8015610f3a5780601f10610f0f57610100808354040283529160200191610f3a565b820191906000526020600020905b815481529060010190602001808311610f1d57829003601f168201915b50505050509050919050565b6000818152600b6020526040812054815b81811015610faa576000848152600b602090815260408083208484526001019091529020546001600160a01b031615610f9857610f95600184612ae5565b92505b610fa3600182612ae5565b9050610f57565b50610fb6836000610d59565b15610fc957610fc6600183612ae5565b91505b50919050565b6109e382826117cb565b60006001600160e01b031982166380ac58cd60e01b148061100a57506001600160e01b03198216635b5e139f60e01b145b806106d757506301ffc9a760e01b6001600160e01b03198316146106d7565b60008054821080156106d7575050600090815260046020526040902054600160e01b900460ff161590565b600061105f82610b24565b9050806001600160a01b0316836001600160a01b0316036110935760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216146110ca576110ad813361069e565b6110ca576040516367d9dca160e11b815260040160405180910390fd5b6108fa8383836117e4565b60008061112f6110f36110e787611840565b805190602001206118e9565b85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061191692505050565b60a08601356000908152600d602052604090205490925060ff161580156111695750611169600080516020612d9083398151915283610d59565b9050806111d2576040516306e0450760e31b815260206004820152603060248201527f416c7265616479204d696e746564206f72207369676e657220646f65736e277460448201526f20686173206d696e74657220726f6c6560801b60648201526084016109a6565b6111df6020860186612919565b6001600160a01b0316336001600160a01b031614611234576040516306e0450760e31b8152602060048201526011602482015270125b9d985b1a5908149958da5c1a595b9d607a1b60448201526064016109a6565b42856060013511806112495750846080013542115b15611285576040516306e0450760e31b815260206004820152600b60248201526a14995c48195e1c1a5c995960aa1b60448201526064016109a6565b60006112946020870187612919565b6001600160a01b0316036112e1576040516306e0450760e31b81526020600482015260136024820152721c9958da5c1a595b9d081d5b9919599a5b9959606a1b60448201526064016109a6565b846020013560000361131e576040516306e0450760e31b8152602060048201526005602482015264302071747960d81b60448201526064016109a6565b5060a0909301356000908152600d60205260409020805460ff191660011790555090919050565b80600003611396576040516306e0450760e31b815260206004820152601760248201527f496e76616c69642070726963652070657220746f6b656e00000000000000000060448201526064016109a6565b60006113a28284612c6e565b90508034146113e8576040516306e0450760e31b8152602060048201526011602482015270496e76616c6964206d73672076616c756560781b60448201526064016109a6565b610918848261193a565b6107e08282604051806020016040528060008152506119fb565b6108fa838383611b9e565b60008281526009602090815260408083206001600160a01b038516845290915290205460ff166107e057611455816001600160a01b03166014611d7a565b611460836020611d7a565b604051602001611471929190612c85565b60408051601f198184030181529082905262461bcd60e51b82526109a691600401612738565b6114a18282611f1c565b6107e08282611f77565b336001600160a01b038216146115035760405162461bcd60e51b815260206004820152601a60248201527f43616e206f6e6c792072656e6f756e636520666f722073656c6600000000000060448201526064016109a6565b6107e08282611fe4565b6108fa83838360405180602001604052806000815250610e16565b610c1a81600061203b565b60408051606081018252600080825260208201819052918101919091528160005481101561163457600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906116325780516001600160a01b0316156115c9579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff161515928101929092521561162d579392505050565b6115c9565b505b604051636f96cda160e11b815260040160405180910390fd5b60006116598133610d59565b905090565b6001600160a01b0381166116a85760405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081c9958da5c1a595b9d607a1b60448201526064016109a6565b600c80546001600160a01b0319166001600160a01b0383169081179091556040517f299d17e95023f496e0ffc4909cff1a61f74bb5eb18de6f900f4155bfa1b3b33390600090a250565b336001600160a01b0383160361171b5760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611792848484611b9e565b6001600160a01b0383163b15610918576117ae848484846121ee565b610918576040516368d2bf6b60e11b815260040160405180910390fd5b6000828152600a60205260409020546115039033611417565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60607fb70e961a7da708f5392e1aaf231c1ee28cb869e664424e1df73a73decfc2a5966118706020840184612919565b83602001358460400135856060013586608001358760a001356040516020016118d397969594939291909687526001600160a01b0395909516602087015260408601939093526060850191909152608084015260a083015260c082015260e00190565b6040516020818303038152906040529050919050565b60006106d76118f66122d9565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060006119258585612400565b9150915061193281612445565b509392505050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611987576040519150601f19603f3d011682016040523d82523d6000602084013e61198c565b606091505b50509050806119ae5760405163118b852160e31b815260040160405180910390fd5b806108fa5760405162461bcd60e51b815260206004820152601c60248201527f6e617469766520746f6b656e207472616e73666572206661696c65640000000060448201526064016109a6565b6000546001600160a01b038416611a2457604051622e076360e81b815260040160405180910390fd5b82600003611a455760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038416600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168b0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168b01811690920217909155858452600490925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b15611b5b575b60405182906001600160a01b03881690600090600080516020612db0833981519152908290a4611b2460008784806001019550876121ee565b611b41576040516368d2bf6b60e11b815260040160405180910390fd5b808210611aeb578260005414611b5657600080fd5b611b8e565b5b6040516001830192906001600160a01b03881690600090600080516020612db0833981519152908290a4808210611b5c575b5060009081556109189085838684565b6000611ba982611533565b9050836001600160a01b031681600001516001600160a01b031614611be05760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480611bfe5750611bfe853361069e565b80611c19575033611c0e8461076f565b6001600160a01b0316145b905080611c3957604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038416611c6057604051633a954ecd60e21b815260040160405180910390fd5b611c6c600084876117e4565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116611d40576000548214611d4057805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b0316600080516020612db083398151915260405160405180910390a45b5050505050565b60606000611d89836002612c6e565b611d94906002612ae5565b6001600160401b03811115611dab57611dab612980565b6040519080825280601f01601f191660200182016040528015611dd5576020820181803683370190505b509050600360fc1b81600081518110611df057611df0612cf2565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611e1f57611e1f612cf2565b60200101906001600160f81b031916908160001a9053506000611e43846002612c6e565b611e4e906001612ae5565b90505b6001811115611ec6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611e8257611e82612cf2565b1a60f81b828281518110611e9857611e98612cf2565b60200101906001600160f81b031916908160001a90535060049490941c93611ebf81612d08565b9050611e51565b508315611f155760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109a6565b9392505050565b60008281526009602090815260408083206001600160a01b0385168085529252808320805460ff1916600117905551339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6000828152600b6020526040812080549160019190611f968385612ae5565b90915550506000928352600b6020908152604080852083865260018101835281862080546001600160a01b039096166001600160a01b03199096168617905593855260029093019052912055565b611fee828261258f565b6000828152600b602090815260408083206001600160a01b03851680855260028201808552838620805487526001909301855292852080546001600160a01b031916905584529152555050565b600061204683611533565b805190915082156120ac576000336001600160a01b038316148061206f575061206f823361069e565b8061208a57503361207f8661076f565b6001600160a01b0316145b9050806120aa57604051632ce44b5f60e11b815260040160405180910390fd5b505b6120b8600085836117e4565b6001600160a01b0380821660008181526005602090815260408083208054600160801b6000196001600160401b0380841691909101811667ffffffffffffffff198416811783900482166001908101831690930277ffffffffffffffff0000000000000000ffffffffffffffff19909416179290921783558b86526004909452828520805460ff60e01b1942909316600160a01b026001600160e01b03199091169097179690961716600160e01b1785559189018084529220805491949091166121b65760005482146121b657805460208701516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038716171781555b5050604051869250600091506001600160a01b03841690600080516020612db0833981519152908390a4505060018054810190555050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612223903390899088908890600401612d1f565b6020604051808303816000875af192505050801561225e575060408051601f3d908101601f1916820190925261225b91810190612d5c565b60015b6122bc573d80801561228c576040519150601f19603f3d011682016040523d82523d6000602084013e612291565b606091505b5080516000036122b4576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000306001600160a01b037f000000000000000000000000d665ee841be2f06adc3f2ca56676f529a624347c1614801561233257507f000000000000000000000000000000000000000000000000000000000000000146145b1561235c57507feab837fcd7e87e0bcb1d2318cfd2d806245ae1a41f87dbb0e91ff57a9a4de21990565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f9afdb26dde7e26f42574e4bdbbbc8abe0839ce7654d5912e32e87c417b9912f4828401527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c60608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b60008082516041036124365760208301516040840151606085015160001a61242a878285856125f1565b9450945050505061243e565b506000905060025b9250929050565b600081600481111561245957612459612d79565b036124615750565b600181600481111561247557612475612d79565b036124c25760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109a6565b60028160048111156124d6576124d6612d79565b036125235760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109a6565b600381600481111561253757612537612d79565b03610c1a5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016109a6565b6125998282611417565b60008281526009602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561262857506000905060036126ac565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561267c573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166126a5576000600192509250506126ac565b9150600090505b94509492505050565b6001600160e01b031981168114610c1a57600080fd5b6000602082840312156126dd57600080fd5b8135611f15816126b5565b60005b838110156127035781810151838201526020016126eb565b50506000910152565b600081518084526127248160208601602086016126e8565b601f01601f19169290920160200192915050565b602081526000611f15602083018461270c565b60006020828403121561275d57600080fd5b5035919050565b80356001600160a01b038116811461277b57600080fd5b919050565b6000806040838503121561279357600080fd5b61279c83612764565b946020939093013593505050565b60008083601f8401126127bc57600080fd5b5081356001600160401b038111156127d357600080fd5b60208301915083602082850101111561243e57600080fd5b600080600083850360e081121561280157600080fd5b60c081121561280f57600080fd5b5083925060c08401356001600160401b0381111561282c57600080fd5b612838868287016127aa565b9497909650939450505050565b60008060006060848603121561285a57600080fd5b61286384612764565b925061287160208501612764565b9150604084013590509250925092565b6000806020838503121561289457600080fd5b82356001600160401b038111156128aa57600080fd5b6128b6858286016127aa565b90969095509350505050565b600080604083850312156128d557600080fd5b823591506128e560208401612764565b90509250929050565b8035801515811461277b57600080fd5b60006020828403121561291057600080fd5b611f15826128ee565b60006020828403121561292b57600080fd5b611f1582612764565b6000806040838503121561294757600080fd5b50508035926020909101359150565b6000806040838503121561296957600080fd5b61297283612764565b91506128e5602084016128ee565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156129ac57600080fd5b6129b585612764565b93506129c360208601612764565b92506040850135915060608501356001600160401b03808211156129e657600080fd5b818701915087601f8301126129fa57600080fd5b813581811115612a0c57612a0c612980565b604051601f8201601f19908116603f01168101908382118183101715612a3457612a34612980565b816040528281528a6020848701011115612a4d57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215612a8457600080fd5b612a8d83612764565b91506128e560208401612764565b600181811c90821680612aaf57607f821691505b602082108103610fc957634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156106d7576106d7612acf565b60c081016001600160a01b03612b0d84612764565b1682526020830135602083015260408301356040830152606083013560608301526080830135608083015260a083013560a083015292915050565b601f8211156108fa57600081815260208120601f850160051c81016020861015612b6f5750805b601f850160051c820191505b81811015612b8e57828155600101612b7b565b505050505050565b6001600160401b03831115612bad57612bad612980565b612bc183612bbb8354612a9b565b83612b48565b6000601f841160018114612bf55760008515612bdd5750838201355b600019600387901b1c1916600186901b178355611d73565b600083815260209020601f19861690835b82811015612c265786850135825560209485019460019092019101612c06565b5086821015612c435760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060208284031215612c6757600080fd5b5051919050565b80820281158282048414176106d7576106d7612acf565b7402832b936b4b9b9b4b7b7399d1030b1b1b7bab73a1605d1b815260008351612cb58160158501602088016126e8565b7001034b99036b4b9b9b4b733903937b6329607d1b6015918401918201528351612ce68160268401602088016126e8565b01602601949350505050565b634e487b7160e01b600052603260045260246000fd5b600081612d1757612d17612acf565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612d529083018461270c565b9695505050505050565b600060208284031215612d6e57600080fd5b8151611f15816126b5565b634e487b7160e01b600052602160045260246000fdfe9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212200a4e8dc585390ff18b7cecfa48e1388359cef21672724a779d7a94f5c2f7595d64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000004ebbf1ea0b218ac7fc28ee2b9c057994e341db880000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000b62797468656e2063686970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000662797468656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d4e5152346a44366b594844664e324d466b61524d764a4477725a52676854634a7556417350453273566f79350000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): bythen chip
Arg [1] : symbol (string): bythen
Arg [2] : _primarySaleRecipient (address): 0x4eBbf1EA0b218aC7Fc28EE2B9C057994E341DB88
Arg [3] : _collectionURI (string): ipfs://QmNQR4jD6kYHDfN2MFkaRMvJDwrZRghTcJuVAsPE2sVoy5
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000004ebbf1ea0b218ac7fc28ee2b9c057994e341db88
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [4] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [5] : 62797468656e2063686970000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [7] : 62797468656e0000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000035
Arg [9] : 697066733a2f2f516d4e5152346a44366b594844664e324d466b61524d764a44
Arg [10] : 77725a52676854634a7556417350453273566f79350000000000000000000000
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.