Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
TokenTracker
Multi Chain
Multichain Addresses
0 address found via
Latest 25 from a total of 109 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Mint With URI | 9954122 | 37 days 4 hrs ago | IN | 0 ETH | 0 | ||||
Set Approval For... | 9813177 | 61 days 17 hrs ago | IN | 0 ETH | 0.0000925 | ||||
Approve | 9709941 | 79 days 20 hrs ago | IN | 0 ETH | 0 | ||||
Mint With URI | 9709896 | 79 days 20 hrs ago | IN | 0 ETH | 0 | ||||
Transfer From | 9696518 | 82 days 3 hrs ago | IN | 0 ETH | 0 | ||||
Approve | 9652073 | 89 days 18 hrs ago | IN | 0 ETH | 0 | ||||
Mint With URI Ba... | 9652032 | 89 days 19 hrs ago | IN | 0 ETH | 0 | ||||
Mint With URI | 9639029 | 92 days 1 hr ago | IN | 0 ETH | 0 | ||||
Mint With URI | 9592032 | 100 days 6 hrs ago | IN | 0 ETH | 0.0002428 | ||||
Mint With URI | 9576545 | 102 days 23 hrs ago | IN | 0 ETH | 0.00000011 | ||||
Set Approval For... | 9572379 | 103 days 17 hrs ago | IN | 0 ETH | 0.0000925 | ||||
Approve | 9571753 | 103 days 19 hrs ago | IN | 0 ETH | 0.00009748 | ||||
Mint With URI | 9571729 | 103 days 19 hrs ago | IN | 0 ETH | 0.00049124 | ||||
Mint With URI | 9570775 | 104 days 12 mins ago | IN | 0 ETH | 0.00000242 | ||||
Mint With URI | 9566936 | 104 days 17 hrs ago | IN | 0 ETH | 0.00000696 | ||||
Set Approval For... | 9566083 | 104 days 20 hrs ago | IN | 0 ETH | 0.00000132 | ||||
Mint With URI | 9566070 | 104 days 20 hrs ago | IN | 0 ETH | 0.00000696 | ||||
Mint With URI | 9564941 | 105 days 1 hr ago | IN | 0 ETH | 0.00003884 | ||||
Mint With URI | 9560134 | 105 days 23 hrs ago | IN | 0 ETH | 0 | ||||
Mint With URI | 9559886 | 106 days 5 mins ago | IN | 0 ETH | 0 | ||||
Mint With URI Ba... | 9559605 | 106 days 1 hr ago | IN | 0 ETH | 0.00109692 | ||||
Mint With URI | 9556365 | 106 days 15 hrs ago | IN | 0 ETH | 0.00002858 | ||||
Mint With URI | 9327033 | 147 days 19 hrs ago | IN | 0 ETH | 0.00364897 | ||||
Mint With URI Ba... | 9113018 | 185 days 23 hrs ago | IN | 0 ETH | 0.03201959 | ||||
Set Approval For... | 9059743 | 194 days 22 hrs ago | IN | 0 ETH | 0.00010383 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Txn Hash | Block | From | To | Value | ||
---|---|---|---|---|---|---|
9954122 | 37 days 4 hrs ago | 0 ETH | ||||
9813189 | 61 days 17 hrs ago | 0 ETH | ||||
9813189 | 61 days 17 hrs ago | 0 ETH | ||||
9813189 | 61 days 17 hrs ago | 0 ETH | ||||
9813189 | 61 days 17 hrs ago | 0 ETH | ||||
9813189 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9813178 | 61 days 17 hrs ago | 0 ETH | ||||
9709946 | 79 days 20 hrs ago | 0 ETH | ||||
9709946 | 79 days 20 hrs ago | 0 ETH | ||||
9709946 | 79 days 20 hrs ago | 0 ETH | ||||
9709946 | 79 days 20 hrs ago | 0 ETH | ||||
9709946 | 79 days 20 hrs ago | 0 ETH | ||||
9709896 | 79 days 20 hrs ago | 0 ETH | ||||
9652074 | 89 days 18 hrs ago | 0 ETH | ||||
9652074 | 89 days 18 hrs ago | 0 ETH | ||||
9652074 | 89 days 18 hrs ago | 0 ETH |
Loading...
Loading
Contract Name:
EnvelopUsers721UniStorageEnum
Compiler Version
v0.8.16+commit.07a7930e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // ENVELOP protocol for NFT. Mintable User NFT Collection pragma solidity 0.8.16; import "ERC721Enumerable.sol"; import "Ownable.sol"; import "ECDSA.sol"; import "EnvelopUsers721Swarm.sol"; import "Subscriber.sol"; contract EnvelopUsers721UniStorageEnum is ERC721Enumerable, Ownable, Subscriber { using ECDSA for bytes32; using Strings for uint256; using Strings for uint160; string private _baseTokenURI; // Oracle signers status mapping(address => bool) public oracleSigners; // mapping from url prefix to baseUrl mapping(bytes4 => string) public baseByPrefix; constructor( string memory name_, string memory symbol_, string memory _baseurl, uint256 _code ) ERC721(name_, symbol_) Subscriber(_code) { _baseTokenURI = string( abi.encodePacked( _baseurl, block.chainid.toString(), "/", uint160(address(this)).toHexString(), "/" ) ); } ////////////////////////////////////////////////////////////////////// /// Section below is OppenZeppelin ERC721URIStorage inmplementation / ////////////////////////////////////////////////////////////////////// // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); // ------------------------------------ // For public Envelop mint app bytes4 prefix = bytes4(bytes(_tokenURI)); if ( prefix == bytes4(bytes("bzz:")) || prefix == bytes4(bytes("ipfs")) ) { base = baseByPrefix[prefix]; } // -------------------------------------- // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev See {ERC721-_burn}. This override additionally checks to see if a * token-specific URI was set for the token, and if so, it deletes the token URI from * the storage mapping. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } ///////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////// function mintWithURI( address _to, uint256 _tokenId, string calldata _tokenURI, bytes calldata _signature ) public { // If signature present - lets checkit if (_signature.length > 0) { bytes32 msgMustWasSigned = keccak256(abi.encode( msg.sender, _tokenId, _tokenURI )).toEthSignedMessageHash(); // Check signature author require(oracleSigners[msgMustWasSigned.recover(_signature)], "Unexpected signer"); // If there is no signature then sender must have valid status } else { require( _checkAndFixSubscription(msg.sender), "Has No Subscription" ); } _mintWithURI(_to, _tokenId, _tokenURI); } function mintWithURIBatch( address[] calldata _to, uint256[] calldata _tokenId, string[] calldata _tokenURI, bytes[] calldata _signature ) external { for (uint256 i = 0; i < _to.length; i ++){ mintWithURI(_to[i], _tokenId[i], _tokenURI[i], _signature[i]); } } ////////////////////////////// // Admin functions /// ////////////////////////////// function setSignerStatus(address _signer, bool _status) external onlyOwner { oracleSigners[_signer] = _status; } function setSubscriptionManager(address _manager) external onlyOwner { _setSubscriptionManager(_manager); } function setPrefixURI(bytes4 _prefix, string memory _base) public virtual onlyOwner { baseByPrefix[_prefix] = _base; } /////////////////////////////// function _mintWithURI(address _to, uint256 _tokenId, string memory _tokenURI) internal { _mint(_to, _tokenId); _setTokenURI(_tokenId, _tokenURI); } function baseURI() external view returns (string memory) { return _baseURI(); } function _baseURI() internal view override returns (string memory) { return _baseTokenURI; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "ERC721.sol"; import "IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * 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, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "IERC721.sol"; import "IERC721Receiver.sol"; import "IERC721Metadata.sol"; import "Address.sol"; import "Context.sol"; import "Strings.sol"; import "ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // 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; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @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) { _requireMinted(tokenId); 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 overridden 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 = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_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 { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _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 { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @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. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @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`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * 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 ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a 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 _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * 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, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// 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.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // 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 Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @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 if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // ENVELOP protocol for NFT. Mintable User NFT Collection pragma solidity 0.8.16; import "ERC721URIStorage.sol"; import "Ownable.sol"; import "ECDSA.sol"; import "Subscriber.sol"; contract EnvelopUsers721Swarm is ERC721URIStorage, Ownable, Subscriber { using ECDSA for bytes32; //address public subscriptionManager; string private _baseTokenURI; // Oracle signers status mapping(address => bool) public oracleSigners; constructor( string memory name_, string memory symbol_, string memory _baseurl, uint256 _code ) ERC721(name_, symbol_) Subscriber(_code) { _baseTokenURI = _baseurl; } function mintWithURI( address _to, uint256 _tokenId, string calldata _tokenURI, bytes calldata _signature ) public { // If signature present - lets checkit if (_signature.length > 0) { bytes32 msgMustWasSigned = keccak256(abi.encode( msg.sender, _tokenId, _tokenURI )).toEthSignedMessageHash(); // Check signature author require(oracleSigners[msgMustWasSigned.recover(_signature)], "Unexpected signer"); // If there is no signature then sender must have valid status } else { require( _checkAndFixSubscription(msg.sender), "Has No Subscription" ); } _mintWithURI(_to, _tokenId, _tokenURI); } function mintWithURIBatch( address[] calldata _to, uint256[] calldata _tokenId, string[] calldata _tokenURI, bytes[] calldata _signature ) external { for (uint256 i = 0; i < _to.length; i ++){ mintWithURI(_to[i], _tokenId[i], _tokenURI[i], _signature[i]); } } ////////////////////////////// // Admin functions /// ////////////////////////////// function setSignerStatus(address _signer, bool _status) external onlyOwner { oracleSigners[_signer] = _status; } function setSubscriptionManager(address _manager) external onlyOwner { _setSubscriptionManager(_manager); } function setBaseURI(string memory _newBaseURI) external onlyOwner { _baseTokenURI = _newBaseURI; } /////////////////////////////// function _mintWithURI(address _to, uint256 _tokenId, string memory _tokenURI) internal { _mint(_to, _tokenId); _setTokenURI(_tokenId, _tokenURI); } function baseURI() external view returns (string memory) { return _baseURI(); } function _baseURI() internal view override returns (string memory) { return _baseTokenURI; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.0; import "ERC721.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorage is ERC721 { using Strings for uint256; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev See {ERC721-_burn}. This override additionally checks to see if a * token-specific URI was set for the token, and if so, it deletes the token URI from * the storage mapping. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
// SPDX-License-Identifier: MIT // ENVELOP(NIFTSY) protocol V1 for NFT. Subscriber // abstract contract implements subscribing features. // For use in cases with subscription /// @title Subscriber abstract contract /// @author Envelop project Team /// @notice Abstract contract implements subscribing features. /// For use in cases with subscription /// @dev Using _serviceCode param: /// 0 - simple saftNFT subscription /// 100 - mint service /// also we can think about _serviceCode as uniq code of service (saft, mint etc) /// !!! use Ownable pattern for `setSubscriptionManager` pragma solidity 0.8.16; import "ISubscriptionManager.sol"; abstract contract Subscriber { uint256 immutable public SERVICE_CODE; ISubscriptionManager public subscriptionManager; constructor(uint256 _code) { SERVICE_CODE = _code; } function _setSubscriptionManager(address _manager) internal { require(_manager != address(0),'Non zero only'); subscriptionManager = ISubscriptionManager(_manager); } function _checkAndFixSubscription(address _user) internal returns (bool ok) { if (address(subscriptionManager) != address(0)){ ok = subscriptionManager.checkAndFixUserSubscription( _user, SERVICE_CODE ); return ok; } } function _fixUserSubscription( address _user, uint256 _tariffIndex ) internal { if (address(subscriptionManager) != address(0)){ subscriptionManager.fixUserSubscription( _user, _tariffIndex ); } } function _checkUserSubscription(address _user) internal view returns (bool ok) { if (address(subscriptionManager) != address(0)){ ok = subscriptionManager.checkUserSubscription( _user, SERVICE_CODE ); return ok; } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.16; interface ISubscriptionManager { function checkUserSubscription( address _userer, uint256 _serviceCode ) external view returns (bool); function checkAndFixUserSubscription( address _userer, uint256 _serviceCode ) external returns (bool); function fixUserSubscription( address _user, uint256 _tariffIndex ) external; }
{ "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "libraries": { "EnvelopUsers721UniStorageEnum.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"_baseurl","type":"string"},{"internalType":"uint256","name":"_code","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","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":"SERVICE_CODE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"name":"baseByPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"mintWithURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_to","type":"address[]"},{"internalType":"uint256[]","name":"_tokenId","type":"uint256[]"},{"internalType":"string[]","name":"_tokenURI","type":"string[]"},{"internalType":"bytes[]","name":"_signature","type":"bytes[]"}],"name":"mintWithURIBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"oracleSigners","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_prefix","type":"bytes4"},{"internalType":"string","name":"_base","type":"string"}],"name":"setPrefixURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setSignerStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_manager","type":"address"}],"name":"setSubscriptionManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"subscriptionManager","outputs":[{"internalType":"contract ISubscriptionManager","name":"","type":"address"}],"stateMutability":"view","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":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523480156200001157600080fd5b50604051620033b1380380620033b1833981016040819052620000349162000549565b808484600062000045838262000671565b50600162000054828262000671565b505050620000716200006b620000e960201b60201c565b620000ed565b608052816200008c466200013f602090811b62000f4c17901c565b620000ab306001600160a01b03166200025f60201b620010551760201c565b604051602001620000bf939291906200073d565b604051602081830303815290604052600c9081620000de919062000671565b505050505062000891565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606081600003620001675750506040805180820190915260018152600360fc1b602082015290565b8160005b81156200019757806200017e81620007b3565b91506200018f9050600a83620007e5565b91506200016b565b6000816001600160401b03811115620001b457620001b46200047c565b6040519080825280601f01601f191660200182016040528015620001df576020820181803683370190505b5090505b84156200025757620001f7600183620007fc565b915062000206600a8662000812565b6200021390603062000829565b60f81b8183815181106200022b576200022b6200083f565b60200101906001600160f81b031916908160001a9053506200024f600a86620007e5565b9450620001e3565b949350505050565b6060816000036200028a5750506040805180820190915260048152630307830360e41b602082015290565b8160005b8115620002b15780620002a181620007b3565b915050600882901c91506200028e565b62000257848260606000620002c883600262000855565b620002d590600262000829565b6001600160401b03811115620002ef57620002ef6200047c565b6040519080825280601f01601f1916602001820160405280156200031a576020820181803683370190505b509050600360fc1b816000815181106200033857620003386200083f565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106200036a576200036a6200083f565b60200101906001600160f81b031916908160001a90535060006200039084600262000855565b6200039d90600162000829565b90505b60018111156200041f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110620003d557620003d56200083f565b1a60f81b828281518110620003ee57620003ee6200083f565b60200101906001600160f81b031916908160001a90535060049490941c93620004178162000877565b9050620003a0565b508315620004735760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640160405180910390fd5b90505b92915050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004af57818101518382015260200162000495565b50506000910152565b600082601f830112620004ca57600080fd5b81516001600160401b0380821115620004e757620004e76200047c565b604051601f8301601f19908116603f011681019082821181831017156200051257620005126200047c565b816040528381528660208588010111156200052c57600080fd5b6200053f84602083016020890162000492565b9695505050505050565b600080600080608085870312156200056057600080fd5b84516001600160401b03808211156200057857600080fd5b6200058688838901620004b8565b955060208701519150808211156200059d57600080fd5b620005ab88838901620004b8565b94506040870151915080821115620005c257600080fd5b50620005d187828801620004b8565b606096909601519497939650505050565b600181811c90821680620005f757607f821691505b6020821081036200061857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200066c57600081815260208120601f850160051c81016020861015620006475750805b601f850160051c820191505b81811015620006685782815560010162000653565b5050505b505050565b81516001600160401b038111156200068d576200068d6200047c565b620006a5816200069e8454620005e2565b846200061e565b602080601f831160018114620006dd5760008415620006c45750858301515b600019600386901b1c1916600185901b17855562000668565b600085815260208120601f198616915b828110156200070e57888601518255948401946001909101908401620006ed565b50858210156200072d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600084516200075181846020890162000492565b8451908301906200076781836020890162000492565b602f60f81b910181815284519091906200078981600185016020890162000492565b600192019182015260020195945050505050565b634e487b7160e01b600052601160045260246000fd5b600060018201620007c857620007c86200079d565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082620007f757620007f7620007cf565b500490565b818103818111156200047657620004766200079d565b600082620008245762000824620007cf565b500690565b808201808211156200047657620004766200079d565b634e487b7160e01b600052603260045260246000fd5b60008160001904831182151516156200087257620008726200079d565b500290565b6000816200088957620008896200079d565b506000190190565b608051612afd620008b4600039600081816102d701526114a20152612afd6000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636352211e1161010457806395d89b41116100a2578063c05b358511610071578063c05b3585146103e0578063c87b56dd146103f3578063e985e9c514610406578063f2fde38b1461044257600080fd5b806395d89b411461039f578063a22cb465146103a7578063b88d4fde146103ba578063bf158fd2146103cd57600080fd5b806370a08231116100de57806370a0823114610360578063715018a6146103735780638d0abcda1461037b5780638da5cb5b1461038e57600080fd5b80636352211e146103325780636829c905146103455780636c0360eb1461035857600080fd5b806323b872dd116101715780633c8fcc5b1161014b5780633c8fcc5b146102d257806342842e0e146102f95780634f6ccce71461030c57806357a3e9691461031f57600080fd5b806323b872dd146102895780632baaf41b1461029c5780632f745c59146102bf57600080fd5b8063095ea7b3116101ad578063095ea7b31461023c578063134f32481461025157806316e25df81461026457806318160ddd1461027757600080fd5b806301ffc9a7146101d457806306fdde03146101fc578063081812fc14610211575b600080fd5b6101e76101e2366004612186565b610455565b60405190151581526020015b60405180910390f35b610204610480565b6040516101f391906121f3565b61022461021f366004612206565b610512565b6040516001600160a01b0390911681526020016101f3565b61024f61024a366004612236565b610539565b005b61024f61025f3660046122a5565b610653565b61024f6102723660046123f5565b610706565b6008545b6040519081526020016101f3565b61024f610297366004612459565b610731565b6101e76102aa366004612495565b600d6020526000908152604090205460ff1681565b61027b6102cd366004612236565b610762565b61027b7f000000000000000000000000000000000000000000000000000000000000000081565b61024f610307366004612459565b6107f8565b61027b61031a366004612206565b610813565b61024f61032d3660046124f2565b6108a6565b610224610340366004612206565b610a67565b610204610353366004612186565b610ac7565b610204610b61565b61027b61036e366004612495565b610b70565b61024f610bf6565b61024f61038936600461258a565b610c0a565b600a546001600160a01b0316610224565b610204610c3d565b61024f6103b536600461258a565b610c4c565b61024f6103c83660046125c1565b610c5b565b600b54610224906001600160a01b031681565b61024f6103ee366004612495565b610c93565b610204610401366004612206565b610ca7565b6101e761041436600461263d565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61024f610450366004612495565b610ed6565b60006001600160e01b0319821663780e9d6360e01b148061047a575061047a826110ac565b92915050565b60606000805461048f90612670565b80601f01602080910402602001604051908101604052809291908181526020018280546104bb90612670565b80156105085780601f106104dd57610100808354040283529160200191610508565b820191906000526020600020905b8154815290600101906020018083116104eb57829003601f168201915b5050505050905090565b600061051d826110fc565b506000908152600460205260409020546001600160a01b031690565b600061054482610a67565b9050806001600160a01b0316836001600160a01b0316036105b65760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806105d257506105d28133610414565b6106445760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016105ad565b61064e838361115b565b505050565b60005b878110156106fb576106e9898983818110610673576106736126aa565b90506020020160208101906106889190612495565b88888481811061069a5761069a6126aa565b905060200201358787858181106106b3576106b36126aa565b90506020028101906106c591906126c0565b8787878181106106d7576106d76126aa565b905060200281019061032d91906126c0565b806106f38161271d565b915050610656565b505050505050505050565b61070e6111c9565b6001600160e01b031982166000908152600e6020526040902061064e828261277c565b61073b3382611223565b6107575760405162461bcd60e51b81526004016105ad9061283c565b61064e8383836112a1565b600061076d83610b70565b82106107cf5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016105ad565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b61064e83838360405180602001604052806000815250610c5b565b600061081e60085490565b82106108815760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016105ad565b60088281548110610894576108946126aa565b90600052602060002001549050919050565b80156109d3576000610928338787876040516020016108c8949392919061288a565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b9050600d600061097085858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525087939250506114489050565b6001600160a01b0316815260208101919091526040016000205460ff166109cd5760405162461bcd60e51b81526020600482015260116024820152702ab732bc3832b1ba32b21039b4b3b732b960791b60448201526064016105ad565b50610a1e565b6109dc3361146c565b610a1e5760405162461bcd60e51b81526020600482015260136024820152722430b99027379029bab139b1b934b83a34b7b760691b60448201526064016105ad565b610a5f868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061151b92505050565b505050505050565b6000818152600260205260408120546001600160a01b03168061047a5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016105ad565b600e6020526000908152604090208054610ae090612670565b80601f0160208091040260200160405190810160405280929190818152602001828054610b0c90612670565b8015610b595780601f10610b2e57610100808354040283529160200191610b59565b820191906000526020600020905b815481529060010190602001808311610b3c57829003601f168201915b505050505081565b6060610b6b61152f565b905090565b60006001600160a01b038216610bda5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016105ad565b506001600160a01b031660009081526003602052604090205490565b610bfe6111c9565b610c08600061153e565b565b610c126111c9565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b60606001805461048f90612670565b610c57338383611590565b5050565b610c653383611223565b610c815760405162461bcd60e51b81526004016105ad9061283c565b610c8d8484848461165e565b50505050565b610c9b6111c9565b610ca481611691565b50565b6060610cb2826110fc565b6000828152600f602052604081208054610ccb90612670565b80601f0160208091040260200160405190810160405280929190818152602001828054610cf790612670565b8015610d445780601f10610d1957610100808354040283529160200191610d44565b820191906000526020600020905b815481529060010190602001808311610d2757829003601f168201915b505050505090506000610d5561152f565b90506000610d62836128d2565b905060405180604001604052806004815260200163313d3d1d60e11b815250610d8a906128d2565b6001600160e01b031982811691161480610dd55750604051806040016040528060048152602001636970667360e01b815250610dc5906128d2565b6001600160e01b03198281169116145b15610e7f576001600160e01b031981166000908152600e602052604090208054610dfe90612670565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2a90612670565b8015610e775780601f10610e4c57610100808354040283529160200191610e77565b820191906000526020600020905b815481529060010190602001808311610e5a57829003601f168201915b505050505091505b8151600003610e915750909392505050565b825115610ec4578183604051602001610eab929190612909565b6040516020818303038152906040529350505050919050565b610ecd856116f9565b95945050505050565b610ede6111c9565b6001600160a01b038116610f435760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ad565b610ca48161153e565b606081600003610f735750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610f9d5780610f878161271d565b9150610f969050600a8361294e565b9150610f77565b60008167ffffffffffffffff811115610fb857610fb8612369565b6040519080825280601f01601f191660200182016040528015610fe2576020820181803683370190505b5090505b841561104d57610ff7600183612962565b9150611004600a86612975565b61100f906030612989565b60f81b818381518110611024576110246126aa565b60200101906001600160f81b031916908160001a905350611046600a8661294e565b9450610fe6565b949350505050565b60608160000361107f5750506040805180820190915260048152630307830360e41b602082015290565b8160005b81156110a257806110938161271d565b915050600882901c9150611083565b61104d8482611760565b60006001600160e01b031982166380ac58cd60e01b14806110dd57506001600160e01b03198216635b5e139f60e01b145b8061047a57506301ffc9a760e01b6001600160e01b031983161461047a565b6000818152600260205260409020546001600160a01b0316610ca45760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016105ad565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061119082610a67565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600a546001600160a01b03163314610c085760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ad565b60008061122f83610a67565b9050806001600160a01b0316846001600160a01b0316148061127657506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061104d5750836001600160a01b031661128f84610512565b6001600160a01b031614949350505050565b826001600160a01b03166112b482610a67565b6001600160a01b0316146113185760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016105ad565b6001600160a01b03821661137a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105ad565b6113858383836118fc565b61139060008261115b565b6001600160a01b03831660009081526003602052604081208054600192906113b9908490612962565b90915550506001600160a01b03821660009081526003602052604081208054600192906113e7908490612989565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600080600061145785856119b4565b9150915061146481611a22565b509392505050565b600b546000906001600160a01b03161561151657600b5460405163d15ec2a760e01b81526001600160a01b0384811660048301527f000000000000000000000000000000000000000000000000000000000000000060248301529091169063d15ec2a7906044016020604051808303816000875af11580156114f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047a919061299c565b919050565b6115258383611bd8565b61064e8282611d26565b6060600c805461048f90612670565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036115f15760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105ad565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6116698484846112a1565b61167584848484611db9565b610c8d5760405162461bcd60e51b81526004016105ad906129b9565b6001600160a01b0381166116d75760405162461bcd60e51b815260206004820152600d60248201526c4e6f6e207a65726f206f6e6c7960981b60448201526064016105ad565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6060611704826110fc565b600061170e61152f565b9050600081511161172e5760405180602001604052806000815250611759565b8061173884610f4c565b604051602001611749929190612909565b6040516020818303038152906040525b9392505050565b6060600061176f836002612a0b565b61177a906002612989565b67ffffffffffffffff81111561179257611792612369565b6040519080825280601f01601f1916602001820160405280156117bc576020820181803683370190505b509050600360fc1b816000815181106117d7576117d76126aa565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611806576118066126aa565b60200101906001600160f81b031916908160001a905350600061182a846002612a0b565b611835906001612989565b90505b60018111156118ad576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611869576118696126aa565b1a60f81b82828151811061187f5761187f6126aa565b60200101906001600160f81b031916908160001a90535060049490941c936118a681612a2a565b9050611838565b5083156117595760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105ad565b6001600160a01b0383166119575761195281600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61197a565b816001600160a01b0316836001600160a01b03161461197a5761197a8382611eba565b6001600160a01b0382166119915761064e81611f57565b826001600160a01b0316826001600160a01b03161461064e5761064e8282612006565b60008082516041036119ea5760208301516040840151606085015160001a6119de8782858561204a565b94509450505050611a1b565b8251604003611a135760208301516040840151611a08868383612137565b935093505050611a1b565b506000905060025b9250929050565b6000816004811115611a3657611a36612a41565b03611a3e5750565b6001816004811115611a5257611a52612a41565b03611a9f5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105ad565b6002816004811115611ab357611ab3612a41565b03611b005760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105ad565b6003816004811115611b1457611b14612a41565b03611b6c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105ad565b6004816004811115611b8057611b80612a41565b03610ca45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105ad565b6001600160a01b038216611c2e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105ad565b6000818152600260205260409020546001600160a01b031615611c935760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105ad565b611c9f600083836118fc565b6001600160a01b0382166000908152600360205260408120805460019290611cc8908490612989565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000828152600260205260409020546001600160a01b0316611da15760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016105ad565b6000828152600f6020526040902061064e828261277c565b60006001600160a01b0384163b15611eaf57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611dfd903390899088908890600401612a57565b6020604051808303816000875af1925050508015611e38575060408051601f3d908101601f19168201909252611e3591810190612a94565b60015b611e95573d808015611e66576040519150601f19603f3d011682016040523d82523d6000602084013e611e6b565b606091505b508051600003611e8d5760405162461bcd60e51b81526004016105ad906129b9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061104d565b506001949350505050565b60006001611ec784610b70565b611ed19190612962565b600083815260076020526040902054909150808214611f24576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611f6990600190612962565b60008381526009602052604081205460088054939450909284908110611f9157611f916126aa565b906000526020600020015490508060088381548110611fb257611fb26126aa565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611fea57611fea612ab1565b6001900381819060005260206000200160009055905550505050565b600061201183610b70565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612081575060009050600361212e565b8460ff16601b1415801561209957508460ff16601c14155b156120aa575060009050600461212e565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156120fe573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166121275760006001925092505061212e565b9150600090505b94509492505050565b6000806001600160ff1b0383168161215460ff86901c601b612989565b90506121628782888561204a565b935093505050935093915050565b6001600160e01b031981168114610ca457600080fd5b60006020828403121561219857600080fd5b813561175981612170565b60005b838110156121be5781810151838201526020016121a6565b50506000910152565b600081518084526121df8160208601602086016121a3565b601f01601f19169290920160200192915050565b60208152600061175960208301846121c7565b60006020828403121561221857600080fd5b5035919050565b80356001600160a01b038116811461151657600080fd5b6000806040838503121561224957600080fd5b6122528361221f565b946020939093013593505050565b60008083601f84011261227257600080fd5b50813567ffffffffffffffff81111561228a57600080fd5b6020830191508360208260051b8501011115611a1b57600080fd5b6000806000806000806000806080898b0312156122c157600080fd5b883567ffffffffffffffff808211156122d957600080fd5b6122e58c838d01612260565b909a50985060208b01359150808211156122fe57600080fd5b61230a8c838d01612260565b909850965060408b013591508082111561232357600080fd5b61232f8c838d01612260565b909650945060608b013591508082111561234857600080fd5b506123558b828c01612260565b999c989b5096995094979396929594505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561239a5761239a612369565b604051601f8501601f19908116603f011681019082821181831017156123c2576123c2612369565b816040528093508581528686860111156123db57600080fd5b858560208301376000602087830101525050509392505050565b6000806040838503121561240857600080fd5b823561241381612170565b9150602083013567ffffffffffffffff81111561242f57600080fd5b8301601f8101851361244057600080fd5b61244f8582356020840161237f565b9150509250929050565b60008060006060848603121561246e57600080fd5b6124778461221f565b92506124856020850161221f565b9150604084013590509250925092565b6000602082840312156124a757600080fd5b6117598261221f565b60008083601f8401126124c257600080fd5b50813567ffffffffffffffff8111156124da57600080fd5b602083019150836020828501011115611a1b57600080fd5b6000806000806000806080878903121561250b57600080fd5b6125148761221f565b955060208701359450604087013567ffffffffffffffff8082111561253857600080fd5b6125448a838b016124b0565b9096509450606089013591508082111561255d57600080fd5b5061256a89828a016124b0565b979a9699509497509295939492505050565b8015158114610ca457600080fd5b6000806040838503121561259d57600080fd5b6125a68361221f565b915060208301356125b68161257c565b809150509250929050565b600080600080608085870312156125d757600080fd5b6125e08561221f565b93506125ee6020860161221f565b925060408501359150606085013567ffffffffffffffff81111561261157600080fd5b8501601f8101871361262257600080fd5b6126318782356020840161237f565b91505092959194509250565b6000806040838503121561265057600080fd5b6126598361221f565b91506126676020840161221f565b90509250929050565b600181811c9082168061268457607f821691505b6020821081036126a457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126126d757600080fd5b83018035915067ffffffffffffffff8211156126f257600080fd5b602001915036819003821315611a1b57600080fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161272f5761272f612707565b5060010190565b601f82111561064e57600081815260208120601f850160051c8101602086101561275d5750805b601f850160051c820191505b81811015610a5f57828155600101612769565b815167ffffffffffffffff81111561279657612796612369565b6127aa816127a48454612670565b84612736565b602080601f8311600181146127df57600084156127c75750858301515b600019600386901b1c1916600185901b178555610a5f565b600085815260208120601f198616915b8281101561280e578886015182559484019460019091019084016127ef565b508582101561282c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6001600160a01b0385168152602081018490526060604082018190528101829052818360808301376000818301608090810191909152601f909201601f191601019392505050565b805160208201516001600160e01b031980821692919060048310156129015780818460040360031b1b83161693505b505050919050565b6000835161291b8184602088016121a3565b83519083019061292f8183602088016121a3565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261295d5761295d612938565b500490565b8181038181111561047a5761047a612707565b60008261298457612984612938565b500690565b8082018082111561047a5761047a612707565b6000602082840312156129ae57600080fd5b81516117598161257c565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000816000190483118215151615612a2557612a25612707565b500290565b600081612a3957612a39612707565b506000190190565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612a8a908301846121c7565b9695505050505050565b600060208284031215612aa657600080fd5b815161175981612170565b634e487b7160e01b600052603160045260246000fdfea26469706673582212207adb886778227d586c94e63349b79c1f89055c6ee0913c26803bb953a992793a64736f6c63430008100033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000016456e76656c6f7020556e6953746f72616765204e4654000000000000000000000000000000000000000000000000000000000000000000000000000000000004654e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002068747470733a2f2f6170692e656e76656c6f702e69732f6d657461646174612f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636352211e1161010457806395d89b41116100a2578063c05b358511610071578063c05b3585146103e0578063c87b56dd146103f3578063e985e9c514610406578063f2fde38b1461044257600080fd5b806395d89b411461039f578063a22cb465146103a7578063b88d4fde146103ba578063bf158fd2146103cd57600080fd5b806370a08231116100de57806370a0823114610360578063715018a6146103735780638d0abcda1461037b5780638da5cb5b1461038e57600080fd5b80636352211e146103325780636829c905146103455780636c0360eb1461035857600080fd5b806323b872dd116101715780633c8fcc5b1161014b5780633c8fcc5b146102d257806342842e0e146102f95780634f6ccce71461030c57806357a3e9691461031f57600080fd5b806323b872dd146102895780632baaf41b1461029c5780632f745c59146102bf57600080fd5b8063095ea7b3116101ad578063095ea7b31461023c578063134f32481461025157806316e25df81461026457806318160ddd1461027757600080fd5b806301ffc9a7146101d457806306fdde03146101fc578063081812fc14610211575b600080fd5b6101e76101e2366004612186565b610455565b60405190151581526020015b60405180910390f35b610204610480565b6040516101f391906121f3565b61022461021f366004612206565b610512565b6040516001600160a01b0390911681526020016101f3565b61024f61024a366004612236565b610539565b005b61024f61025f3660046122a5565b610653565b61024f6102723660046123f5565b610706565b6008545b6040519081526020016101f3565b61024f610297366004612459565b610731565b6101e76102aa366004612495565b600d6020526000908152604090205460ff1681565b61027b6102cd366004612236565b610762565b61027b7f000000000000000000000000000000000000000000000000000000000000006481565b61024f610307366004612459565b6107f8565b61027b61031a366004612206565b610813565b61024f61032d3660046124f2565b6108a6565b610224610340366004612206565b610a67565b610204610353366004612186565b610ac7565b610204610b61565b61027b61036e366004612495565b610b70565b61024f610bf6565b61024f61038936600461258a565b610c0a565b600a546001600160a01b0316610224565b610204610c3d565b61024f6103b536600461258a565b610c4c565b61024f6103c83660046125c1565b610c5b565b600b54610224906001600160a01b031681565b61024f6103ee366004612495565b610c93565b610204610401366004612206565b610ca7565b6101e761041436600461263d565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61024f610450366004612495565b610ed6565b60006001600160e01b0319821663780e9d6360e01b148061047a575061047a826110ac565b92915050565b60606000805461048f90612670565b80601f01602080910402602001604051908101604052809291908181526020018280546104bb90612670565b80156105085780601f106104dd57610100808354040283529160200191610508565b820191906000526020600020905b8154815290600101906020018083116104eb57829003601f168201915b5050505050905090565b600061051d826110fc565b506000908152600460205260409020546001600160a01b031690565b600061054482610a67565b9050806001600160a01b0316836001600160a01b0316036105b65760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806105d257506105d28133610414565b6106445760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016105ad565b61064e838361115b565b505050565b60005b878110156106fb576106e9898983818110610673576106736126aa565b90506020020160208101906106889190612495565b88888481811061069a5761069a6126aa565b905060200201358787858181106106b3576106b36126aa565b90506020028101906106c591906126c0565b8787878181106106d7576106d76126aa565b905060200281019061032d91906126c0565b806106f38161271d565b915050610656565b505050505050505050565b61070e6111c9565b6001600160e01b031982166000908152600e6020526040902061064e828261277c565b61073b3382611223565b6107575760405162461bcd60e51b81526004016105ad9061283c565b61064e8383836112a1565b600061076d83610b70565b82106107cf5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016105ad565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b61064e83838360405180602001604052806000815250610c5b565b600061081e60085490565b82106108815760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016105ad565b60088281548110610894576108946126aa565b90600052602060002001549050919050565b80156109d3576000610928338787876040516020016108c8949392919061288a565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b9050600d600061097085858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525087939250506114489050565b6001600160a01b0316815260208101919091526040016000205460ff166109cd5760405162461bcd60e51b81526020600482015260116024820152702ab732bc3832b1ba32b21039b4b3b732b960791b60448201526064016105ad565b50610a1e565b6109dc3361146c565b610a1e5760405162461bcd60e51b81526020600482015260136024820152722430b99027379029bab139b1b934b83a34b7b760691b60448201526064016105ad565b610a5f868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061151b92505050565b505050505050565b6000818152600260205260408120546001600160a01b03168061047a5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016105ad565b600e6020526000908152604090208054610ae090612670565b80601f0160208091040260200160405190810160405280929190818152602001828054610b0c90612670565b8015610b595780601f10610b2e57610100808354040283529160200191610b59565b820191906000526020600020905b815481529060010190602001808311610b3c57829003601f168201915b505050505081565b6060610b6b61152f565b905090565b60006001600160a01b038216610bda5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016105ad565b506001600160a01b031660009081526003602052604090205490565b610bfe6111c9565b610c08600061153e565b565b610c126111c9565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b60606001805461048f90612670565b610c57338383611590565b5050565b610c653383611223565b610c815760405162461bcd60e51b81526004016105ad9061283c565b610c8d8484848461165e565b50505050565b610c9b6111c9565b610ca481611691565b50565b6060610cb2826110fc565b6000828152600f602052604081208054610ccb90612670565b80601f0160208091040260200160405190810160405280929190818152602001828054610cf790612670565b8015610d445780601f10610d1957610100808354040283529160200191610d44565b820191906000526020600020905b815481529060010190602001808311610d2757829003601f168201915b505050505090506000610d5561152f565b90506000610d62836128d2565b905060405180604001604052806004815260200163313d3d1d60e11b815250610d8a906128d2565b6001600160e01b031982811691161480610dd55750604051806040016040528060048152602001636970667360e01b815250610dc5906128d2565b6001600160e01b03198281169116145b15610e7f576001600160e01b031981166000908152600e602052604090208054610dfe90612670565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2a90612670565b8015610e775780601f10610e4c57610100808354040283529160200191610e77565b820191906000526020600020905b815481529060010190602001808311610e5a57829003601f168201915b505050505091505b8151600003610e915750909392505050565b825115610ec4578183604051602001610eab929190612909565b6040516020818303038152906040529350505050919050565b610ecd856116f9565b95945050505050565b610ede6111c9565b6001600160a01b038116610f435760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ad565b610ca48161153e565b606081600003610f735750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610f9d5780610f878161271d565b9150610f969050600a8361294e565b9150610f77565b60008167ffffffffffffffff811115610fb857610fb8612369565b6040519080825280601f01601f191660200182016040528015610fe2576020820181803683370190505b5090505b841561104d57610ff7600183612962565b9150611004600a86612975565b61100f906030612989565b60f81b818381518110611024576110246126aa565b60200101906001600160f81b031916908160001a905350611046600a8661294e565b9450610fe6565b949350505050565b60608160000361107f5750506040805180820190915260048152630307830360e41b602082015290565b8160005b81156110a257806110938161271d565b915050600882901c9150611083565b61104d8482611760565b60006001600160e01b031982166380ac58cd60e01b14806110dd57506001600160e01b03198216635b5e139f60e01b145b8061047a57506301ffc9a760e01b6001600160e01b031983161461047a565b6000818152600260205260409020546001600160a01b0316610ca45760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016105ad565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061119082610a67565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600a546001600160a01b03163314610c085760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ad565b60008061122f83610a67565b9050806001600160a01b0316846001600160a01b0316148061127657506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061104d5750836001600160a01b031661128f84610512565b6001600160a01b031614949350505050565b826001600160a01b03166112b482610a67565b6001600160a01b0316146113185760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016105ad565b6001600160a01b03821661137a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016105ad565b6113858383836118fc565b61139060008261115b565b6001600160a01b03831660009081526003602052604081208054600192906113b9908490612962565b90915550506001600160a01b03821660009081526003602052604081208054600192906113e7908490612989565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600080600061145785856119b4565b9150915061146481611a22565b509392505050565b600b546000906001600160a01b03161561151657600b5460405163d15ec2a760e01b81526001600160a01b0384811660048301527f000000000000000000000000000000000000000000000000000000000000006460248301529091169063d15ec2a7906044016020604051808303816000875af11580156114f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047a919061299c565b919050565b6115258383611bd8565b61064e8282611d26565b6060600c805461048f90612670565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036115f15760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016105ad565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6116698484846112a1565b61167584848484611db9565b610c8d5760405162461bcd60e51b81526004016105ad906129b9565b6001600160a01b0381166116d75760405162461bcd60e51b815260206004820152600d60248201526c4e6f6e207a65726f206f6e6c7960981b60448201526064016105ad565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6060611704826110fc565b600061170e61152f565b9050600081511161172e5760405180602001604052806000815250611759565b8061173884610f4c565b604051602001611749929190612909565b6040516020818303038152906040525b9392505050565b6060600061176f836002612a0b565b61177a906002612989565b67ffffffffffffffff81111561179257611792612369565b6040519080825280601f01601f1916602001820160405280156117bc576020820181803683370190505b509050600360fc1b816000815181106117d7576117d76126aa565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611806576118066126aa565b60200101906001600160f81b031916908160001a905350600061182a846002612a0b565b611835906001612989565b90505b60018111156118ad576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611869576118696126aa565b1a60f81b82828151811061187f5761187f6126aa565b60200101906001600160f81b031916908160001a90535060049490941c936118a681612a2a565b9050611838565b5083156117595760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105ad565b6001600160a01b0383166119575761195281600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61197a565b816001600160a01b0316836001600160a01b03161461197a5761197a8382611eba565b6001600160a01b0382166119915761064e81611f57565b826001600160a01b0316826001600160a01b03161461064e5761064e8282612006565b60008082516041036119ea5760208301516040840151606085015160001a6119de8782858561204a565b94509450505050611a1b565b8251604003611a135760208301516040840151611a08868383612137565b935093505050611a1b565b506000905060025b9250929050565b6000816004811115611a3657611a36612a41565b03611a3e5750565b6001816004811115611a5257611a52612a41565b03611a9f5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105ad565b6002816004811115611ab357611ab3612a41565b03611b005760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105ad565b6003816004811115611b1457611b14612a41565b03611b6c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105ad565b6004816004811115611b8057611b80612a41565b03610ca45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105ad565b6001600160a01b038216611c2e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016105ad565b6000818152600260205260409020546001600160a01b031615611c935760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016105ad565b611c9f600083836118fc565b6001600160a01b0382166000908152600360205260408120805460019290611cc8908490612989565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000828152600260205260409020546001600160a01b0316611da15760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016105ad565b6000828152600f6020526040902061064e828261277c565b60006001600160a01b0384163b15611eaf57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611dfd903390899088908890600401612a57565b6020604051808303816000875af1925050508015611e38575060408051601f3d908101601f19168201909252611e3591810190612a94565b60015b611e95573d808015611e66576040519150601f19603f3d011682016040523d82523d6000602084013e611e6b565b606091505b508051600003611e8d5760405162461bcd60e51b81526004016105ad906129b9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061104d565b506001949350505050565b60006001611ec784610b70565b611ed19190612962565b600083815260076020526040902054909150808214611f24576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090611f6990600190612962565b60008381526009602052604081205460088054939450909284908110611f9157611f916126aa565b906000526020600020015490508060088381548110611fb257611fb26126aa565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480611fea57611fea612ab1565b6001900381819060005260206000200160009055905550505050565b600061201183610b70565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612081575060009050600361212e565b8460ff16601b1415801561209957508460ff16601c14155b156120aa575060009050600461212e565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156120fe573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166121275760006001925092505061212e565b9150600090505b94509492505050565b6000806001600160ff1b0383168161215460ff86901c601b612989565b90506121628782888561204a565b935093505050935093915050565b6001600160e01b031981168114610ca457600080fd5b60006020828403121561219857600080fd5b813561175981612170565b60005b838110156121be5781810151838201526020016121a6565b50506000910152565b600081518084526121df8160208601602086016121a3565b601f01601f19169290920160200192915050565b60208152600061175960208301846121c7565b60006020828403121561221857600080fd5b5035919050565b80356001600160a01b038116811461151657600080fd5b6000806040838503121561224957600080fd5b6122528361221f565b946020939093013593505050565b60008083601f84011261227257600080fd5b50813567ffffffffffffffff81111561228a57600080fd5b6020830191508360208260051b8501011115611a1b57600080fd5b6000806000806000806000806080898b0312156122c157600080fd5b883567ffffffffffffffff808211156122d957600080fd5b6122e58c838d01612260565b909a50985060208b01359150808211156122fe57600080fd5b61230a8c838d01612260565b909850965060408b013591508082111561232357600080fd5b61232f8c838d01612260565b909650945060608b013591508082111561234857600080fd5b506123558b828c01612260565b999c989b5096995094979396929594505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561239a5761239a612369565b604051601f8501601f19908116603f011681019082821181831017156123c2576123c2612369565b816040528093508581528686860111156123db57600080fd5b858560208301376000602087830101525050509392505050565b6000806040838503121561240857600080fd5b823561241381612170565b9150602083013567ffffffffffffffff81111561242f57600080fd5b8301601f8101851361244057600080fd5b61244f8582356020840161237f565b9150509250929050565b60008060006060848603121561246e57600080fd5b6124778461221f565b92506124856020850161221f565b9150604084013590509250925092565b6000602082840312156124a757600080fd5b6117598261221f565b60008083601f8401126124c257600080fd5b50813567ffffffffffffffff8111156124da57600080fd5b602083019150836020828501011115611a1b57600080fd5b6000806000806000806080878903121561250b57600080fd5b6125148761221f565b955060208701359450604087013567ffffffffffffffff8082111561253857600080fd5b6125448a838b016124b0565b9096509450606089013591508082111561255d57600080fd5b5061256a89828a016124b0565b979a9699509497509295939492505050565b8015158114610ca457600080fd5b6000806040838503121561259d57600080fd5b6125a68361221f565b915060208301356125b68161257c565b809150509250929050565b600080600080608085870312156125d757600080fd5b6125e08561221f565b93506125ee6020860161221f565b925060408501359150606085013567ffffffffffffffff81111561261157600080fd5b8501601f8101871361262257600080fd5b6126318782356020840161237f565b91505092959194509250565b6000806040838503121561265057600080fd5b6126598361221f565b91506126676020840161221f565b90509250929050565b600181811c9082168061268457607f821691505b6020821081036126a457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126126d757600080fd5b83018035915067ffffffffffffffff8211156126f257600080fd5b602001915036819003821315611a1b57600080fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161272f5761272f612707565b5060010190565b601f82111561064e57600081815260208120601f850160051c8101602086101561275d5750805b601f850160051c820191505b81811015610a5f57828155600101612769565b815167ffffffffffffffff81111561279657612796612369565b6127aa816127a48454612670565b84612736565b602080601f8311600181146127df57600084156127c75750858301515b600019600386901b1c1916600185901b178555610a5f565b600085815260208120601f198616915b8281101561280e578886015182559484019460019091019084016127ef565b508582101561282c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6001600160a01b0385168152602081018490526060604082018190528101829052818360808301376000818301608090810191909152601f909201601f191601019392505050565b805160208201516001600160e01b031980821692919060048310156129015780818460040360031b1b83161693505b505050919050565b6000835161291b8184602088016121a3565b83519083019061292f8183602088016121a3565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261295d5761295d612938565b500490565b8181038181111561047a5761047a612707565b60008261298457612984612938565b500690565b8082018082111561047a5761047a612707565b6000602082840312156129ae57600080fd5b81516117598161257c565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000816000190483118215151615612a2557612a25612707565b500290565b600081612a3957612a39612707565b506000190190565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612a8a908301846121c7565b9695505050505050565b600060208284031215612aa657600080fd5b815161175981612170565b634e487b7160e01b600052603160045260246000fdfea26469706673582212207adb886778227d586c94e63349b79c1f89055c6ee0913c26803bb953a992793a64736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000016456e76656c6f7020556e6953746f72616765204e4654000000000000000000000000000000000000000000000000000000000000000000000000000000000004654e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002068747470733a2f2f6170692e656e76656c6f702e69732f6d657461646174612f
-----Decoded View---------------
Arg [0] : name_ (string): Envelop UniStorage NFT
Arg [1] : symbol_ (string): eNFT
Arg [2] : _baseurl (string): https://api.envelop.is/metadata/
Arg [3] : _code (uint256): 100
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000016
Arg [5] : 456e76656c6f7020556e6953746f72616765204e465400000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [7] : 654e465400000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [9] : 68747470733a2f2f6170692e656e76656c6f702e69732f6d657461646174612f
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.