non-fungible-apps/contracts/deployments/sepolia/solcInputs/51265c9b241f9c7af77f823edad...

147 lines
162 KiB
JSON

{
"language": "Solidity",
"sources": {
"@ensdomains/ens-contracts/contracts/registry/ENS.sol": {
"content": "pragma solidity >=0.8.4;\n\ninterface ENS {\n // Logged when the owner of a node assigns a new owner to a subnode.\n event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);\n\n // Logged when the owner of a node transfers ownership to a new account.\n event Transfer(bytes32 indexed node, address owner);\n\n // Logged when the resolver for a node changes.\n event NewResolver(bytes32 indexed node, address resolver);\n\n // Logged when the TTL of a node changes\n event NewTTL(bytes32 indexed node, uint64 ttl);\n\n // Logged when an operator is added or removed.\n event ApprovalForAll(\n address indexed owner,\n address indexed operator,\n bool approved\n );\n\n function setRecord(\n bytes32 node,\n address owner,\n address resolver,\n uint64 ttl\n ) external;\n\n function setSubnodeRecord(\n bytes32 node,\n bytes32 label,\n address owner,\n address resolver,\n uint64 ttl\n ) external;\n\n function setSubnodeOwner(\n bytes32 node,\n bytes32 label,\n address owner\n ) external returns (bytes32);\n\n function setResolver(bytes32 node, address resolver) external;\n\n function setOwner(bytes32 node, address owner) external;\n\n function setTTL(bytes32 node, uint64 ttl) external;\n\n function setApprovalForAll(address operator, bool approved) external;\n\n function owner(bytes32 node) external view returns (address);\n\n function resolver(bytes32 node) external view returns (address);\n\n function ttl(bytes32 node) external view returns (uint64);\n\n function recordExists(bytes32 node) external view returns (bool);\n\n function isApprovedForAll(\n address owner,\n address operator\n ) external view returns (bool);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/IABIResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IABIResolver {\n event ABIChanged(bytes32 indexed node, uint256 indexed contentType);\n\n /**\n * Returns the ABI associated with an ENS node.\n * Defined in EIP205.\n * @param node The ENS node to query\n * @param contentTypes A bitwise OR of the ABI formats accepted by the caller.\n * @return contentType The content type of the return value\n * @return data The ABI data\n */\n function ABI(\n bytes32 node,\n uint256 contentTypes\n ) external view returns (uint256, bytes memory);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/IAddressResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\n/**\n * Interface for the new (multicoin) addr function.\n */\ninterface IAddressResolver {\n event AddressChanged(\n bytes32 indexed node,\n uint256 coinType,\n bytes newAddress\n );\n\n function addr(\n bytes32 node,\n uint256 coinType\n ) external view returns (bytes memory);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/IAddrResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\n/**\n * Interface for the legacy (ETH-only) addr function.\n */\ninterface IAddrResolver {\n event AddrChanged(bytes32 indexed node, address a);\n\n /**\n * Returns the address associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated address.\n */\n function addr(bytes32 node) external view returns (address payable);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/IContentHashResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IContentHashResolver {\n event ContenthashChanged(bytes32 indexed node, bytes hash);\n\n /**\n * Returns the contenthash associated with an ENS node.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function contenthash(bytes32 node) external view returns (bytes memory);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/IDNSRecordResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IDNSRecordResolver {\n // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated.\n event DNSRecordChanged(\n bytes32 indexed node,\n bytes name,\n uint16 resource,\n bytes record\n );\n // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted.\n event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource);\n\n /**\n * Obtain a DNS record.\n * @param node the namehash of the node for which to fetch the record\n * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record\n * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types\n * @return the DNS record in wire format if present, otherwise empty\n */\n function dnsRecord(\n bytes32 node,\n bytes32 name,\n uint16 resource\n ) external view returns (bytes memory);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/IDNSZoneResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IDNSZoneResolver {\n // DNSZonehashChanged is emitted whenever a given node's zone hash is updated.\n event DNSZonehashChanged(\n bytes32 indexed node,\n bytes lastzonehash,\n bytes zonehash\n );\n\n /**\n * zonehash obtains the hash for the zone.\n * @param node The ENS node to query.\n * @return The associated contenthash.\n */\n function zonehash(bytes32 node) external view returns (bytes memory);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/IExtendedResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\ninterface IExtendedResolver {\n function resolve(\n bytes memory name,\n bytes memory data\n ) external view returns (bytes memory);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/IInterfaceResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IInterfaceResolver {\n event InterfaceChanged(\n bytes32 indexed node,\n bytes4 indexed interfaceID,\n address implementer\n );\n\n /**\n * Returns the address of a contract that implements the specified interface for this name.\n * If an implementer has not been set for this interfaceID and name, the resolver will query\n * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that\n * contract implements EIP165 and returns `true` for the specified interfaceID, its address\n * will be returned.\n * @param node The ENS node to query.\n * @param interfaceID The EIP 165 interface ID to check for.\n * @return The address that implements this interface, or 0 if the interface is unsupported.\n */\n function interfaceImplementer(\n bytes32 node,\n bytes4 interfaceID\n ) external view returns (address);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/INameResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface INameResolver {\n event NameChanged(bytes32 indexed node, string name);\n\n /**\n * Returns the name associated with an ENS node, for reverse records.\n * Defined in EIP181.\n * @param node The ENS node to query.\n * @return The associated name.\n */\n function name(bytes32 node) external view returns (string memory);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/IPubkeyResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface IPubkeyResolver {\n event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);\n\n /**\n * Returns the SECP256k1 public key associated with an ENS node.\n * Defined in EIP 619.\n * @param node The ENS node to query\n * @return x The X coordinate of the curve point for the public key.\n * @return y The Y coordinate of the curve point for the public key.\n */\n function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/profiles/ITextResolver.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\ninterface ITextResolver {\n event TextChanged(\n bytes32 indexed node,\n string indexed indexedKey,\n string key,\n string value\n );\n\n /**\n * Returns the text data associated with an ENS node and key.\n * @param node The ENS node to query.\n * @param key The text data key to query.\n * @return The associated text data.\n */\n function text(\n bytes32 node,\n string calldata key\n ) external view returns (string memory);\n}\n"
},
"@ensdomains/ens-contracts/contracts/resolvers/Resolver.sol": {
"content": "//SPDX-License-Identifier: MIT\npragma solidity >=0.8.4;\n\nimport \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\nimport \"./profiles/IABIResolver.sol\";\nimport \"./profiles/IAddressResolver.sol\";\nimport \"./profiles/IAddrResolver.sol\";\nimport \"./profiles/IContentHashResolver.sol\";\nimport \"./profiles/IDNSRecordResolver.sol\";\nimport \"./profiles/IDNSZoneResolver.sol\";\nimport \"./profiles/IInterfaceResolver.sol\";\nimport \"./profiles/INameResolver.sol\";\nimport \"./profiles/IPubkeyResolver.sol\";\nimport \"./profiles/ITextResolver.sol\";\nimport \"./profiles/IExtendedResolver.sol\";\n\n/**\n * A generic resolver interface which includes all the functions including the ones deprecated\n */\ninterface Resolver is\n IERC165,\n IABIResolver,\n IAddressResolver,\n IAddrResolver,\n IContentHashResolver,\n IDNSRecordResolver,\n IDNSZoneResolver,\n IInterfaceResolver,\n INameResolver,\n IPubkeyResolver,\n ITextResolver,\n IExtendedResolver\n{\n /* Deprecated events */\n event ContentChanged(bytes32 indexed node, bytes32 hash);\n\n function setABI(\n bytes32 node,\n uint256 contentType,\n bytes calldata data\n ) external;\n\n function setAddr(bytes32 node, address addr) external;\n\n function setAddr(bytes32 node, uint256 coinType, bytes calldata a) external;\n\n function setContenthash(bytes32 node, bytes calldata hash) external;\n\n function setDnsrr(bytes32 node, bytes calldata data) external;\n\n function setName(bytes32 node, string calldata _name) external;\n\n function setPubkey(bytes32 node, bytes32 x, bytes32 y) external;\n\n function setText(\n bytes32 node,\n string calldata key,\n string calldata value\n ) external;\n\n function setInterface(\n bytes32 node,\n bytes4 interfaceID,\n address implementer\n ) external;\n\n function multicall(\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n\n function multicallWithNodeCheck(\n bytes32 nodehash,\n bytes[] calldata data\n ) external returns (bytes[] memory results);\n\n /* Deprecated functions */\n function content(bytes32 node) external view returns (bytes32);\n\n function multihash(bytes32 node) external view returns (bytes memory);\n\n function setContent(bytes32 node, bytes32 hash) external;\n\n function setMultihash(bytes32 node, bytes calldata hash) external;\n}\n"
},
"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n"
},
"@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721Upgradeable.sol\";\nimport \"./IERC721ReceiverUpgradeable.sol\";\nimport \"./extensions/IERC721MetadataUpgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../utils/StringsUpgradeable.sol\";\nimport \"../../utils/introspection/ERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {\n using AddressUpgradeable for address;\n using StringsUpgradeable for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {\n __ERC721_init_unchained(name_, symbol_);\n }\n\n function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {\n return\n interfaceId == type(IERC721Upgradeable).interfaceId ||\n interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721Upgradeable.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721Upgradeable.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721Upgradeable.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721Upgradeable.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721Upgradeable.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721Upgradeable.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256, /* firstTokenId */\n uint256 batchSize\n ) internal virtual {\n if (batchSize > 1) {\n if (from != address(0)) {\n _balances[from] -= batchSize;\n }\n if (to != address(0)) {\n _balances[to] += batchSize;\n }\n }\n }\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[44] private __gap;\n}\n"
},
"@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721Upgradeable.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721MetadataUpgradeable is IERC721Upgradeable {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n"
},
"@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721ReceiverUpgradeable {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n"
},
"@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165Upgradeable.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721Upgradeable is IERC165Upgradeable {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {\n function __ERC165_init() internal onlyInitializing {\n }\n\n function __ERC165_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165Upgradeable).interfaceId;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
},
"@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165Upgradeable {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n"
},
"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC721/IERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts/utils/Base64.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides a set of functions to operate with Base64 strings.\n *\n * _Available since v4.5._\n */\nlibrary Base64 {\n /**\n * @dev Base64 Encoding/Decoding Table\n */\n string internal constant _TABLE = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n /**\n * @dev Converts a `bytes` to its Bytes64 `string` representation.\n */\n function encode(bytes memory data) internal pure returns (string memory) {\n /**\n * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence\n * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol\n */\n if (data.length == 0) return \"\";\n\n // Loads the table into memory\n string memory table = _TABLE;\n\n // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter\n // and split into 4 numbers of 6 bits.\n // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up\n // - `data.length + 2` -> Round up\n // - `/ 3` -> Number of 3-bytes chunks\n // - `4 *` -> 4 characters for each chunk\n string memory result = new string(4 * ((data.length + 2) / 3));\n\n /// @solidity memory-safe-assembly\n assembly {\n // Prepare the lookup table (skip the first \"length\" byte)\n let tablePtr := add(table, 1)\n\n // Prepare result pointer, jump over length\n let resultPtr := add(result, 32)\n\n // Run over the input, 3 bytes at a time\n for {\n let dataPtr := data\n let endPtr := add(data, mload(data))\n } lt(dataPtr, endPtr) {\n\n } {\n // Advance 3 bytes\n dataPtr := add(dataPtr, 3)\n let input := mload(dataPtr)\n\n // To write each character, shift the 3 bytes (18 bits) chunk\n // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)\n // and apply logical AND with 0x3F which is the number of\n // the previous character in the ASCII table prior to the Base64 Table\n // The result is then added to the table to get the character to write,\n // and finally write it in the result pointer but with a left shift\n // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n\n mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))\n resultPtr := add(resultPtr, 1) // Advance\n }\n\n // When data `bytes` is not exactly 3 bytes long\n // it is padded with `=` characters at the end\n switch mod(mload(data), 3)\n case 1 {\n mstore8(sub(resultPtr, 1), 0x3d)\n mstore8(sub(resultPtr, 2), 0x3d)\n }\n case 2 {\n mstore8(sub(resultPtr, 1), 0x3d)\n }\n }\n\n return result;\n }\n}\n"
},
"@openzeppelin/contracts/utils/introspection/IERC165.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
},
"@openzeppelin/contracts/utils/math/Math.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n"
},
"@openzeppelin/contracts/utils/Strings.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n"
},
"contracts/FleekAccessControl.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\nerror MustHaveCollectionRole(uint8 role);\nerror MustHaveTokenRole(uint256 tokenId, uint8 role);\nerror MustHaveAtLeastOneOwner();\nerror RoleAlreadySet();\n\ncontract FleekAccessControl is Initializable {\n /**\n * @dev All available collection roles.\n */\n enum CollectionRoles {\n Owner,\n Verifier\n }\n\n /**\n * @dev All available token roles.\n */\n enum TokenRoles {\n Controller\n }\n\n /**\n * @dev Emitted when a token role is changed.\n */\n event TokenRoleChanged(\n uint256 indexed tokenId,\n TokenRoles indexed role,\n address indexed toAddress,\n bool status,\n address byAddress\n );\n\n /**\n * @dev Emitted when token roles version is increased and all token roles are cleared.\n */\n event TokenRolesCleared(uint256 indexed tokenId, address byAddress);\n\n /**\n * @dev Emitted when a collection role is changed.\n */\n event CollectionRoleChanged(\n CollectionRoles indexed role,\n address indexed toAddress,\n bool status,\n address byAddress\n );\n\n /**\n * @dev _collectionRolesCounter[role] is the number of addresses that have the role.\n * This is prevent Owner role to go to 0.\n */\n mapping(CollectionRoles => uint256) private _collectionRolesCounter;\n\n /**\n * @dev _collectionRoles[role][address] is the mapping of addresses that have the role.\n */\n mapping(CollectionRoles => mapping(address => bool)) private _collectionRoles;\n\n /**\n * @dev _tokenRolesVersion[tokenId] is the version of the token roles.\n * The version is incremented every time the token roles are cleared.\n * Should be incremented every token transfer.\n */\n mapping(uint256 => uint256) private _tokenRolesVersion;\n\n /**\n * @dev _tokenRoles[tokenId][version][role][address] is the mapping of addresses that have the role.\n */\n mapping(uint256 => mapping(uint256 => mapping(TokenRoles => mapping(address => bool)))) private _tokenRoles;\n\n /**\n * @dev Initializes the contract by granting the `Owner` role to the deployer.\n */\n function __FleekAccessControl_init() internal onlyInitializing {\n _grantCollectionRole(CollectionRoles.Owner, msg.sender);\n _grantCollectionRole(CollectionRoles.Verifier, msg.sender);\n }\n\n /**\n * @dev Checks if the `msg.sender` has a certain role.\n */\n function _requireCollectionRole(CollectionRoles role) internal view {\n if (!hasCollectionRole(role, msg.sender)) revert MustHaveCollectionRole(uint8(role));\n }\n\n /**\n * @dev Checks if the `msg.sender` has the `Token` role for a certain `tokenId`.\n */\n function _requireTokenRole(uint256 tokenId, TokenRoles role) internal view {\n if (!hasTokenRole(tokenId, role, msg.sender)) revert MustHaveTokenRole(tokenId, uint8(role));\n }\n\n /**\n * @dev Returns `True` if a certain address has the collection role.\n */\n function hasCollectionRole(CollectionRoles role, address account) public view returns (bool) {\n return _collectionRoles[role][account];\n }\n\n /**\n * @dev Returns `True` if a certain address has the token role.\n */\n function hasTokenRole(uint256 tokenId, TokenRoles role, address account) public view returns (bool) {\n uint256 currentVersion = _tokenRolesVersion[tokenId];\n return _tokenRoles[tokenId][currentVersion][role][account];\n }\n\n /**\n * @dev Grants the collection role to an address.\n */\n function _grantCollectionRole(CollectionRoles role, address account) internal {\n if (hasCollectionRole(role, account)) revert RoleAlreadySet();\n\n _collectionRoles[role][account] = true;\n _collectionRolesCounter[role] += 1;\n\n emit CollectionRoleChanged(role, account, true, msg.sender);\n }\n\n /**\n * @dev Revokes the collection role of an address.\n */\n function _revokeCollectionRole(CollectionRoles role, address account) internal {\n if (!hasCollectionRole(role, account)) revert RoleAlreadySet();\n if (role == CollectionRoles.Owner && _collectionRolesCounter[role] == 1) revert MustHaveAtLeastOneOwner();\n\n _collectionRoles[role][account] = false;\n _collectionRolesCounter[role] -= 1;\n\n emit CollectionRoleChanged(role, account, false, msg.sender);\n }\n\n /**\n * @dev Grants the token role to an address.\n */\n function _grantTokenRole(uint256 tokenId, TokenRoles role, address account) internal {\n if (hasTokenRole(tokenId, role, account)) revert RoleAlreadySet();\n\n uint256 currentVersion = _tokenRolesVersion[tokenId];\n _tokenRoles[tokenId][currentVersion][role][account] = true;\n\n emit TokenRoleChanged(tokenId, role, account, true, msg.sender);\n }\n\n /**\n * @dev Revokes the token role of an address.\n */\n function _revokeTokenRole(uint256 tokenId, TokenRoles role, address account) internal {\n if (!hasTokenRole(tokenId, role, account)) revert RoleAlreadySet();\n\n uint256 currentVersion = _tokenRolesVersion[tokenId];\n _tokenRoles[tokenId][currentVersion][role][account] = false;\n\n emit TokenRoleChanged(tokenId, role, account, false, msg.sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n function _clearTokenRoles(uint256 tokenId) internal {\n _tokenRolesVersion[tokenId] += 1;\n emit TokenRolesCleared(tokenId, msg.sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"contracts/FleekAccessPoints.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport {FleekStrings} from \"./util/FleekStrings.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\nerror AccessPointNotExistent();\nerror AccessPointAlreadyExists();\nerror AccessPointScoreCannotBeLower();\nerror MustBeAccessPointOwner();\nerror InvalidTokenIdForAccessPoint();\nerror AccessPointCreationStatusAlreadySet();\n\nabstract contract FleekAccessPoints is Initializable {\n using FleekStrings for FleekAccessPoints.AccessPoint;\n\n event NewAccessPoint(string apName, uint256 indexed tokenId, address indexed owner);\n event RemoveAccessPoint(string apName, uint256 indexed tokenId, address indexed owner);\n\n event ChangeAccessPointScore(string apName, uint256 indexed tokenId, uint256 score, address indexed triggeredBy);\n\n event ChangeAccessPointNameVerify(\n string apName,\n uint256 tokenId,\n bool indexed verified,\n address indexed triggeredBy\n );\n event ChangeAccessPointContentVerify(\n string apName,\n uint256 tokenId,\n bool indexed verified,\n address indexed triggeredBy\n );\n event ChangeAccessPointCreationStatus(\n string apName,\n uint256 tokenId,\n AccessPointCreationStatus status,\n address indexed triggeredBy\n );\n\n /**\n * Creation status enums for access points\n */\n enum AccessPointCreationStatus {\n DRAFT,\n APPROVED,\n REJECTED,\n REMOVED\n }\n\n /**\n * The stored data for each AccessPoint.\n */\n struct AccessPoint {\n uint256 tokenId;\n uint256 score;\n bool contentVerified;\n bool nameVerified;\n address owner;\n AccessPointCreationStatus status;\n }\n\n mapping(string => AccessPoint) private _accessPoints;\n\n mapping(uint256 => bool) private _autoApproval;\n\n /**\n * @dev Checks if the AccessPoint exists.\n */\n modifier requireAP(string memory apName) {\n if (_accessPoints[apName].owner == address(0)) revert AccessPointNotExistent();\n _;\n }\n\n /**\n * @dev A view function to gether information about an AccessPoint.\n * It returns a JSON string representing the AccessPoint information.\n */\n function getAccessPointJSON(string memory apName) public view requireAP(apName) returns (string memory) {\n AccessPoint storage _ap = _accessPoints[apName];\n return _ap.toString();\n }\n\n /**\n * @dev A view function to check if a AccessPoint is verified.\n */\n function isAccessPointNameVerified(string memory apName) public view requireAP(apName) returns (bool) {\n return _accessPoints[apName].nameVerified;\n }\n\n /**\n * @dev Increases the score of a AccessPoint registry.\n */\n function increaseAccessPointScore(string memory apName) public requireAP(apName) {\n _accessPoints[apName].score++;\n emit ChangeAccessPointScore(apName, _accessPoints[apName].tokenId, _accessPoints[apName].score, msg.sender);\n }\n\n /**\n * @dev Decreases the score of a AccessPoint registry if is greater than 0.\n */\n function decreaseAccessPointScore(string memory apName) public requireAP(apName) {\n if (_accessPoints[apName].score == 0) revert AccessPointScoreCannotBeLower();\n _accessPoints[apName].score--;\n emit ChangeAccessPointScore(apName, _accessPoints[apName].tokenId, _accessPoints[apName].score, msg.sender);\n }\n\n /**\n * @dev Add a new AccessPoint register for an app token.\n * The AP name should be a DNS or ENS url and it should be unique.\n */\n function _addAccessPoint(uint256 tokenId, string memory apName) internal {\n if (_accessPoints[apName].owner != address(0)) revert AccessPointAlreadyExists();\n\n emit NewAccessPoint(apName, tokenId, msg.sender);\n\n if (_autoApproval[tokenId]) {\n // Auto Approval is on.\n _accessPoints[apName] = AccessPoint(\n tokenId,\n 0,\n false,\n false,\n msg.sender,\n AccessPointCreationStatus.APPROVED\n );\n\n emit ChangeAccessPointCreationStatus(apName, tokenId, AccessPointCreationStatus.APPROVED, msg.sender);\n } else {\n // Auto Approval is off. Should wait for approval.\n _accessPoints[apName] = AccessPoint(tokenId, 0, false, false, msg.sender, AccessPointCreationStatus.DRAFT);\n emit ChangeAccessPointCreationStatus(apName, tokenId, AccessPointCreationStatus.DRAFT, msg.sender);\n }\n }\n\n /**\n * @dev Remove an AccessPoint registry for an app token.\n * It will also remove the AP from the app token APs list.\n */\n function _removeAccessPoint(string memory apName) internal requireAP(apName) {\n if (msg.sender != _accessPoints[apName].owner) revert MustBeAccessPointOwner();\n _accessPoints[apName].status = AccessPointCreationStatus.REMOVED;\n uint256 tokenId = _accessPoints[apName].tokenId;\n emit ChangeAccessPointCreationStatus(apName, tokenId, AccessPointCreationStatus.REMOVED, msg.sender);\n emit RemoveAccessPoint(apName, tokenId, msg.sender);\n }\n\n /**\n * @dev Updates the `accessPointAutoApproval` settings on minted `tokenId`.\n */\n function _setAccessPointAutoApproval(uint256 tokenId, bool _apAutoApproval) internal {\n _autoApproval[tokenId] = _apAutoApproval;\n }\n\n /**\n * @dev Set approval settings for an access point.\n * It will add the access point to the token's AP list, if `approved` is true.\n */\n function _setApprovalForAccessPoint(uint256 tokenId, string memory apName, bool approved) internal {\n AccessPoint storage accessPoint = _accessPoints[apName];\n if (accessPoint.tokenId != tokenId) revert InvalidTokenIdForAccessPoint();\n if (accessPoint.status != AccessPointCreationStatus.DRAFT) revert AccessPointCreationStatusAlreadySet();\n\n if (approved) {\n // Approval\n accessPoint.status = AccessPointCreationStatus.APPROVED;\n emit ChangeAccessPointCreationStatus(apName, tokenId, AccessPointCreationStatus.APPROVED, msg.sender);\n } else {\n // Not Approved\n accessPoint.status = AccessPointCreationStatus.REJECTED;\n emit ChangeAccessPointCreationStatus(apName, tokenId, AccessPointCreationStatus.REJECTED, msg.sender);\n }\n }\n\n /**\n * @dev Set the content verification of a AccessPoint registry.\n */\n function _setAccessPointContentVerify(string memory apName, bool verified) internal requireAP(apName) {\n _accessPoints[apName].contentVerified = verified;\n emit ChangeAccessPointContentVerify(apName, _accessPoints[apName].tokenId, verified, msg.sender);\n }\n\n /**\n * @dev Set the name verification of a AccessPoint registry.\n */\n function _setAccessPointNameVerify(string memory apName, bool verified) internal requireAP(apName) {\n _accessPoints[apName].nameVerified = verified;\n emit ChangeAccessPointNameVerify(apName, _accessPoints[apName].tokenId, verified, msg.sender);\n }\n\n /**\n * @dev Get the AccessPoint token id.\n */\n function _getAccessPointTokenId(string memory apName) internal view requireAP(apName) returns (uint256) {\n return _accessPoints[apName].tokenId;\n }\n\n /**\n * @dev Get the Auto Approval setting for token id.\n */\n function _getAccessPointAutoApproval(uint256 tokenId) internal view returns (bool) {\n return _autoApproval[tokenId];\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"contracts/FleekApps.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol\";\nimport \"@openzeppelin/contracts/utils/Base64.sol\";\nimport \"./util/FleekSVG.sol\";\nimport \"./FleekERC721.sol\";\n\ncontract FleekApps is Initializable, ERC721Upgradeable {\n using Strings for address;\n using Base64 for bytes;\n\n uint256 public bindCount;\n mapping(uint256 => uint256) public bindings;\n\n FleekERC721 private main;\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n _disableInitializers();\n }\n\n function initialize(string memory _name, string memory _symbol, address _mainAddress) public initializer {\n __ERC721_init(_name, _symbol);\n main = FleekERC721(_mainAddress);\n }\n\n modifier _requireMainMinted(uint256 _tokenId) {\n require(main.ownerOf(_tokenId) != address(0), \"Main token does not exist\");\n _;\n }\n\n function mint(address _to, uint256 _tokenId) public _requireMainMinted(_tokenId) {\n _mint(_to, bindCount);\n bindings[bindCount] = _tokenId;\n bindCount++;\n }\n\n function tokenURI(uint256 _bindId) public view virtual override(ERC721Upgradeable) returns (string memory) {\n (string memory name, string memory ens, string memory logo, string memory color, string memory ipfsHash) = main\n .getAppData(bindings[_bindId]);\n\n // prettier-ignore\n return string(abi.encodePacked(_baseURI(),\n abi.encodePacked('{',\n '\"owner\":\"', ownerOf(_bindId).toHexString(), '\",',\n '\"name\":\"', name, '\",',\n '\"image\":\"', FleekSVG.generateBase64(name, ens, logo, color), '\",',\n '\"external_url\":\"ipfs://', ipfsHash, '\"',\n '}').encode()\n ));\n }\n\n function _baseURI() internal view virtual override returns (string memory) {\n return \"data:application/json;base64,\";\n }\n}\n"
},
"contracts/FleekBilling.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\nerror RequiredPayment(uint requiredValue);\n\nabstract contract FleekBilling is Initializable {\n /**\n * @dev Available billing values.\n */\n enum Billing {\n Mint,\n AddAccessPoint\n }\n\n /**\n * @dev Emitted when the billing value is changed.\n */\n event BillingChanged(Billing key, uint256 price);\n\n /**\n * @dev Emitted when contract is withdrawn.\n */\n event Withdrawn(uint256 value, address indexed byAddress);\n\n /**\n * @dev Mapping of billing values.\n */\n mapping(Billing => uint256) private _billings;\n\n /**\n * @dev Initializes the contract by setting default billing values.\n */\n function __FleekBilling_init(uint256[] memory initialBillings) internal onlyInitializing {\n for (uint256 i = 0; i < initialBillings.length; i++) {\n _setBilling(Billing(i), initialBillings[i]);\n }\n }\n\n /**\n * @dev Returns the billing value for a given key.\n */\n function getBilling(Billing key) public view returns (uint256) {\n return _billings[key];\n }\n\n /**\n * @dev Sets the billing value for a given key.\n */\n function _setBilling(Billing key, uint256 price) internal {\n _billings[key] = price;\n emit BillingChanged(key, price);\n }\n\n /**\n * @dev Internal function to require a payment value.\n */\n function _requirePayment(Billing key) internal {\n uint256 requiredValue = _billings[key];\n if (msg.value != _billings[key]) revert RequiredPayment(requiredValue);\n }\n\n /**\n * @dev Internal function to withdraw the contract balance.\n */\n function _withdraw() internal {\n address by = msg.sender;\n uint256 value = address(this).balance;\n\n payable(by).transfer(value);\n emit Withdrawn(value, by);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"contracts/FleekERC721.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol\";\nimport \"@openzeppelin/contracts/utils/Base64.sol\";\nimport \"@openzeppelin/contracts/utils/Strings.sol\";\nimport \"./FleekAccessControl.sol\";\nimport \"./FleekBilling.sol\";\nimport \"./FleekPausable.sol\";\nimport \"./FleekAccessPoints.sol\";\nimport \"./util/FleekENS.sol\";\nimport \"./util/FleekStrings.sol\";\nimport \"./IERCX.sol\";\n\nerror MustBeTokenOwner(uint256 tokenId);\nerror MustBeTokenVerifier(uint256 tokenId);\nerror ThereIsNoTokenMinted();\n\ncontract FleekERC721 is\n IERCX,\n Initializable,\n ERC721Upgradeable,\n FleekAccessControl,\n FleekPausable,\n FleekBilling,\n FleekAccessPoints\n{\n using Strings for uint256;\n using FleekStrings for FleekERC721.Token;\n using FleekStrings for string;\n using FleekStrings for uint24;\n\n event NewMint(\n uint256 indexed tokenId,\n string name,\n string description,\n string externalURL,\n string ENS,\n string commitHash,\n string gitRepository,\n string ipfsHash,\n string logo,\n uint24 color,\n bool accessPointAutoApproval,\n address indexed minter,\n address indexed owner,\n address verifier\n );\n\n event MetadataUpdate(uint256 indexed _tokenId, string key, address value, address indexed triggeredBy);\n\n uint256 private _appIds;\n mapping(uint256 => Token) private _apps;\n mapping(uint256 => address) private _tokenVerifier;\n mapping(uint256 => bool) private _tokenVerified;\n\n /**\n * @dev This constructor sets the state of implementation contract to paused\n * and disable initializers, not allowing interactions with the implementation\n * contracts.\n */\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n _setPausable(true);\n _pause();\n _disableInitializers();\n }\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n function initialize(\n string memory _name,\n string memory _symbol,\n uint256[] memory initialBillings\n ) public initializer {\n __ERC721_init(_name, _symbol);\n __FleekAccessControl_init();\n __FleekBilling_init(initialBillings);\n __FleekPausable_init();\n }\n\n /**\n * @dev Checks if caller is the verifier of the token.\n */\n modifier requireTokenVerifier(uint256 tokenId) {\n if (_tokenVerifier[tokenId] != msg.sender) revert MustBeTokenVerifier(tokenId);\n _;\n }\n\n /**\n * @dev Mints a token and returns a tokenId.\n *\n * If the `tokenId` has not been minted before, and the `to` address is not zero, emits a {Transfer} event.\n *\n * Requirements:\n *\n * - the caller must have ``collectionOwner``'s admin role.\n * - billing for the minting may be applied.\n * - the contract must be not paused.\n *\n */\n function mint(\n address to,\n string memory name,\n string memory description,\n string memory externalURL,\n string calldata ens,\n string memory commitHash,\n string memory gitRepository,\n string memory ipfsHash,\n string memory logo,\n uint24 color,\n bool accessPointAutoApproval,\n address verifier\n ) public payable requirePayment(Billing.Mint) returns (uint256) {\n if (!hasCollectionRole(CollectionRoles.Verifier, verifier))\n revert MustHaveCollectionRole(uint8(CollectionRoles.Verifier));\n if (bytes(ens).length > 0) FleekENS.requireENSOwner(ens);\n uint256 tokenId = _appIds;\n _mint(to, tokenId);\n\n _appIds += 1;\n\n Token storage app = _apps[tokenId];\n app.name = name;\n app.description = description;\n app.externalURL = externalURL;\n app.ENS = ens;\n app.logo = logo;\n app.color = color;\n\n // The mint interaction is considered to be the first build of the site. Updates from now on all increment the currentBuild by one and update the mapping.\n app.currentBuild = 0;\n app.builds[0] = Build(commitHash, gitRepository, ipfsHash, externalURL);\n\n emit NewMint(\n tokenId,\n name,\n description,\n externalURL,\n ens,\n commitHash,\n gitRepository,\n ipfsHash,\n logo,\n color,\n accessPointAutoApproval,\n msg.sender,\n to,\n verifier\n );\n\n _tokenVerifier[tokenId] = verifier;\n _tokenVerified[tokenId] = false;\n _setAccessPointAutoApproval(tokenId, accessPointAutoApproval);\n\n return tokenId;\n }\n\n /**\n * @dev Returns the token metadata associated with the `tokenId`.\n *\n * Returns a based64 encoded string value of the URI.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n *\n */\n function tokenURI(uint256 tokenId) public view virtual override(ERC721Upgradeable, IERCX) returns (string memory) {\n _requireMinted(tokenId);\n address owner = ownerOf(tokenId);\n bool accessPointAutoApproval = _getAccessPointAutoApproval(tokenId);\n bool verified = _tokenVerified[tokenId];\n Token storage app = _apps[tokenId];\n\n return string(abi.encodePacked(_baseURI(), app.toString(owner, accessPointAutoApproval, verified).toBase64()));\n }\n\n /**\n * @dev Returns the token metadata associated with the `tokenId`.\n *\n * Returns multiple string and uint values in relation to metadata fields of the App struct.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n *\n */\n function getToken(\n uint256 tokenId\n )\n public\n view\n virtual\n returns (string memory, string memory, string memory, string memory, uint256, string memory, uint24)\n {\n _requireMinted(tokenId);\n Token storage app = _apps[tokenId];\n return (app.name, app.description, app.externalURL, app.ENS, app.currentBuild, app.logo, app.color);\n }\n\n function getAppData(\n uint256 tokenId\n ) public view returns (string memory, string memory, string memory, string memory, string memory) {\n _requireMinted(tokenId);\n Token storage app = _apps[tokenId];\n\n return (app.name, app.ENS, app.logo, app.color.toColorString(), app.builds[app.currentBuild].ipfsHash);\n }\n\n /**\n * @dev Returns the last minted tokenId.\n */\n function getLastTokenId() public view virtual returns (uint256) {\n uint256 current = _appIds;\n if (current == 0) revert ThereIsNoTokenMinted();\n return current - 1;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Upgradeable) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Override of _beforeTokenTransfer of ERC721.\n * Here it needs to update the token controller roles for mint, burn and transfer.\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId,\n uint256 batchSize\n ) internal virtual override whenNotPaused {\n if (from != address(0) && to != address(0)) {\n // Transfer\n _clearTokenRoles(tokenId);\n } else if (from == address(0)) {\n // Mint\n // TODO: set contract owner as controller\n } else if (to == address(0)) {\n // Burn\n _clearTokenRoles(tokenId);\n }\n super._beforeTokenTransfer(from, to, tokenId, batchSize);\n }\n\n /**\n * @dev A baseURI internal function implementation to be called in the `tokenURI` function.\n */\n function _baseURI() internal view virtual override returns (string memory) {\n return \"data:application/json;base64,\";\n }\n\n /**\n * @dev Updates the `externalURL` metadata field of a minted `tokenId`.\n *\n * May emit a {NewTokenExternalURL} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must have the `tokenController` role.\n *\n */\n function setTokenExternalURL(\n uint256 tokenId,\n string memory _tokenExternalURL\n ) public virtual requireTokenRole(tokenId, TokenRoles.Controller) {\n _requireMinted(tokenId);\n _apps[tokenId].externalURL = _tokenExternalURL;\n emit MetadataUpdate(tokenId, \"externalURL\", _tokenExternalURL, msg.sender);\n }\n\n /**\n * @dev Updates the `ENS` metadata field of a minted `tokenId`.\n *\n * May emit a {NewTokenENS} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must have the `tokenController` role.\n *\n */\n function setTokenENS(\n uint256 tokenId,\n string calldata _tokenENS\n ) public virtual requireTokenRole(tokenId, TokenRoles.Controller) {\n FleekENS.requireENSOwner(_tokenENS);\n _requireMinted(tokenId);\n _apps[tokenId].ENS = _tokenENS;\n emit MetadataUpdate(tokenId, \"ENS\", _tokenENS, msg.sender);\n }\n\n /**\n * @dev Updates the `name` metadata field of a minted `tokenId`.\n *\n * May emit a {NewTokenName} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must have the `tokenController` role.\n *\n */\n function setTokenName(\n uint256 tokenId,\n string memory _tokenName\n ) public virtual requireTokenRole(tokenId, TokenRoles.Controller) {\n _requireMinted(tokenId);\n _apps[tokenId].name = _tokenName;\n emit MetadataUpdate(tokenId, \"name\", _tokenName, msg.sender);\n }\n\n /**\n * @dev Updates the `description` metadata field of a minted `tokenId`.\n *\n * May emit a {NewTokenDescription} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must have the `tokenController` role.\n *\n */\n function setTokenDescription(\n uint256 tokenId,\n string memory _tokenDescription\n ) public virtual requireTokenRole(tokenId, TokenRoles.Controller) {\n _requireMinted(tokenId);\n _apps[tokenId].description = _tokenDescription;\n emit MetadataUpdate(tokenId, \"description\", _tokenDescription, msg.sender);\n }\n\n /**\n * @dev Updates the `logo` metadata field of a minted `tokenId`.\n *\n * May emit a {NewTokenLogo} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must have the `tokenController` role.\n *\n */\n function setTokenLogo(\n uint256 tokenId,\n string memory _tokenLogo\n ) public virtual requireTokenRole(tokenId, TokenRoles.Controller) {\n _requireMinted(tokenId);\n _apps[tokenId].logo = _tokenLogo;\n emit MetadataUpdate(tokenId, \"logo\", _tokenLogo, msg.sender);\n }\n\n /**\n * @dev Updates the `color` metadata field of a minted `tokenId`.\n *\n * May emit a {NewTokenColor} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must have the `tokenController` role.\n *\n */\n function setTokenColor(\n uint256 tokenId,\n uint24 _tokenColor\n ) public virtual requireTokenRole(tokenId, TokenRoles.Controller) {\n _requireMinted(tokenId);\n _apps[tokenId].color = _tokenColor;\n emit MetadataUpdate(tokenId, \"color\", _tokenColor, msg.sender);\n }\n\n /**\n * @dev Updates the `logo` and `color` metadata fields of a minted `tokenId`.\n *\n * May emit a {NewTokenLogo} and a {NewTokenColor} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must have the `tokenController` role.\n *\n */\n function setTokenLogoAndColor(uint256 tokenId, string memory _tokenLogo, uint24 _tokenColor) public virtual {\n setTokenLogo(tokenId, _tokenLogo);\n setTokenColor(tokenId, _tokenColor);\n }\n\n /**\n * @dev Adds a new build to a minted `tokenId`'s builds mapping.\n *\n * May emit a {NewBuild} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must have the `tokenController` role.\n *\n */\n function setTokenBuild(\n uint256 tokenId,\n string memory _commitHash,\n string memory _gitRepository,\n string memory _ipfsHash,\n string memory _domain\n ) public virtual requireTokenRole(tokenId, TokenRoles.Controller) {\n _requireMinted(tokenId);\n _apps[tokenId].builds[++_apps[tokenId].currentBuild] = Build(_commitHash, _gitRepository, _ipfsHash, _domain);\n // Note from Nima: should we update the externalURL field with each new domain?\n emit MetadataUpdate(tokenId, \"build\", [_commitHash, _gitRepository, _ipfsHash, _domain], msg.sender);\n }\n\n /**\n * @dev Burns a previously minted `tokenId`.\n *\n * May emit a {Transfer} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must be the owner of the token.\n * - the contract must be not paused.\n *\n */\n function burn(uint256 tokenId) public virtual requireTokenOwner(tokenId) {\n super._burn(tokenId);\n\n if (bytes(_apps[tokenId].externalURL).length != 0) {\n delete _apps[tokenId];\n }\n }\n\n /**\n * @dev Sets an address as verifier of a token.\n * The verifier must have `CollectionRoles.Verifier` role.\n *\n * May emit a {MetadataUpdate} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must be the owner of the token.\n * - the verifier must have `CollectionRoles.Verifier` role.\n *\n */\n function setTokenVerifier(uint256 tokenId, address verifier) public requireTokenOwner(tokenId) {\n if (!hasCollectionRole(CollectionRoles.Verifier, verifier))\n revert MustHaveCollectionRole(uint8(CollectionRoles.Verifier));\n _requireMinted(tokenId);\n _tokenVerifier[tokenId] = verifier;\n emit MetadataUpdate(tokenId, \"verifier\", verifier, msg.sender);\n }\n\n /**\n * @dev Returns the verifier of a token.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n *\n */\n function getTokenVerifier(uint256 tokenId) public view returns (address) {\n _requireMinted(tokenId);\n return _tokenVerifier[tokenId];\n }\n\n /**\n * @dev Sets the verification status of a token.\n *\n * May emit a {MetadataUpdate} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must be the token verifier.\n * - the sender must have `CollectionRoles.Verifier` role.\n *\n */\n function setTokenVerified(\n uint256 tokenId,\n bool verified\n ) public requireCollectionRole(CollectionRoles.Verifier) requireTokenVerifier(tokenId) {\n _requireMinted(tokenId);\n _tokenVerified[tokenId] = verified;\n emit MetadataUpdate(tokenId, \"verified\", verified, msg.sender);\n }\n\n /**\n * @dev Returns the verification status of a token.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n *\n */\n function isTokenVerified(uint256 tokenId) public view returns (bool) {\n _requireMinted(tokenId);\n return _tokenVerified[tokenId];\n }\n\n /*//////////////////////////////////////////////////////////////\n ACCESS POINTS\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @dev Add a new AccessPoint register for an app token.\n * The AP name should be a DNS or ENS url and it should be unique.\n * Anyone can add an AP but it should requires a payment.\n *\n * May emit a {NewAccessPoint} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - billing for add acess point may be applied.\n * - the contract must be not paused.\n *\n */\n function addAccessPoint(\n uint256 tokenId,\n string memory apName\n ) public payable whenNotPaused requirePayment(Billing.AddAccessPoint) {\n _requireMinted(tokenId);\n _addAccessPoint(tokenId, apName);\n }\n\n /**\n * @dev Remove an AccessPoint registry for an app token.\n * It will also remove the AP from the app token APs list.\n *\n * May emit a {RemoveAccessPoint} event.\n *\n * Requirements:\n *\n * - the AP must exist.\n * - must be called by the AP owner.\n * - the contract must be not paused.\n *\n */\n function removeAccessPoint(string memory apName) public whenNotPaused {\n _removeAccessPoint(apName);\n }\n\n /**\n * @dev Updates the `accessPointAutoApproval` settings on minted `tokenId`.\n *\n * May emit a {MetadataUpdate} event.\n *\n * Requirements:\n *\n * - the tokenId must be minted and valid.\n * - the sender must have the `tokenController` role.\n *\n */\n function setAccessPointAutoApproval(uint256 tokenId, bool _apAutoApproval) public requireTokenOwner(tokenId) {\n _requireMinted(tokenId);\n _setAccessPointAutoApproval(tokenId, _apAutoApproval);\n emit MetadataUpdate(tokenId, \"accessPointAutoApproval\", _apAutoApproval, msg.sender);\n }\n\n /**\n * @dev Set approval settings for an access point.\n * It will add the access point to the token's AP list, if `approved` is true.\n *\n * May emit a {ChangeAccessPointApprovalStatus} event.\n *\n * Requirements:\n *\n * - the tokenId must exist and be the same as the tokenId that is set for the AP.\n * - the AP must exist.\n * - must be called by a token controller.\n */\n function setApprovalForAccessPoint(\n uint256 tokenId,\n string memory apName,\n bool approved\n ) public requireTokenOwner(tokenId) {\n _setApprovalForAccessPoint(tokenId, apName, approved);\n }\n\n /**\n * @dev Set the content verification of a AccessPoint registry.\n *\n * May emit a {ChangeAccessPointContentVerify} event.\n *\n * Requirements:\n *\n * - the AP must exist.\n * - the sender must have the token controller role.\n *\n */\n function setAccessPointContentVerify(\n string memory apName,\n bool verified\n ) public requireCollectionRole(CollectionRoles.Verifier) requireTokenVerifier(_getAccessPointTokenId(apName)) {\n _setAccessPointContentVerify(apName, verified);\n }\n\n /**\n * @dev Set the name verification of a AccessPoint registry.\n *\n * May emit a {ChangeAccessPointNameVerify} event.\n *\n * Requirements:\n *\n * - the AP must exist.\n * - the sender must have the token controller role.\n *\n */\n function setAccessPointNameVerify(\n string memory apName,\n bool verified\n ) public requireCollectionRole(CollectionRoles.Verifier) requireTokenVerifier(_getAccessPointTokenId(apName)) {\n _setAccessPointNameVerify(apName, verified);\n }\n\n /*//////////////////////////////////////////////////////////////\n ACCESS CONTROL\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @dev Requires caller to have a selected collection role.\n */\n modifier requireCollectionRole(CollectionRoles role) {\n _requireCollectionRole(role);\n _;\n }\n\n /**\n * @dev Requires caller to have a selected token role.\n */\n modifier requireTokenRole(uint256 tokenId, TokenRoles role) {\n if (ownerOf(tokenId) != msg.sender) _requireTokenRole(tokenId, role);\n _;\n }\n\n /**\n * @dev Requires caller to be selected token owner.\n */\n modifier requireTokenOwner(uint256 tokenId) {\n if (ownerOf(tokenId) != msg.sender) revert MustBeTokenOwner(tokenId);\n _;\n }\n\n /**\n * @dev Grants the collection role to an address.\n *\n * Requirements:\n *\n * - the caller should have the collection role.\n *\n */\n function grantCollectionRole(\n CollectionRoles role,\n address account\n ) public whenNotPaused requireCollectionRole(CollectionRoles.Owner) {\n _grantCollectionRole(role, account);\n }\n\n /**\n * @dev Grants the token role to an address.\n *\n * Requirements:\n *\n * - the caller should have the token role.\n *\n */\n function grantTokenRole(\n uint256 tokenId,\n TokenRoles role,\n address account\n ) public whenNotPaused requireTokenOwner(tokenId) {\n _grantTokenRole(tokenId, role, account);\n }\n\n /**\n * @dev Revokes the collection role of an address.\n *\n * Requirements:\n *\n * - the caller should have the collection role.\n *\n */\n function revokeCollectionRole(\n CollectionRoles role,\n address account\n ) public whenNotPaused requireCollectionRole(CollectionRoles.Owner) {\n _revokeCollectionRole(role, account);\n }\n\n /**\n * @dev Revokes the token role of an address.\n *\n * Requirements:\n *\n * - the caller should have the token role.\n *\n */\n function revokeTokenRole(\n uint256 tokenId,\n TokenRoles role,\n address account\n ) public whenNotPaused requireTokenOwner(tokenId) {\n _revokeTokenRole(tokenId, role, account);\n }\n\n /*//////////////////////////////////////////////////////////////\n PAUSABLE\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @dev Sets the contract to paused state.\n *\n * Requirements:\n *\n * - the sender must have the `controller` role.\n * - the contract must be pausable.\n * - the contract must be not paused.\n *\n */\n function pause() public requireCollectionRole(CollectionRoles.Owner) {\n _pause();\n }\n\n /**\n * @dev Sets the contract to unpaused state.\n *\n * Requirements:\n *\n * - the sender must have the `controller` role.\n * - the contract must be paused.\n *\n */\n function unpause() public requireCollectionRole(CollectionRoles.Owner) {\n _unpause();\n }\n\n /**\n * @dev Sets the contract to pausable state.\n *\n * Requirements:\n *\n * - the sender must have the `owner` role.\n * - the contract must be in the oposite pausable state.\n *\n */\n function setPausable(bool pausable) public requireCollectionRole(CollectionRoles.Owner) {\n _setPausable(pausable);\n }\n\n /*//////////////////////////////////////////////////////////////\n BILLING\n //////////////////////////////////////////////////////////////*/\n\n /**\n * @dev Modifier to require billing with a given key.\n */\n modifier requirePayment(Billing key) {\n _requirePayment(key);\n _;\n }\n\n /**\n * @dev Sets the billing value for a given key.\n *\n * May emit a {BillingChanged} event.\n *\n * Requirements:\n *\n * - the sender must have the `collectionOwner` role.\n *\n */\n function setBilling(Billing key, uint256 value) public requireCollectionRole(CollectionRoles.Owner) {\n _setBilling(key, value);\n }\n\n /**\n * @dev Withdraws all the funds from contract.\n *\n * May emmit a {Withdrawn} event.\n *\n * Requirements:\n *\n * - the sender must have the `collectionOwner` role.\n *\n */\n function withdraw() public requireCollectionRole(CollectionRoles.Owner) {\n _withdraw();\n }\n}\n"
},
"contracts/FleekPausable.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\nerror ContractIsPaused();\nerror ContractIsNotPaused();\nerror ContractIsNotPausable();\nerror PausableIsSetTo(bool state);\n\nabstract contract FleekPausable is Initializable {\n /**\n * @dev Emitted when the pause is triggered by `account` and set to `isPaused`.\n */\n event PauseStatusChange(bool indexed isPaused, address account);\n\n /**\n * @dev Emitted when the pausable is triggered by `account` and set to `isPausable`.\n */\n event PausableStatusChange(bool indexed isPausable, address account);\n\n bool private _paused;\n bool private _canPause; // TODO: how should we verify if the contract is pausable or not?\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __FleekPausable_init() internal onlyInitializing {\n _paused = false;\n _canPause = true;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function isPaused() public view returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Returns true if the contract is pausable, and false otherwise.\n */\n function isPausable() public view returns (bool) {\n return _canPause;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view {\n if (isPaused()) revert ContractIsPaused();\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view {\n if (!isPaused()) revert ContractIsNotPaused();\n }\n\n /**\n * @dev Throws if the contract is not pausable.\n */\n function _requirePausable() internal view {\n if (!isPausable()) revert ContractIsNotPausable();\n }\n\n /**\n * @dev Sets the contract to be pausable or not.\n * @param canPause true if the contract is pausable, and false otherwise.\n */\n function _setPausable(bool canPause) internal {\n if (canPause == _canPause) revert PausableIsSetTo(canPause);\n _canPause = canPause;\n emit PausableStatusChange(canPause, msg.sender);\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal whenNotPaused {\n _requirePausable();\n _paused = true;\n emit PauseStatusChange(false, msg.sender);\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal whenPaused {\n _paused = false;\n emit PauseStatusChange(false, msg.sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
},
"contracts/IERCX.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\n\n/**\n * @title ERCX Interface\n * @author\n * @notice\n *\n * ERCX is a standard for NFTs that represent websites. It is a standard that\n * allows for the storage of metadata about a website, and allows for the\n * storage of multiple builds of a website. This allows for the NFT to be\n * used as a way to store the history of a website.\n */\ninterface IERCX {\n /**\n * Event emitted when a token's metadata is updated.\n * @param _tokenId the updated token id.\n * @param key which metadata key was updated\n * @param value the new value of the metadata\n * @param triggeredBy the address that triggered the update\n */\n event MetadataUpdate(uint256 indexed _tokenId, string key, string value, address indexed triggeredBy);\n event MetadataUpdate(uint256 indexed _tokenId, string key, uint24 value, address indexed triggeredBy);\n event MetadataUpdate(uint256 indexed _tokenId, string key, string[4] value, address indexed triggeredBy);\n event MetadataUpdate(uint256 indexed _tokenId, string key, bool value, address indexed triggeredBy);\n\n /**\n * The metadata that is stored for each build.\n */\n struct Build {\n string commitHash;\n string gitRepository;\n string ipfsHash;\n string domain;\n }\n\n /**\n * The properties are stored as string to keep consistency with\n * other token contracts, we might consider changing for bytes32\n * in the future due to gas optimization.\n */\n struct Token {\n string name; // Name of the site\n string description; // Description about the site\n string externalURL; // Site URL\n string ENS; // ENS for the site\n string logo; // Branding logo\n uint24 color; // Branding color\n uint256 currentBuild; // The current build number (Increments by one with each change, starts at zero)\n mapping(uint256 => Build) builds; // Mapping to build details for each build number\n }\n\n /**\n * @dev Sets a minted token's external URL.\n */\n function setTokenExternalURL(uint256 tokenId, string memory _tokenExternalURL) external;\n\n /**\n * @dev Sets a minted token's ENS.\n */\n function setTokenENS(uint256 tokenId, string memory _tokenENS) external;\n\n /**\n * @dev Sets a minted token's name.\n */\n function setTokenName(uint256 tokenId, string memory _tokenName) external;\n\n /**\n * @dev Sets a minted token's description.\n */\n function setTokenDescription(uint256 tokenId, string memory _tokenDescription) external;\n\n /**\n * @dev Sets a minted token's logo.\n */\n function setTokenLogo(uint256 tokenId, string memory _tokenLogo) external;\n\n /**\n * @dev Sets a minted token's color.\n */\n function setTokenColor(uint256 tokenId, uint24 _tokenColor) external;\n\n /**\n * @dev Sets a minted token's build.\n */\n function setTokenBuild(\n uint256 tokenId,\n string memory commitHash,\n string memory gitRepository,\n string memory ipfsHash,\n string memory domain\n ) external;\n\n /**\n * @dev Returns the token metadata for a given tokenId.\n * It must return a valid JSON object in string format encoded in Base64.\n */\n function tokenURI(uint256 tokenId) external returns (string memory);\n}\n"
},
"contracts/util/FleekENS.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {ENS} from \"@ensdomains/ens-contracts/contracts/registry/ENS.sol\";\nimport {Resolver} from \"@ensdomains/ens-contracts/contracts/resolvers/Resolver.sol\";\n\nerror MustBeENSOwner();\n\nlibrary FleekENS {\n ENS internal constant _ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);\n\n /**\n * @dev Reverts if the sender is not the owner of the ENS node.\n */\n function requireENSOwner(string calldata name) internal view {\n if (_ens.owner(namehash(bytes(name), 0)) != msg.sender) revert MustBeENSOwner();\n }\n\n /**\n * @dev Processes the name and returns the ENS node hash.\n */\n function namehash(bytes calldata name, uint256 index) internal view returns (bytes32) {\n for (uint256 i = index; i < name.length; i++) {\n if (name[i] == \".\") {\n return keccak256(abi.encodePacked(namehash(name, i + 1), keccak256(name[index:i])));\n }\n }\n return keccak256(abi.encodePacked(bytes32(0x0), keccak256(name[index:name.length])));\n }\n}\n"
},
"contracts/util/FleekStrings.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport \"@openzeppelin/contracts/utils/Strings.sol\";\nimport \"@openzeppelin/contracts/utils/Base64.sol\";\nimport \"./FleekSVG.sol\";\nimport \"../IERCX.sol\";\nimport \"../FleekAccessPoints.sol\";\n\nlibrary FleekStrings {\n using Strings for uint256;\n using Strings for uint160;\n using FleekStrings for bool;\n using FleekStrings for uint24;\n using Strings for uint24;\n\n /**\n * @dev Converts a boolean value to a string.\n */\n function toString(bool _bool) internal pure returns (string memory) {\n return _bool ? \"true\" : \"false\";\n }\n\n /**\n * @dev Converts a string to a base64 string.\n */\n function toBase64(string memory str) internal pure returns (string memory) {\n return Base64.encode(bytes(str));\n }\n\n /**\n * @dev Converts IERCX.Token to a JSON string.\n * It requires to receive owner address as a parameter.\n */\n function toString(\n IERCX.Token storage app,\n address owner,\n bool accessPointAutoApproval,\n bool verified\n ) internal view returns (string memory) {\n // prettier-ignore\n return string(abi.encodePacked(\n '{',\n '\"name\":\"', app.name, '\",',\n '\"description\":\"', app.description, '\",',\n '\"owner\":\"', uint160(owner).toHexString(20), '\",',\n '\"external_url\":\"', app.externalURL, '\",',\n '\"image\":\"', FleekSVG.generateBase64(app.name, app.ENS, app.logo, app.color.toColorString()), '\",',\n '\"access_point_auto_approval\":', accessPointAutoApproval.toString(),',',\n '\"verified\":',verified.toString(),',',\n '\"attributes\": [',\n '{\"trait_type\": \"ENS\", \"value\":\"', app.ENS,'\"},',\n '{\"trait_type\": \"Commit Hash\", \"value\":\"', app.builds[app.currentBuild].commitHash,'\"},',\n '{\"trait_type\": \"Repository\", \"value\":\"', app.builds[app.currentBuild].gitRepository,'\"},',\n '{\"trait_type\": \"Version\", \"value\":\"', app.currentBuild.toString(),'\"},',\n '{\"trait_type\": \"Color\", \"value\":\"', app.color.toColorString(),'\"}',\n ']',\n '}'\n ));\n }\n\n /**\n * @dev Converts FleekAccessPoints.AccessPoint to a JSON string.\n */\n function toString(FleekAccessPoints.AccessPoint storage ap) internal view returns (string memory) {\n // prettier-ignore\n return string(abi.encodePacked(\n \"{\",\n '\"tokenId\":', ap.tokenId.toString(), \",\",\n '\"score\":', ap.score.toString(), \",\",\n '\"nameVerified\":', ap.nameVerified.toString(), \",\",\n '\"contentVerified\":', ap.contentVerified.toString(), \",\",\n '\"owner\":\"', uint160(ap.owner).toHexString(20), '\",',\n '\"status\":',uint(ap.status).toString(),\n \"}\"\n ));\n }\n\n /**\n * @dev Converts bytes3 to a hex color string.\n */\n function toColorString(uint24 color) internal pure returns (string memory) {\n bytes memory hexBytes = bytes(color.toHexString(3));\n bytes memory hexColor = new bytes(7);\n hexColor[0] = \"#\";\n for (uint256 i = 1; i < 7; i++) {\n hexColor[i] = hexBytes[i + 1];\n }\n return string(hexColor);\n }\n}\n"
},
"contracts/util/FleekSVG.sol": {
"content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.7;\n\nimport \"@openzeppelin/contracts/utils/Strings.sol\";\nimport \"@openzeppelin/contracts/utils/Base64.sol\";\n\nlibrary FleekSVG {\n /**\n * @dev Generates a SVG image.\n */\n function generateBase64(\n string memory name,\n string memory ENS,\n string memory logo,\n string memory color\n ) public pure returns (string memory) {\n return (\n string(\n abi.encodePacked(\n \"data:image/svg+xml;base64,\",\n Base64.encode(\n abi.encodePacked(\n '<svg width=\"1065\" height=\"1065\" viewBox=\"0 0 1065 1065\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">',\n // background\n '<style type=\"text/css\">@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@500;600\");</style>',\n '<rect width=\"1065\" height=\"1065\" fill=\"url(#background)\" /><rect opacity=\"0.2\" width=\"1065\" height=\"1065\" fill=\"url(#background-radial)\" />',\n // shadows\n '<g filter=\"url(#diskette-shadow)\"><path d=\"M857.231 279.712L902.24 286.675C910.547 287.96 917.915 292.721 922.5 299.768L938.894 324.964C942.249 330.12 943.311 336.437 941.827 342.406L937.798 358.615L924.049 356.65L919.416 374.084L934.068 376.24L791.947 922.152C788.109 936.896 773.694 946.308 758.651 943.893L179.636 850.928C162.318 848.147 151.215 830.987 155.776 814.051L160.478 796.59L704.315 879.574L857.231 279.712Z\" fill=\"#050505\" /></g>',\n '<path d=\"M840.231 240.712L885.24 247.675C893.547 248.961 900.915 253.722 905.5 260.768L921.894 285.965C925.249 291.12 926.311 297.437 924.827 303.406L920.798 319.616L907.049 317.65L902.416 335.084L917.068 337.241L774.947 883.152C771.109 897.896 756.694 907.308 741.651 904.893L162.636 811.928C145.318 809.147 134.215 791.987 138.776 775.051L143.478 757.59L687.315 840.574L840.231 240.712Z\" fill=\"url(#main)\" />',\n // diskette fill\n '<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M319.847 161.502C310.356 160.007 300.674 166.326 298.221 175.616L138.724 779.758C136.271 789.048 141.977 797.79 151.468 799.285L740.061 891.973C749.553 893.467 759.235 887.148 761.687 877.858L902.405 344.854L889.158 342.768L898.872 305.972L912.119 308.059L913.733 301.946C914.837 297.762 914.309 293.476 912.251 289.927L893.484 257.569C891.153 253.549 887.063 250.823 882.221 250.061L828.205 241.554C822.224 240.613 815.869 242.783 811.427 247.284L805.686 253.103C804.205 254.603 802.087 255.326 800.093 255.013L783.611 252.417L734.3 439.196C731.439 450.035 720.143 457.407 709.07 455.663L328.847 395.788C317.774 394.045 311.117 383.845 313.978 373.007L366.528 173.962L366.533 173.941C367.234 171.24 365.572 168.702 362.81 168.267L319.847 161.502ZM369.392 174.414L368.652 177.217L316.843 373.458C314.39 382.748 320.096 391.49 329.587 392.985L709.81 452.86C719.301 454.354 728.983 448.035 731.436 438.745L780.747 251.966L783.245 242.504L783.985 239.701L369.392 174.414Z\" fill=\"#131316\" />',\n '<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" stroke=\"url(#main)\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M319.847 161.502C310.356 160.007 300.674 166.326 298.221 175.616L138.724 779.758C136.271 789.048 141.977 797.79 151.468 799.285L740.061 891.973C749.553 893.467 759.235 887.148 761.687 877.858L902.405 344.854L889.158 342.768L898.872 305.972L912.119 308.059L913.733 301.946C914.837 297.762 914.309 293.476 912.251 289.927L893.484 257.569C891.153 253.549 887.063 250.823 882.221 250.061L828.205 241.554C822.224 240.613 815.869 242.783 811.427 247.284L805.686 253.103C804.205 254.603 802.087 255.326 800.093 255.013L783.611 252.417L734.3 439.196C731.439 450.035 720.143 457.407 709.07 455.663L328.847 395.788C317.774 394.045 311.117 383.845 313.978 373.007L366.528 173.962L366.533 173.941C367.234 171.24 365.572 168.702 362.81 168.267L319.847 161.502ZM369.392 174.414L368.652 177.217L316.843 373.458C314.39 382.748 320.096 391.49 329.587 392.985L709.81 452.86C719.301 454.354 728.983 448.035 731.436 438.745L780.747 251.966L783.245 242.504L783.985 239.701L369.392 174.414Z\" fill=\"url(#diskette-gradient)\" fill-opacity=\"0.2\" />',\n // arrows\n '<path d=\"M335.38 208.113C335.922 208.198 336.417 207.686 336.283 207.179L330.39 184.795C330.249 184.261 329.529 184.148 329.129 184.597L312.358 203.411C311.978 203.838 312.174 204.458 312.716 204.544L317.962 205.37C318.357 205.432 318.595 205.796 318.493 206.183L314.7 220.551C314.597 220.938 314.835 221.302 315.231 221.364L324.539 222.83C324.935 222.893 325.338 222.629 325.44 222.242L329.233 207.875C329.336 207.488 329.739 207.224 330.135 207.286L335.38 208.113Z\" fill=\"url(#main)\" />',\n '<path d=\"M319.282 269.087C319.824 269.173 320.319 268.661 320.186 268.154L314.292 245.77C314.151 245.236 313.431 245.123 313.031 245.572L296.261 264.386C295.88 264.812 296.076 265.433 296.618 265.518L301.864 266.344C302.259 266.407 302.497 266.771 302.395 267.158L298.602 281.526C298.5 281.913 298.737 282.277 299.133 282.339L308.441 283.805C308.837 283.867 309.24 283.604 309.343 283.217L313.136 268.849C313.238 268.462 313.641 268.199 314.037 268.261L319.282 269.087Z\" fill=\"black\" fill-opacity=\"0.5\" />',\n '<path d=\"M303.184 330.062C303.726 330.148 304.221 329.636 304.088 329.128L298.194 306.745C298.053 306.211 297.333 306.098 296.933 306.547L280.163 325.361C279.782 325.787 279.979 326.408 280.52 326.493L285.766 327.319C286.161 327.382 286.399 327.746 286.297 328.133L282.504 342.501C282.402 342.888 282.639 343.252 283.035 343.314L292.344 344.78C292.739 344.842 293.142 344.579 293.245 344.192L297.038 329.824C297.14 329.437 297.543 329.174 297.939 329.236L303.184 330.062Z\" fill=\"black\" fill-opacity=\"0.5\" />',\n // body\n '<path stroke=\"url(#main)\" stroke-width=\"6\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M290.109 463.418C292.358 454.902 301.233 449.11 309.933 450.48L771.07 523.096C779.77 524.467 785 532.48 782.752 540.996L692.086 884.418L199.443 806.84L290.109 463.418Z\" fill=\"black\" fill-opacity=\"0.14\" />',\n // slider\n '<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" stroke=\"url(#main)\" stroke-width=\"6\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M787.589 237.349L460.354 185.818L406.325 390.469C403.872 399.759 409.578 408.501 419.069 409.996L711.934 456.114C721.425 457.609 731.107 451.29 733.56 442L787.589 237.349ZM660.269 245.01C655.523 244.263 650.682 247.423 649.456 252.068L607.386 411.418C606.16 416.063 609.013 420.434 613.759 421.181L682.499 432.006C687.245 432.753 692.086 429.594 693.312 424.949L735.382 265.599C736.608 260.954 733.755 256.583 729.01 255.835L660.269 245.01Z\" fill=\"url(#main)\" />',\n // fleek logo\n '<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M864.643 283.937C865.186 283.605 865.708 284.257 865.239 284.683L844.268 303.719C843.938 304.018 844.093 304.517 844.526 304.548L853.726 305.207C854.184 305.24 854.321 305.787 853.942 306.071L833.884 321.112C833.506 321.396 833.643 321.943 834.101 321.976L844.007 322.685C844.491 322.72 844.605 323.319 844.177 323.58L797.752 351.954C797.209 352.286 796.687 351.634 797.156 351.209L818.403 331.922C818.733 331.622 818.577 331.123 818.145 331.092L808.748 330.42C808.292 330.387 808.154 329.843 808.529 329.558L828.054 314.744C828.43 314.459 828.291 313.915 827.835 313.882L818.389 313.206C817.904 313.171 817.79 312.572 818.218 312.311L864.643 283.937Z\" fill=\"white\" />',\n // text\n '<g transform=\"matrix(0.987827 0.155557 -0.255261 0.966872 250 735)\"><text font-family=\"Inter, sans-serif\" font-weight=\"bold\" font-size=\"42\" fill=\"#E5E7F8\">',\n name,\n '</text><text font-family=\"Inter, sans-serif\" font-weight=\"normal\" y=\"40\" font-size=\"22\" fill=\"#7F8192\">',\n ENS,\n \"</text></g>\",\n // logo\n '<image width=\"167\" height=\"167\" transform=\"matrix(0.987827 0.155557 -0.255261 0.966872 444.117 524.17)\" href=\"',\n logo,\n '\" />',\n // defs\n \"<defs>\",\n // shadow\n '<filter id=\"diskette-shadow\" x=\"70.7489\" y=\"195.712\" width=\"955.733\" height=\"832.558\" filterUnits=\"userSpaceOnUse\" color-interpolation-filters=\"sRGB\"><feFlood flood-opacity=\"0\" /><feBlend in=\"SourceGraphic\" /><feGaussianBlur stdDeviation=\"42\" /></filter>',\n // bg\n '<linearGradient id=\"background\" x1=\"532.5\" y1=\"0\" x2=\"532.5\" y2=\"1065\" gradientUnits=\"userSpaceOnUse\"><stop /><stop offset=\"1\" stop-color=\"#131313\" /></linearGradient>',\n '<radialGradient id=\"background-radial\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(532.5 532.5) rotate(89.961) scale(735)\"><stop stop-color=\"',\n color,\n '\" /><stop offset=\"1\" stop-color=\"',\n color,\n '\" stop-opacity=\"0\" /></radialGradient>',\n // fill gradient\n '<linearGradient id=\"diskette-gradient\" x1=\"925.626\" y1=\"256.896\" x2=\"136.779\" y2=\"800.203\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"',\n color,\n '\" /><stop offset=\"1\" stop-color=\"#2C313F\" /></linearGradient>',\n // color\n '<linearGradient id=\"main\"><stop stop-color=\"',\n color,\n '\" /></linearGradient>',\n // end defs\n \"</defs>\",\n \"</svg>\"\n )\n )\n )\n )\n );\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200,
"details": {
"yul": true
}
},
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"metadata",
"storageLayout"
],
"": [
"ast"
]
}
}
}
}