Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
TokenTracker
Multi Chain
Multichain Addresses
0 address found via
Latest 18 from a total of 18 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Mint With URI | 9573285 | 103 days 12 hrs ago | IN | 0 ETH | 0.0000019 | ||||
Set Approval For... | 9571755 | 103 days 19 hrs ago | IN | 0 ETH | 0.00009263 | ||||
Mint With URI Ba... | 9571495 | 103 days 20 hrs ago | IN | 0 ETH | 0.00100627 | ||||
Mint With URI | 8594132 | 276 days 21 hrs ago | IN | 0 ETH | 0.0010858 | ||||
Mint With URI Ba... | 8585518 | 278 days 8 hrs ago | IN | 0 ETH | 0.01352812 | ||||
Set Approval For... | 8582593 | 278 days 20 hrs ago | IN | 0 ETH | 0.00561553 | ||||
Mint With URI | 8582545 | 278 days 20 hrs ago | IN | 0 ETH | 0.02624698 | ||||
Mint With URI | 8528672 | 287 days 23 hrs ago | IN | 0 ETH | 0.00013124 | ||||
Mint With URI | 8528201 | 288 days 1 hr ago | IN | 0 ETH | 0.00011944 | ||||
Mint With URI | 8500372 | 292 days 21 hrs ago | IN | 0 ETH | 0 | ||||
Mint With URI | 8500367 | 292 days 21 hrs ago | IN | 0 ETH | 0 | ||||
Mint With URI | 8459765 | 300 days 49 mins ago | IN | 0 ETH | 0.00000011 | ||||
Mint With URI Ba... | 8459354 | 300 days 2 hrs ago | IN | 0 ETH | 0.0000002 | ||||
Mint With URI | 8459339 | 300 days 2 hrs ago | IN | 0 ETH | 0.00000009 | ||||
Mint With URI | 8459290 | 300 days 2 hrs ago | IN | 0 ETH | 0.00000011 | ||||
Set Signer Statu... | 8431597 | 304 days 20 hrs ago | IN | 0 ETH | 0 | ||||
Set Signer Statu... | 8431595 | 304 days 20 hrs ago | IN | 0 ETH | 0 | ||||
0x60c06040 | 8431548 | 304 days 20 hrs ago | IN | Create: EnvelopUsers1155UniStorage | 0 ETH | 0 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Txn Hash | Block | From | To | Value | ||
---|---|---|---|---|---|---|
9611047 | 96 days 22 hrs ago | 0 ETH | ||||
9611047 | 96 days 22 hrs ago | 0 ETH | ||||
9611047 | 96 days 22 hrs ago | 0 ETH | ||||
9611028 | 96 days 22 hrs ago | 0 ETH | ||||
9611028 | 96 days 22 hrs ago | 0 ETH | ||||
9611028 | 96 days 22 hrs ago | 0 ETH | ||||
9611028 | 96 days 22 hrs ago | 0 ETH | ||||
9573285 | 103 days 12 hrs ago | 0 ETH | ||||
9571832 | 103 days 18 hrs ago | 0 ETH | ||||
9571832 | 103 days 18 hrs ago | 0 ETH | ||||
9571832 | 103 days 18 hrs ago | 0 ETH | ||||
9571832 | 103 days 18 hrs ago | 0 ETH | ||||
9571756 | 103 days 19 hrs ago | 0 ETH | ||||
9571756 | 103 days 19 hrs ago | 0 ETH | ||||
9571756 | 103 days 19 hrs ago | 0 ETH | ||||
9571756 | 103 days 19 hrs ago | 0 ETH | ||||
9571495 | 103 days 20 hrs ago | 0 ETH | ||||
9571495 | 103 days 20 hrs ago | 0 ETH | ||||
9571495 | 103 days 20 hrs ago | 0 ETH | ||||
8724965 | 254 days 2 mins ago | 0 ETH | ||||
8724965 | 254 days 2 mins ago | 0 ETH | ||||
8724965 | 254 days 2 mins ago | 0 ETH | ||||
8594132 | 276 days 21 hrs ago | 0 ETH | ||||
8585518 | 278 days 8 hrs ago | 0 ETH | ||||
8582595 | 278 days 20 hrs ago | 0 ETH |
Loading...
Loading
Contract Name:
EnvelopUsers1155UniStorage
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 "ERC1155URIStorage.sol"; import "Ownable.sol"; import "ECDSA.sol"; import "Subscriber.sol"; contract EnvelopUsers1155UniStorage is ERC1155URIStorage, Ownable, Subscriber { using ECDSA for bytes32; using Strings for uint256; using Strings for uint160; string public name; string public symbol; //address public subscriptionManager; string private _baseDefaultURI; // 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 ) ERC1155(string(abi.encodePacked(_baseDefaultURI, "{id}"))) Subscriber(_code) { name = name_; symbol = symbol_; _baseDefaultURI = string( abi.encodePacked( _baseurl, block.chainid.toString(), "/", uint160(address(this)).toHexString(), "/" ) ); //_setBaseURI(_baseTokenURI); } /////////////////////////////////////////////////////////////////////////// //// Section below is OppenZeppelin ERC1155Supply inmplementation //// /////////////////////////////////////////////////////////////////////////// mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates whether any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return totalSupply(id) > 0; } /** * @dev See {ERC1155-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (from == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } if (to == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 supply = _totalSupply[id]; require(supply >= amount, "ERC1155: burn amount exceeds totalSupply"); unchecked { _totalSupply[id] = supply - amount; } } } } /////////////////////////////////////////////////////////////////////////// function mintWithURI( address _to, uint256 _tokenId, uint256 _amount, 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, _amount )).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, _amount, _tokenURI); } function mintWithURIBatch( address[] calldata _to, uint256[] calldata _tokenId, uint256[] calldata _amounts, string[] calldata _tokenURI, bytes[] calldata _signature ) external { for (uint256 i = 0; i < _to.length; i ++){ mintWithURI(_to[i], _tokenId[i], _amounts[i], _tokenURI[i], _signature[i]); } } //////////////////////////////////////////////////////////// // Overriding from ERC1155URIStorage function uri(uint256 tokenId) public view override(ERC1155URIStorage) returns (string memory) { //string memory tokenURI = _tokenURIs[tokenId]; string memory tokenURI = super.uri(tokenId); string memory _baseURI = _baseDefaultURI; // ------------------------------------ // For public Envelop mint app bytes4 prefix = bytes4(bytes(tokenURI)); if ( prefix == bytes4(bytes("bzz:")) || prefix == bytes4(bytes("ipfs")) ) { _baseURI = baseByPrefix[prefix]; } // -------------------------------------- // If token URI is set, concatenate base URI and tokenURI (via abi.encodePacked). return bytes(tokenURI).length > 0 ? string(abi.encodePacked(_baseURI, tokenURI)) : super.uri(tokenId); } ////////////////////////////// // 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 { _setBaseURI(_newBaseURI); } function setPrefixURI(bytes4 _prefix, string memory _base) public virtual onlyOwner { baseByPrefix[_prefix] = _base; } /////////////////////////////// function _mintWithURI( address _to, uint256 _tokenId, uint256 _amount, string memory _tokenURI ) internal { require(!exists(_tokenId),"This id already minted"); _mint(_to, _tokenId, _amount, ""); _setURI(_tokenId, _tokenURI); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155URIStorage.sol) pragma solidity ^0.8.0; import "Strings.sol"; import "ERC1155.sol"; /** * @dev ERC1155 token with storage based token URI management. * Inspired by the ERC721URIStorage extension * * _Available since v4.6._ */ abstract contract ERC1155URIStorage is ERC1155 { using Strings for uint256; // Optional base URI string private _baseURI = ""; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the concatenation of the `_baseURI` * and the token-specific uri if the latter is set * * This enables the following behaviors: * * - if `_tokenURIs[tokenId]` is set, then the result is the concatenation * of `_baseURI` and `_tokenURIs[tokenId]` (keep in mind that `_baseURI` * is empty per default); * * - if `_tokenURIs[tokenId]` is NOT set then we fallback to `super.uri()` * which in most cases will contain `ERC1155._uri`; * * - if `_tokenURIs[tokenId]` is NOT set, and if the parents do not have a * uri value set, then the result is empty. */ function uri(uint256 tokenId) public view virtual override returns (string memory) { string memory tokenURI = _tokenURIs[tokenId]; // If token URI is set, concatenate base URI and tokenURI (via abi.encodePacked). return bytes(tokenURI).length > 0 ? string(abi.encodePacked(_baseURI, tokenURI)) : super.uri(tokenId); } /** * @dev Sets `tokenURI` as the tokenURI of `tokenId`. */ function _setURI(uint256 tokenId, string memory tokenURI) internal virtual { _tokenURIs[tokenId] = tokenURI; emit URI(uri(tokenId), tokenId); } /** * @dev Sets `baseURI` as the `_baseURI` for all tokens */ function _setBaseURI(string memory baseURI) internal virtual { _baseURI = baseURI; } }
// 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 (last updated v4.7.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "IERC1155.sol"; import "IERC1155Receiver.sol"; import "IERC1155MetadataURI.sol"; import "Address.sol"; import "Context.sol"; import "ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @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, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// 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.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) 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 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.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(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": { "EnvelopUsers1155UniStorage.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":"account","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":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"SERVICE_CODE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","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":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","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":"uint256","name":"_amount","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":"uint256[]","name":"_amounts","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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","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":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","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":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c0604052600060a09081526003906200001a908262000562565b503480156200002857600080fd5b506040516200381b3803806200381b8339810160408190526200004b91620006e5565b8060096040516020016200006091906200077e565b60408051601f198184030181529190526200007b816200011c565b5062000087336200012e565b608052600762000098858262000562565b506008620000a7848262000562565b5081620000bf466200018060201b62000d001760201c565b620000de306001600160a01b0316620002a060201b62000e081760201c565b604051602001620000f29392919062000808565b6040516020818303038152906040526009908162000111919062000562565b50505050506200095c565b60026200012a828262000562565b5050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606081600003620001a85750506040805180820190915260018152600360fc1b602082015290565b8160005b8115620001d85780620001bf816200087e565b9150620001d09050600a83620008b0565b9150620001ac565b6000816001600160401b03811115620001f557620001f5620004bd565b6040519080825280601f01601f19166020018201604052801562000220576020820181803683370190505b5090505b8415620002985762000238600183620008c7565b915062000247600a86620008dd565b62000254906030620008f4565b60f81b8183815181106200026c576200026c6200090a565b60200101906001600160f81b031916908160001a90535062000290600a86620008b0565b945062000224565b949350505050565b606081600003620002cb5750506040805180820190915260048152630307830360e41b602082015290565b8160005b8115620002f25780620002e2816200087e565b915050600882901c9150620002cf565b620002988482606060006200030983600262000920565b62000316906002620008f4565b6001600160401b03811115620003305762000330620004bd565b6040519080825280601f01601f1916602001820160405280156200035b576020820181803683370190505b509050600360fc1b816000815181106200037957620003796200090a565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110620003ab57620003ab6200090a565b60200101906001600160f81b031916908160001a9053506000620003d184600262000920565b620003de906001620008f4565b90505b600181111562000460576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106200041657620004166200090a565b1a60f81b8282815181106200042f576200042f6200090a565b60200101906001600160f81b031916908160001a90535060049490941c93620004588162000942565b9050620003e1565b508315620004b45760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640160405180910390fd5b90505b92915050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620004e857607f821691505b6020821081036200050957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200055d57600081815260208120601f850160051c81016020861015620005385750805b601f850160051c820191505b81811015620005595782815560010162000544565b5050505b505050565b81516001600160401b038111156200057e576200057e620004bd565b62000596816200058f8454620004d3565b846200050f565b602080601f831160018114620005ce5760008415620005b55750858301515b600019600386901b1c1916600185901b17855562000559565b600085815260208120601f198616915b82811015620005ff57888601518255948401946001909101908401620005de565b50858210156200061e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60005b838110156200064b57818101518382015260200162000631565b50506000910152565b600082601f8301126200066657600080fd5b81516001600160401b0380821115620006835762000683620004bd565b604051601f8301601f19908116603f01168101908282118183101715620006ae57620006ae620004bd565b81604052838152866020858801011115620006c857600080fd5b620006db8460208301602089016200062e565b9695505050505050565b60008060008060808587031215620006fc57600080fd5b84516001600160401b03808211156200071457600080fd5b620007228883890162000654565b955060208701519150808211156200073957600080fd5b620007478883890162000654565b945060408701519150808211156200075e57600080fd5b506200076d8782880162000654565b606096909601519497939650505050565b60008083546200078e81620004d3565b60018281168015620007a95760018114620007bf57620007f0565b60ff1984168752821515830287019450620007f0565b8760005260208060002060005b85811015620007e75781548a820152908401908201620007cc565b50505082870194505b5050637b69647d60e01b835250506004019392505050565b600084516200081c8184602089016200062e565b845190830190620008328183602089016200062e565b602f60f81b91018181528451909190620008548160018501602089016200062e565b600192019182015260020195945050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820162000893576200089362000868565b5060010190565b634e487b7160e01b600052601260045260246000fd5b600082620008c257620008c26200089a565b500490565b81810381811115620004b757620004b762000868565b600082620008ef57620008ef6200089a565b500690565b80820180821115620004b757620004b762000868565b634e487b7160e01b600052603260045260246000fd5b60008160001904831182151516156200093d576200093d62000868565b500290565b60008162000954576200095462000868565b506000190190565b608051612e9c6200097f6000396000818161023801526111e20152612e9c6000f3fe608060405234801561001057600080fd5b50600436106101725760003560e01c80636829c905116100de578063b277c71711610097578063c05b358511610071578063c05b358514610376578063e985e9c514610389578063f242432a146103c5578063f2fde38b146103d857600080fd5b8063b277c71714610330578063bd85b03914610343578063bf158fd21461036357600080fd5b80636829c905146102c2578063715018a6146102d55780638d0abcda146102dd5780638da5cb5b146102f057806395d89b4114610315578063a22cb4651461031d57600080fd5b80632eb2c2d6116101305780632eb2c2d6146102205780633c8fcc5b146102335780634e1273f41461025a5780634f558e791461027a57806355f804b31461029c57806367f94dba146102af57600080fd5b8062fdd58e1461017757806301ffc9a71461019d57806306fdde03146101c05780630e89341c146101d557806316e25df8146101e85780632baaf41b146101fd575b600080fd5b61018a61018536600461208e565b6103eb565b6040519081526020015b60405180910390f35b6101b06101ab3660046120ce565b610484565b6040519015158152602001610194565b6101c86104d4565b604051610194919061213b565b6101c86101e336600461214e565b610562565b6101fb6101f636600461221c565b61076c565b005b6101b061020b36600461226b565b600a6020526000908152604090205460ff1681565b6101fb61022e36600461231a565b61079c565b61018a7f000000000000000000000000000000000000000000000000000000000000000081565b61026d6102683660046123c3565b6107e8565b60405161019491906124be565b6101b061028836600461214e565b6000908152600c6020526040902054151590565b6101fb6102aa3660046124d1565b610911565b6101fb6102bd366004612546565b610925565b6101c86102d03660046120ce565b610aea565b6101fb610b03565b6101fb6102eb3660046125e7565b610b17565b6005546001600160a01b03165b6040516001600160a01b039091168152602001610194565b6101c8610b4a565b6101fb61032b3660046125e7565b610b57565b6101fb61033e366004612662565b610b66565b61018a61035136600461214e565b6000908152600c602052604090205490565b6006546102fd906001600160a01b031681565b6101fb61038436600461226b565b610c34565b6101b0610397366004612752565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b6101fb6103d3366004612785565b610c45565b6101fb6103e636600461226b565b610c8a565b60006001600160a01b03831661045b5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806104b557506001600160e01b031982166303a24d0760e21b145b8061047e57506301ffc9a760e01b6001600160e01b031983161461047e565b600780546104e1906127e9565b80601f016020809104026020016040519081016040528092919081815260200182805461050d906127e9565b801561055a5780601f1061052f5761010080835404028352916020019161055a565b820191906000526020600020905b81548152906001019060200180831161053d57829003601f168201915b505050505081565b6060600061056f83610e5f565b9050600060098054610580906127e9565b80601f01602080910402602001604051908101604052809291908181526020018280546105ac906127e9565b80156105f95780601f106105ce576101008083540402835291602001916105f9565b820191906000526020600020905b8154815290600101906020018083116105dc57829003601f168201915b5050505050905060008261060c90612823565b905060405180604001604052806004815260200163313d3d1d60e11b81525061063490612823565b6001600160e01b03198281169116148061067f5750604051806040016040528060048152602001636970667360e01b81525061066f90612823565b6001600160e01b03198281169116145b15610729576001600160e01b031981166000908152600b6020526040902080546106a8906127e9565b80601f01602080910402602001604051908101604052809291908181526020018280546106d4906127e9565b80156107215780601f106106f657610100808354040283529160200191610721565b820191906000526020600020905b81548152906001019060200180831161070457829003601f168201915b505050505091505b60008351116107405761073b85610e5f565b610763565b818360405160200161075392919061285a565b6040516020818303038152906040525b95945050505050565b610774610f3f565b6001600160e01b031982166000908152600b6020526040902061079782826128cf565b505050565b6001600160a01b0385163314806107b857506107b88533610397565b6107d45760405162461bcd60e51b81526004016104529061298e565b6107e18585858585610f99565b5050505050565b6060815183511461084d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610452565b600083516001600160401b0381111561086857610868612167565b604051908082528060200260200182016040528015610891578160200160208202803683370190505b50905060005b8451811015610909576108dc8582815181106108b5576108b56129dd565b60200260200101518583815181106108cf576108cf6129dd565b60200260200101516103eb565b8282815181106108ee576108ee6129dd565b602090810291909101015261090281612a09565b9050610897565b509392505050565b610919610f3f565b61092281611184565b50565b8015610a545760006109a9338887878a604051602001610949959493929190612a22565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b9050600a60006109f185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525087939250506111909050565b6001600160a01b0316815260208101919091526040016000205460ff16610a4e5760405162461bcd60e51b81526020600482015260116024820152702ab732bc3832b1ba32b21039b4b3b732b960791b6044820152606401610452565b50610a9f565b610a5d336111ac565b610a9f5760405162461bcd60e51b81526020600482015260136024820152722430b99027379029bab139b1b934b83a34b7b760691b6044820152606401610452565b610ae187878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061125b92505050565b50505050505050565b600b60205260009081526040902080546104e1906127e9565b610b0b610f3f565b610b1560006112db565b565b610b1f610f3f565b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b600880546104e1906127e9565b610b6233838361132d565b5050565b60005b89811015610c2757610c158b8b83818110610b8657610b866129dd565b9050602002016020810190610b9b919061226b565b8a8a84818110610bad57610bad6129dd565b90506020020135898985818110610bc657610bc66129dd565b90506020020135888886818110610bdf57610bdf6129dd565b9050602002810190610bf19190612a74565b888888818110610c0357610c036129dd565b90506020028101906102bd9190612a74565b80610c1f81612a09565b915050610b69565b5050505050505050505050565b610c3c610f3f565b6109228161140d565b6001600160a01b038516331480610c615750610c618533610397565b610c7d5760405162461bcd60e51b81526004016104529061298e565b6107e18585858585611475565b610c92610f3f565b6001600160a01b038116610cf75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610452565b610922816112db565b606081600003610d275750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610d515780610d3b81612a09565b9150610d4a9050600a83612ad0565b9150610d2b565b6000816001600160401b03811115610d6b57610d6b612167565b6040519080825280601f01601f191660200182016040528015610d95576020820181803683370190505b5090505b8415610e0057610daa600183612ae4565b9150610db7600a86612af7565b610dc2906030612b0b565b60f81b818381518110610dd757610dd76129dd565b60200101906001600160f81b031916908160001a905350610df9600a86612ad0565b9450610d99565b949350505050565b606081600003610e325750506040805180820190915260048152630307830360e41b602082015290565b8160005b8115610e555780610e4681612a09565b915050600882901c9150610e36565b610e0084826115ad565b600081815260046020526040812080546060929190610e7d906127e9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ea9906127e9565b8015610ef65780601f10610ecb57610100808354040283529160200191610ef6565b820191906000526020600020905b815481529060010190602001808311610ed957829003601f168201915b505050505090506000815111610f1457610f0f83611748565b610f38565b600381604051602001610f28929190612b1e565b6040516020818303038152906040525b9392505050565b6005546001600160a01b03163314610b155760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610452565b8151835114610ffb5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610452565b6001600160a01b0384166110215760405162461bcd60e51b815260040161045290612b9c565b336110308187878787876117dc565b60005b8451811015611116576000858281518110611050576110506129dd565b60200260200101519050600085838151811061106e5761106e6129dd565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156110be5760405162461bcd60e51b815260040161045290612be1565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906110fb908490612b0b565b925050819055505050508061110f90612a09565b9050611033565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611166929190612c2b565b60405180910390a461117c818787878787611955565b505050505050565b6003610b6282826128cf565b600080600061119f8585611ab0565b9150915061090981611b1e565b6006546000906001600160a01b0316156112565760065460405163d15ec2a760e01b81526001600160a01b0384811660048301527f000000000000000000000000000000000000000000000000000000000000000060248301529091169063d15ec2a7906044016020604051808303816000875af1158015611232573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047e9190612c50565b919050565b6000838152600c6020526040902054156112b05760405162461bcd60e51b8152602060048201526016602482015275151a1a5cc81a5908185b1c9958591e481b5a5b9d195960521b6044820152606401610452565b6112cb84848460405180602001604052806000815250611cd4565b6112d58382611dee565b50505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036113a05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610452565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0381166114535760405162461bcd60e51b815260206004820152600d60248201526c4e6f6e207a65726f206f6e6c7960981b6044820152606401610452565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03841661149b5760405162461bcd60e51b815260040161045290612b9c565b3360006114a785611e4b565b905060006114b485611e4b565b90506114c48389898585896117dc565b6000868152602081815260408083206001600160a01b038c168452909152902054858110156115055760405162461bcd60e51b815260040161045290612be1565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611542908490612b0b565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46115a2848a8a8a8a8a611e96565b505050505050505050565b606060006115bc836002612c6d565b6115c7906002612b0b565b6001600160401b038111156115de576115de612167565b6040519080825280601f01601f191660200182016040528015611608576020820181803683370190505b509050600360fc1b81600081518110611623576116236129dd565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611652576116526129dd565b60200101906001600160f81b031916908160001a9053506000611676846002612c6d565b611681906001612b0b565b90505b60018111156116f9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106116b5576116b56129dd565b1a60f81b8282815181106116cb576116cb6129dd565b60200101906001600160f81b031916908160001a90535060049490941c936116f281612c8c565b9050611684565b508315610f385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610452565b606060028054611757906127e9565b80601f0160208091040260200160405190810160405280929190818152602001828054611783906127e9565b80156117d05780601f106117a5576101008083540402835291602001916117d0565b820191906000526020600020905b8154815290600101906020018083116117b357829003601f168201915b50505050509050919050565b6001600160a01b0385166118635760005b835181101561186157828181518110611808576118086129dd565b6020026020010151600c6000868481518110611826576118266129dd565b60200260200101518152602001908152602001600020600082825461184b9190612b0b565b9091555061185a905081612a09565b90506117ed565b505b6001600160a01b03841661117c5760005b8351811015610ae1576000848281518110611891576118916129dd565b6020026020010151905060008483815181106118af576118af6129dd565b602002602001015190506000600c6000848152602001908152602001600020549050818110156119325760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b6064820152608401610452565b6000928352600c60205260409092209103905561194e81612a09565b9050611874565b6001600160a01b0384163b1561117c5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906119999089908990889088908890600401612ca3565b6020604051808303816000875af19250505080156119d4575060408051601f3d908101601f191682019092526119d191810190612d01565b60015b611a80576119e0612d1e565b806308c379a003611a1957506119f4612d3a565b806119ff5750611a1b565b8060405162461bcd60e51b8152600401610452919061213b565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610452565b6001600160e01b0319811663bc197c8160e01b14610ae15760405162461bcd60e51b815260040161045290612dc3565b6000808251604103611ae65760208301516040840151606085015160001a611ada87828585611f51565b94509450505050611b17565b8251604003611b0f5760208301516040840151611b0486838361203e565b935093505050611b17565b506000905060025b9250929050565b6000816004811115611b3257611b32612e0b565b03611b3a5750565b6001816004811115611b4e57611b4e612e0b565b03611b9b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610452565b6002816004811115611baf57611baf612e0b565b03611bfc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610452565b6003816004811115611c1057611c10612e0b565b03611c685760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610452565b6004816004811115611c7c57611c7c612e0b565b036109225760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610452565b6001600160a01b038416611d345760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610452565b336000611d4085611e4b565b90506000611d4d85611e4b565b9050611d5e836000898585896117dc565b6000868152602081815260408083206001600160a01b038b16845290915281208054879290611d8e908490612b0b565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610ae183600089898989611e96565b6000828152600460205260409020611e0682826128cf565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b611e3284610562565b604051611e3f919061213b565b60405180910390a25050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611e8557611e856129dd565b602090810291909101015292915050565b6001600160a01b0384163b1561117c5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611eda9089908990889088908890600401612e21565b6020604051808303816000875af1925050508015611f15575060408051601f3d908101601f19168201909252611f1291810190612d01565b60015b611f21576119e0612d1e565b6001600160e01b0319811663f23a6e6160e01b14610ae15760405162461bcd60e51b815260040161045290612dc3565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611f885750600090506003612035565b8460ff16601b14158015611fa057508460ff16601c14155b15611fb15750600090506004612035565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612005573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661202e57600060019250925050612035565b9150600090505b94509492505050565b6000806001600160ff1b0383168161205b60ff86901c601b612b0b565b905061206987828885611f51565b935093505050935093915050565b80356001600160a01b038116811461125657600080fd5b600080604083850312156120a157600080fd5b6120aa83612077565b946020939093013593505050565b6001600160e01b03198116811461092257600080fd5b6000602082840312156120e057600080fd5b8135610f38816120b8565b60005b838110156121065781810151838201526020016120ee565b50506000910152565b600081518084526121278160208601602086016120eb565b601f01601f19169290920160200192915050565b602081526000610f38602083018461210f565b60006020828403121561216057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156121a2576121a2612167565b6040525050565b600082601f8301126121ba57600080fd5b81356001600160401b038111156121d3576121d3612167565b6040516121ea601f8301601f19166020018261217d565b8181528460208386010111156121ff57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561222f57600080fd5b823561223a816120b8565b915060208301356001600160401b0381111561225557600080fd5b612261858286016121a9565b9150509250929050565b60006020828403121561227d57600080fd5b610f3882612077565b60006001600160401b0382111561229f5761229f612167565b5060051b60200190565b600082601f8301126122ba57600080fd5b813560206122c782612286565b6040516122d4828261217d565b83815260059390931b85018201928281019150868411156122f457600080fd5b8286015b8481101561230f57803583529183019183016122f8565b509695505050505050565b600080600080600060a0868803121561233257600080fd5b61233b86612077565b945061234960208701612077565b935060408601356001600160401b038082111561236557600080fd5b61237189838a016122a9565b9450606088013591508082111561238757600080fd5b61239389838a016122a9565b935060808801359150808211156123a957600080fd5b506123b6888289016121a9565b9150509295509295909350565b600080604083850312156123d657600080fd5b82356001600160401b03808211156123ed57600080fd5b818501915085601f83011261240157600080fd5b8135602061240e82612286565b60405161241b828261217d565b83815260059390931b850182019282810191508984111561243b57600080fd5b948201945b838610156124605761245186612077565b82529482019490820190612440565b9650508601359250508082111561247657600080fd5b50612261858286016122a9565b600081518084526020808501945080840160005b838110156124b357815187529582019590820190600101612497565b509495945050505050565b602081526000610f386020830184612483565b6000602082840312156124e357600080fd5b81356001600160401b038111156124f957600080fd5b610e00848285016121a9565b60008083601f84011261251757600080fd5b5081356001600160401b0381111561252e57600080fd5b602083019150836020828501011115611b1757600080fd5b600080600080600080600060a0888a03121561256157600080fd5b61256a88612077565b9650602088013595506040880135945060608801356001600160401b038082111561259457600080fd5b6125a08b838c01612505565b909650945060808a01359150808211156125b957600080fd5b506125c68a828b01612505565b989b979a50959850939692959293505050565b801515811461092257600080fd5b600080604083850312156125fa57600080fd5b61260383612077565b91506020830135612613816125d9565b809150509250929050565b60008083601f84011261263057600080fd5b5081356001600160401b0381111561264757600080fd5b6020830191508360208260051b8501011115611b1757600080fd5b60008060008060008060008060008060a08b8d03121561268157600080fd5b8a356001600160401b038082111561269857600080fd5b6126a48e838f0161261e565b909c509a5060208d01359150808211156126bd57600080fd5b6126c98e838f0161261e565b909a50985060408d01359150808211156126e257600080fd5b6126ee8e838f0161261e565b909850965060608d013591508082111561270757600080fd5b6127138e838f0161261e565b909650945060808d013591508082111561272c57600080fd5b506127398d828e0161261e565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561276557600080fd5b61276e83612077565b915061277c60208401612077565b90509250929050565b600080600080600060a0868803121561279d57600080fd5b6127a686612077565b94506127b460208701612077565b9350604086013592506060860135915060808601356001600160401b038111156127dd57600080fd5b6123b6888289016121a9565b600181811c908216806127fd57607f821691505b60208210810361281d57634e487b7160e01b600052602260045260246000fd5b50919050565b805160208201516001600160e01b031980821692919060048310156128525780818460040360031b1b83161693505b505050919050565b6000835161286c8184602088016120eb565b8351908301906128808183602088016120eb565b01949350505050565b601f82111561079757600081815260208120601f850160051c810160208610156128b05750805b601f850160051c820191505b8181101561117c578281556001016128bc565b81516001600160401b038111156128e8576128e8612167565b6128fc816128f684546127e9565b84612889565b602080601f83116001811461293157600084156129195750858301515b600019600386901b1c1916600185901b17855561117c565b600085815260208120601f198616915b8281101561296057888601518255948401946001909101908401612941565b508582101561297e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612a1b57612a1b6129f3565b5060010190565b6001600160a01b0386168152602081018590526080604082018190528101839052828460a0830137600060a08483010152600060a0601f19601f86011683010190508260608301529695505050505050565b6000808335601e19843603018112612a8b57600080fd5b8301803591506001600160401b03821115612aa557600080fd5b602001915036819003821315611b1757600080fd5b634e487b7160e01b600052601260045260246000fd5b600082612adf57612adf612aba565b500490565b8181038181111561047e5761047e6129f3565b600082612b0657612b06612aba565b500690565b8082018082111561047e5761047e6129f3565b6000808454612b2c816127e9565b60018281168015612b445760018114612b5957612b88565b60ff1984168752821515830287019450612b88565b8860005260208060002060005b85811015612b7f5781548a820152908401908201612b66565b50505082870194505b5050505083516128808183602088016120eb565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000612c3e6040830185612483565b82810360208401526107638185612483565b600060208284031215612c6257600080fd5b8151610f38816125d9565b6000816000190483118215151615612c8757612c876129f3565b500290565b600081612c9b57612c9b6129f3565b506000190190565b6001600160a01b0386811682528516602082015260a060408201819052600090612ccf90830186612483565b8281036060840152612ce18186612483565b90508281036080840152612cf5818561210f565b98975050505050505050565b600060208284031215612d1357600080fd5b8151610f38816120b8565b600060033d1115612d375760046000803e5060005160e01c5b90565b600060443d1015612d485790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715612d7757505050505090565b8285019150815181811115612d8f5750505050505090565b843d8701016020828501011115612da95750505050505090565b612db86020828601018761217d565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090612e5b9083018461210f565b97965050505050505056fea2646970667358221220937be00fcc17ac476645d45455581ab3e12b2a9dce8b33f5bc5d74a7e06be44864736f6c63430008100033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000016456e76656c6f7020556e6953746f72616765204e4654000000000000000000000000000000000000000000000000000000000000000000000000000000000004654e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002068747470733a2f2f6170692e656e76656c6f702e69732f6d657461646174612f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101725760003560e01c80636829c905116100de578063b277c71711610097578063c05b358511610071578063c05b358514610376578063e985e9c514610389578063f242432a146103c5578063f2fde38b146103d857600080fd5b8063b277c71714610330578063bd85b03914610343578063bf158fd21461036357600080fd5b80636829c905146102c2578063715018a6146102d55780638d0abcda146102dd5780638da5cb5b146102f057806395d89b4114610315578063a22cb4651461031d57600080fd5b80632eb2c2d6116101305780632eb2c2d6146102205780633c8fcc5b146102335780634e1273f41461025a5780634f558e791461027a57806355f804b31461029c57806367f94dba146102af57600080fd5b8062fdd58e1461017757806301ffc9a71461019d57806306fdde03146101c05780630e89341c146101d557806316e25df8146101e85780632baaf41b146101fd575b600080fd5b61018a61018536600461208e565b6103eb565b6040519081526020015b60405180910390f35b6101b06101ab3660046120ce565b610484565b6040519015158152602001610194565b6101c86104d4565b604051610194919061213b565b6101c86101e336600461214e565b610562565b6101fb6101f636600461221c565b61076c565b005b6101b061020b36600461226b565b600a6020526000908152604090205460ff1681565b6101fb61022e36600461231a565b61079c565b61018a7f000000000000000000000000000000000000000000000000000000000000006481565b61026d6102683660046123c3565b6107e8565b60405161019491906124be565b6101b061028836600461214e565b6000908152600c6020526040902054151590565b6101fb6102aa3660046124d1565b610911565b6101fb6102bd366004612546565b610925565b6101c86102d03660046120ce565b610aea565b6101fb610b03565b6101fb6102eb3660046125e7565b610b17565b6005546001600160a01b03165b6040516001600160a01b039091168152602001610194565b6101c8610b4a565b6101fb61032b3660046125e7565b610b57565b6101fb61033e366004612662565b610b66565b61018a61035136600461214e565b6000908152600c602052604090205490565b6006546102fd906001600160a01b031681565b6101fb61038436600461226b565b610c34565b6101b0610397366004612752565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b6101fb6103d3366004612785565b610c45565b6101fb6103e636600461226b565b610c8a565b60006001600160a01b03831661045b5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b14806104b557506001600160e01b031982166303a24d0760e21b145b8061047e57506301ffc9a760e01b6001600160e01b031983161461047e565b600780546104e1906127e9565b80601f016020809104026020016040519081016040528092919081815260200182805461050d906127e9565b801561055a5780601f1061052f5761010080835404028352916020019161055a565b820191906000526020600020905b81548152906001019060200180831161053d57829003601f168201915b505050505081565b6060600061056f83610e5f565b9050600060098054610580906127e9565b80601f01602080910402602001604051908101604052809291908181526020018280546105ac906127e9565b80156105f95780601f106105ce576101008083540402835291602001916105f9565b820191906000526020600020905b8154815290600101906020018083116105dc57829003601f168201915b5050505050905060008261060c90612823565b905060405180604001604052806004815260200163313d3d1d60e11b81525061063490612823565b6001600160e01b03198281169116148061067f5750604051806040016040528060048152602001636970667360e01b81525061066f90612823565b6001600160e01b03198281169116145b15610729576001600160e01b031981166000908152600b6020526040902080546106a8906127e9565b80601f01602080910402602001604051908101604052809291908181526020018280546106d4906127e9565b80156107215780601f106106f657610100808354040283529160200191610721565b820191906000526020600020905b81548152906001019060200180831161070457829003601f168201915b505050505091505b60008351116107405761073b85610e5f565b610763565b818360405160200161075392919061285a565b6040516020818303038152906040525b95945050505050565b610774610f3f565b6001600160e01b031982166000908152600b6020526040902061079782826128cf565b505050565b6001600160a01b0385163314806107b857506107b88533610397565b6107d45760405162461bcd60e51b81526004016104529061298e565b6107e18585858585610f99565b5050505050565b6060815183511461084d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610452565b600083516001600160401b0381111561086857610868612167565b604051908082528060200260200182016040528015610891578160200160208202803683370190505b50905060005b8451811015610909576108dc8582815181106108b5576108b56129dd565b60200260200101518583815181106108cf576108cf6129dd565b60200260200101516103eb565b8282815181106108ee576108ee6129dd565b602090810291909101015261090281612a09565b9050610897565b509392505050565b610919610f3f565b61092281611184565b50565b8015610a545760006109a9338887878a604051602001610949959493929190612a22565b60408051601f1981840301815282825280516020918201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000084830152603c8085019190915282518085039091018152605c909301909152815191012090565b9050600a60006109f185858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525087939250506111909050565b6001600160a01b0316815260208101919091526040016000205460ff16610a4e5760405162461bcd60e51b81526020600482015260116024820152702ab732bc3832b1ba32b21039b4b3b732b960791b6044820152606401610452565b50610a9f565b610a5d336111ac565b610a9f5760405162461bcd60e51b81526020600482015260136024820152722430b99027379029bab139b1b934b83a34b7b760691b6044820152606401610452565b610ae187878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061125b92505050565b50505050505050565b600b60205260009081526040902080546104e1906127e9565b610b0b610f3f565b610b1560006112db565b565b610b1f610f3f565b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b600880546104e1906127e9565b610b6233838361132d565b5050565b60005b89811015610c2757610c158b8b83818110610b8657610b866129dd565b9050602002016020810190610b9b919061226b565b8a8a84818110610bad57610bad6129dd565b90506020020135898985818110610bc657610bc66129dd565b90506020020135888886818110610bdf57610bdf6129dd565b9050602002810190610bf19190612a74565b888888818110610c0357610c036129dd565b90506020028101906102bd9190612a74565b80610c1f81612a09565b915050610b69565b5050505050505050505050565b610c3c610f3f565b6109228161140d565b6001600160a01b038516331480610c615750610c618533610397565b610c7d5760405162461bcd60e51b81526004016104529061298e565b6107e18585858585611475565b610c92610f3f565b6001600160a01b038116610cf75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610452565b610922816112db565b606081600003610d275750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610d515780610d3b81612a09565b9150610d4a9050600a83612ad0565b9150610d2b565b6000816001600160401b03811115610d6b57610d6b612167565b6040519080825280601f01601f191660200182016040528015610d95576020820181803683370190505b5090505b8415610e0057610daa600183612ae4565b9150610db7600a86612af7565b610dc2906030612b0b565b60f81b818381518110610dd757610dd76129dd565b60200101906001600160f81b031916908160001a905350610df9600a86612ad0565b9450610d99565b949350505050565b606081600003610e325750506040805180820190915260048152630307830360e41b602082015290565b8160005b8115610e555780610e4681612a09565b915050600882901c9150610e36565b610e0084826115ad565b600081815260046020526040812080546060929190610e7d906127e9565b80601f0160208091040260200160405190810160405280929190818152602001828054610ea9906127e9565b8015610ef65780601f10610ecb57610100808354040283529160200191610ef6565b820191906000526020600020905b815481529060010190602001808311610ed957829003601f168201915b505050505090506000815111610f1457610f0f83611748565b610f38565b600381604051602001610f28929190612b1e565b6040516020818303038152906040525b9392505050565b6005546001600160a01b03163314610b155760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610452565b8151835114610ffb5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610452565b6001600160a01b0384166110215760405162461bcd60e51b815260040161045290612b9c565b336110308187878787876117dc565b60005b8451811015611116576000858281518110611050576110506129dd565b60200260200101519050600085838151811061106e5761106e6129dd565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156110be5760405162461bcd60e51b815260040161045290612be1565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906110fb908490612b0b565b925050819055505050508061110f90612a09565b9050611033565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611166929190612c2b565b60405180910390a461117c818787878787611955565b505050505050565b6003610b6282826128cf565b600080600061119f8585611ab0565b9150915061090981611b1e565b6006546000906001600160a01b0316156112565760065460405163d15ec2a760e01b81526001600160a01b0384811660048301527f000000000000000000000000000000000000000000000000000000000000006460248301529091169063d15ec2a7906044016020604051808303816000875af1158015611232573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047e9190612c50565b919050565b6000838152600c6020526040902054156112b05760405162461bcd60e51b8152602060048201526016602482015275151a1a5cc81a5908185b1c9958591e481b5a5b9d195960521b6044820152606401610452565b6112cb84848460405180602001604052806000815250611cd4565b6112d58382611dee565b50505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036113a05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610452565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0381166114535760405162461bcd60e51b815260206004820152600d60248201526c4e6f6e207a65726f206f6e6c7960981b6044820152606401610452565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03841661149b5760405162461bcd60e51b815260040161045290612b9c565b3360006114a785611e4b565b905060006114b485611e4b565b90506114c48389898585896117dc565b6000868152602081815260408083206001600160a01b038c168452909152902054858110156115055760405162461bcd60e51b815260040161045290612be1565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611542908490612b0b565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46115a2848a8a8a8a8a611e96565b505050505050505050565b606060006115bc836002612c6d565b6115c7906002612b0b565b6001600160401b038111156115de576115de612167565b6040519080825280601f01601f191660200182016040528015611608576020820181803683370190505b509050600360fc1b81600081518110611623576116236129dd565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611652576116526129dd565b60200101906001600160f81b031916908160001a9053506000611676846002612c6d565b611681906001612b0b565b90505b60018111156116f9576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106116b5576116b56129dd565b1a60f81b8282815181106116cb576116cb6129dd565b60200101906001600160f81b031916908160001a90535060049490941c936116f281612c8c565b9050611684565b508315610f385760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610452565b606060028054611757906127e9565b80601f0160208091040260200160405190810160405280929190818152602001828054611783906127e9565b80156117d05780601f106117a5576101008083540402835291602001916117d0565b820191906000526020600020905b8154815290600101906020018083116117b357829003601f168201915b50505050509050919050565b6001600160a01b0385166118635760005b835181101561186157828181518110611808576118086129dd565b6020026020010151600c6000868481518110611826576118266129dd565b60200260200101518152602001908152602001600020600082825461184b9190612b0b565b9091555061185a905081612a09565b90506117ed565b505b6001600160a01b03841661117c5760005b8351811015610ae1576000848281518110611891576118916129dd565b6020026020010151905060008483815181106118af576118af6129dd565b602002602001015190506000600c6000848152602001908152602001600020549050818110156119325760405162461bcd60e51b815260206004820152602860248201527f455243313135353a206275726e20616d6f756e74206578636565647320746f74604482015267616c537570706c7960c01b6064820152608401610452565b6000928352600c60205260409092209103905561194e81612a09565b9050611874565b6001600160a01b0384163b1561117c5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906119999089908990889088908890600401612ca3565b6020604051808303816000875af19250505080156119d4575060408051601f3d908101601f191682019092526119d191810190612d01565b60015b611a80576119e0612d1e565b806308c379a003611a1957506119f4612d3a565b806119ff5750611a1b565b8060405162461bcd60e51b8152600401610452919061213b565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610452565b6001600160e01b0319811663bc197c8160e01b14610ae15760405162461bcd60e51b815260040161045290612dc3565b6000808251604103611ae65760208301516040840151606085015160001a611ada87828585611f51565b94509450505050611b17565b8251604003611b0f5760208301516040840151611b0486838361203e565b935093505050611b17565b506000905060025b9250929050565b6000816004811115611b3257611b32612e0b565b03611b3a5750565b6001816004811115611b4e57611b4e612e0b565b03611b9b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610452565b6002816004811115611baf57611baf612e0b565b03611bfc5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610452565b6003816004811115611c1057611c10612e0b565b03611c685760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610452565b6004816004811115611c7c57611c7c612e0b565b036109225760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610452565b6001600160a01b038416611d345760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610452565b336000611d4085611e4b565b90506000611d4d85611e4b565b9050611d5e836000898585896117dc565b6000868152602081815260408083206001600160a01b038b16845290915281208054879290611d8e908490612b0b565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610ae183600089898989611e96565b6000828152600460205260409020611e0682826128cf565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b611e3284610562565b604051611e3f919061213b565b60405180910390a25050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110611e8557611e856129dd565b602090810291909101015292915050565b6001600160a01b0384163b1561117c5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611eda9089908990889088908890600401612e21565b6020604051808303816000875af1925050508015611f15575060408051601f3d908101601f19168201909252611f1291810190612d01565b60015b611f21576119e0612d1e565b6001600160e01b0319811663f23a6e6160e01b14610ae15760405162461bcd60e51b815260040161045290612dc3565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611f885750600090506003612035565b8460ff16601b14158015611fa057508460ff16601c14155b15611fb15750600090506004612035565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612005573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661202e57600060019250925050612035565b9150600090505b94509492505050565b6000806001600160ff1b0383168161205b60ff86901c601b612b0b565b905061206987828885611f51565b935093505050935093915050565b80356001600160a01b038116811461125657600080fd5b600080604083850312156120a157600080fd5b6120aa83612077565b946020939093013593505050565b6001600160e01b03198116811461092257600080fd5b6000602082840312156120e057600080fd5b8135610f38816120b8565b60005b838110156121065781810151838201526020016120ee565b50506000910152565b600081518084526121278160208601602086016120eb565b601f01601f19169290920160200192915050565b602081526000610f38602083018461210f565b60006020828403121561216057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156121a2576121a2612167565b6040525050565b600082601f8301126121ba57600080fd5b81356001600160401b038111156121d3576121d3612167565b6040516121ea601f8301601f19166020018261217d565b8181528460208386010111156121ff57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561222f57600080fd5b823561223a816120b8565b915060208301356001600160401b0381111561225557600080fd5b612261858286016121a9565b9150509250929050565b60006020828403121561227d57600080fd5b610f3882612077565b60006001600160401b0382111561229f5761229f612167565b5060051b60200190565b600082601f8301126122ba57600080fd5b813560206122c782612286565b6040516122d4828261217d565b83815260059390931b85018201928281019150868411156122f457600080fd5b8286015b8481101561230f57803583529183019183016122f8565b509695505050505050565b600080600080600060a0868803121561233257600080fd5b61233b86612077565b945061234960208701612077565b935060408601356001600160401b038082111561236557600080fd5b61237189838a016122a9565b9450606088013591508082111561238757600080fd5b61239389838a016122a9565b935060808801359150808211156123a957600080fd5b506123b6888289016121a9565b9150509295509295909350565b600080604083850312156123d657600080fd5b82356001600160401b03808211156123ed57600080fd5b818501915085601f83011261240157600080fd5b8135602061240e82612286565b60405161241b828261217d565b83815260059390931b850182019282810191508984111561243b57600080fd5b948201945b838610156124605761245186612077565b82529482019490820190612440565b9650508601359250508082111561247657600080fd5b50612261858286016122a9565b600081518084526020808501945080840160005b838110156124b357815187529582019590820190600101612497565b509495945050505050565b602081526000610f386020830184612483565b6000602082840312156124e357600080fd5b81356001600160401b038111156124f957600080fd5b610e00848285016121a9565b60008083601f84011261251757600080fd5b5081356001600160401b0381111561252e57600080fd5b602083019150836020828501011115611b1757600080fd5b600080600080600080600060a0888a03121561256157600080fd5b61256a88612077565b9650602088013595506040880135945060608801356001600160401b038082111561259457600080fd5b6125a08b838c01612505565b909650945060808a01359150808211156125b957600080fd5b506125c68a828b01612505565b989b979a50959850939692959293505050565b801515811461092257600080fd5b600080604083850312156125fa57600080fd5b61260383612077565b91506020830135612613816125d9565b809150509250929050565b60008083601f84011261263057600080fd5b5081356001600160401b0381111561264757600080fd5b6020830191508360208260051b8501011115611b1757600080fd5b60008060008060008060008060008060a08b8d03121561268157600080fd5b8a356001600160401b038082111561269857600080fd5b6126a48e838f0161261e565b909c509a5060208d01359150808211156126bd57600080fd5b6126c98e838f0161261e565b909a50985060408d01359150808211156126e257600080fd5b6126ee8e838f0161261e565b909850965060608d013591508082111561270757600080fd5b6127138e838f0161261e565b909650945060808d013591508082111561272c57600080fd5b506127398d828e0161261e565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561276557600080fd5b61276e83612077565b915061277c60208401612077565b90509250929050565b600080600080600060a0868803121561279d57600080fd5b6127a686612077565b94506127b460208701612077565b9350604086013592506060860135915060808601356001600160401b038111156127dd57600080fd5b6123b6888289016121a9565b600181811c908216806127fd57607f821691505b60208210810361281d57634e487b7160e01b600052602260045260246000fd5b50919050565b805160208201516001600160e01b031980821692919060048310156128525780818460040360031b1b83161693505b505050919050565b6000835161286c8184602088016120eb565b8351908301906128808183602088016120eb565b01949350505050565b601f82111561079757600081815260208120601f850160051c810160208610156128b05750805b601f850160051c820191505b8181101561117c578281556001016128bc565b81516001600160401b038111156128e8576128e8612167565b6128fc816128f684546127e9565b84612889565b602080601f83116001811461293157600084156129195750858301515b600019600386901b1c1916600185901b17855561117c565b600085815260208120601f198616915b8281101561296057888601518255948401946001909101908401612941565b508582101561297e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612a1b57612a1b6129f3565b5060010190565b6001600160a01b0386168152602081018590526080604082018190528101839052828460a0830137600060a08483010152600060a0601f19601f86011683010190508260608301529695505050505050565b6000808335601e19843603018112612a8b57600080fd5b8301803591506001600160401b03821115612aa557600080fd5b602001915036819003821315611b1757600080fd5b634e487b7160e01b600052601260045260246000fd5b600082612adf57612adf612aba565b500490565b8181038181111561047e5761047e6129f3565b600082612b0657612b06612aba565b500690565b8082018082111561047e5761047e6129f3565b6000808454612b2c816127e9565b60018281168015612b445760018114612b5957612b88565b60ff1984168752821515830287019450612b88565b8860005260208060002060005b85811015612b7f5781548a820152908401908201612b66565b50505082870194505b5050505083516128808183602088016120eb565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000612c3e6040830185612483565b82810360208401526107638185612483565b600060208284031215612c6257600080fd5b8151610f38816125d9565b6000816000190483118215151615612c8757612c876129f3565b500290565b600081612c9b57612c9b6129f3565b506000190190565b6001600160a01b0386811682528516602082015260a060408201819052600090612ccf90830186612483565b8281036060840152612ce18186612483565b90508281036080840152612cf5818561210f565b98975050505050505050565b600060208284031215612d1357600080fd5b8151610f38816120b8565b600060033d1115612d375760046000803e5060005160e01c5b90565b600060443d1015612d485790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715612d7757505050505090565b8285019150815181811115612d8f5750505050505090565b843d8701016020828501011115612da95750505050505090565b612db86020828601018761217d565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090612e5b9083018461210f565b97965050505050505056fea2646970667358221220937be00fcc17ac476645d45455581ab3e12b2a9dce8b33f5bc5d74a7e06be44864736f6c63430008100033
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.