UNPKG

@etherisc/gif-contracts

Version:

This repository holds the GIF core contracts and tools to develop, test and deploy GIF instances.

1,030 lines 32.5 kB
{ "abi": [ { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "LogBundleTokenBurned", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "tokenOwner", "type": "address" } ], "name": "LogBundleTokenMinted", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "balance", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "burned", "outputs": [ { "internalType": "bool", "name": "isBurned", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "exists", "outputs": [ { "internalType": "bool", "name": "doesExist", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "operator", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getBundleId", "outputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "operator", "type": "address" }, { "internalType": "bool", "name": "_approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "tokenCount", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "allSourcePaths": { "18": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/IERC721.sol", "26": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/introspection/IERC165.sol", "53": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/tokens/IBundleToken.sol" }, "ast": { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/tokens/IBundleToken.sol", "exportedSymbols": { "IBundleToken": [ 24052 ], "IERC165": [ 27203 ], "IERC721": [ 23745 ] }, "id": 24053, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 24008, "literals": [ "solidity", "0.8", ".2" ], "nodeType": "PragmaDirective", "src": "39:22:53" }, { "absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/IERC721.sol", "file": "@openzeppelin/contracts/token/ERC721/IERC721.sol", "id": 24009, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 24053, "sourceUnit": 23746, "src": "63:58:53", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [ { "baseName": { "id": 24010, "name": "IERC721", "nodeType": "IdentifierPath", "referencedDeclaration": 23745, "src": "153:7:53" }, "id": 24011, "nodeType": "InheritanceSpecifier", "src": "153:7:53" } ], "contractDependencies": [ 23745, 27203 ], "contractKind": "interface", "fullyImplemented": false, "id": 24052, "linearizedBaseContracts": [ 24052, 23745, 27203 ], "name": "IBundleToken", "nameLocation": "133:12:53", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "id": 24019, "name": "LogBundleTokenMinted", "nameLocation": "173:20:53", "nodeType": "EventDefinition", "parameters": { "id": 24018, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24013, "indexed": false, "mutability": "mutable", "name": "bundleId", "nameLocation": "202:8:53", "nodeType": "VariableDeclaration", "scope": 24019, "src": "194:16:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24012, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "194:7:53", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 24015, "indexed": false, "mutability": "mutable", "name": "tokenId", "nameLocation": "220:7:53", "nodeType": "VariableDeclaration", "scope": 24019, "src": "212:15:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24014, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "212:7:53", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 24017, "indexed": false, "mutability": "mutable", "name": "tokenOwner", "nameLocation": "237:10:53", "nodeType": "VariableDeclaration", "scope": 24019, "src": "229:18:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 24016, "name": "address", "nodeType": "ElementaryTypeName", "src": "229:7:53", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "193:55:53" }, "src": "167:82:53" }, { "anonymous": false, "id": 24025, "name": "LogBundleTokenBurned", "nameLocation": "260:20:53", "nodeType": "EventDefinition", "parameters": { "id": 24024, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24021, "indexed": false, "mutability": "mutable", "name": "bundleId", "nameLocation": "289:8:53", "nodeType": "VariableDeclaration", "scope": 24025, "src": "281:16:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24020, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "281:7:53", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 24023, "indexed": false, "mutability": "mutable", "name": "tokenId", "nameLocation": "307:7:53", "nodeType": "VariableDeclaration", "scope": 24025, "src": "299:15:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24022, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "299:7:53", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "280:35:53" }, "src": "254:62:53" }, { "functionSelector": "23250cae", "id": 24032, "implemented": false, "kind": "function", "modifiers": [], "name": "burned", "nameLocation": "334:6:53", "nodeType": "FunctionDefinition", "parameters": { "id": 24028, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24027, "mutability": "mutable", "name": "tokenId", "nameLocation": "346:7:53", "nodeType": "VariableDeclaration", "scope": 24032, "src": "341:12:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24026, "name": "uint", "nodeType": "ElementaryTypeName", "src": "341:4:53", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "340:14:53" }, "returnParameters": { "id": 24031, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24030, "mutability": "mutable", "name": "isBurned", "nameLocation": "382:8:53", "nodeType": "VariableDeclaration", "scope": 24032, "src": "377:13:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 24029, "name": "bool", "nodeType": "ElementaryTypeName", "src": "377:4:53", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "376:15:53" }, "scope": 24052, "src": "325:67:53", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "functionSelector": "4f558e79", "id": 24039, "implemented": false, "kind": "function", "modifiers": [], "name": "exists", "nameLocation": "406:6:53", "nodeType": "FunctionDefinition", "parameters": { "id": 24035, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24034, "mutability": "mutable", "name": "tokenId", "nameLocation": "421:7:53", "nodeType": "VariableDeclaration", "scope": 24039, "src": "413:15:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24033, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "413:7:53", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "412:17:53" }, "returnParameters": { "id": 24038, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24037, "mutability": "mutable", "name": "doesExist", "nameLocation": "457:9:53", "nodeType": "VariableDeclaration", "scope": 24039, "src": "452:14:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 24036, "name": "bool", "nodeType": "ElementaryTypeName", "src": "452:4:53", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "451:16:53" }, "scope": 24052, "src": "397:71:53", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "functionSelector": "29a63083", "id": 24046, "implemented": false, "kind": "function", "modifiers": [], "name": "getBundleId", "nameLocation": "482:11:53", "nodeType": "FunctionDefinition", "parameters": { "id": 24042, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24041, "mutability": "mutable", "name": "tokenId", "nameLocation": "502:7:53", "nodeType": "VariableDeclaration", "scope": 24046, "src": "494:15:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24040, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "494:7:53", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "493:17:53" }, "returnParameters": { "id": 24045, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24044, "mutability": "mutable", "name": "bundleId", "nameLocation": "541:8:53", "nodeType": "VariableDeclaration", "scope": 24046, "src": "533:16:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24043, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "533:7:53", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "532:18:53" }, "scope": 24052, "src": "473:78:53", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "functionSelector": "18160ddd", "id": 24051, "implemented": false, "kind": "function", "modifiers": [], "name": "totalSupply", "nameLocation": "565:11:53", "nodeType": "FunctionDefinition", "parameters": { "id": 24047, "nodeType": "ParameterList", "parameters": [], "src": "576:2:53" }, "returnParameters": { "id": 24050, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24049, "mutability": "mutable", "name": "tokenCount", "nameLocation": "609:10:53", "nodeType": "VariableDeclaration", "scope": 24051, "src": "601:18:53", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24048, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "601:7:53", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "600:20:53" }, "scope": 24052, "src": "556:65:53", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 24053, "src": "123:500:53" } ], "src": "39:585:53" }, "bytecode": "", "bytecodeSha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "compiler": { "evm_version": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "version": "0.8.2+commit.661d1103" }, "contractName": "IBundleToken", "coverageMap": { "branches": {}, "statements": {} }, "dependencies": [ "OpenZeppelin/openzeppelin-contracts@4.7.3/IERC165", "OpenZeppelin/openzeppelin-contracts@4.7.3/IERC721" ], "deployedBytecode": "", "deployedSourceMap": "", "language": "Solidity", "natspec": { "kind": "dev", "methods": { "approve(address,uint256)": { "details": "Gives permission to `to` to transfer `tokenId` token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - The caller must own the token or be an approved operator. - `tokenId` must exist. Emits an {Approval} event." }, "balanceOf(address)": { "details": "Returns the number of tokens in ``owner``'s account." }, "getApproved(uint256)": { "details": "Returns the account approved for `tokenId` token. Requirements: - `tokenId` must exist." }, "isApprovedForAll(address,address)": { "details": "Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}" }, "ownerOf(uint256)": { "details": "Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist." }, "safeTransferFrom(address,address,uint256)": { "details": "Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event." }, "safeTransferFrom(address,address,uint256,bytes)": { "details": "Safely transfers `tokenId` token from `from` to `to`. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event." }, "setApprovalForAll(address,bool)": { "details": "Approve or remove `operator` as an operator for the caller. Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. Requirements: - The `operator` cannot be the caller. Emits an {ApprovalForAll} event." }, "supportsInterface(bytes4)": { "details": "Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas." }, "transferFrom(address,address,uint256)": { "details": "Transfers `tokenId` token from `from` to `to`. WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event." } }, "version": 1 }, "offset": [ 123, 623 ], "opcodes": "", "pcMap": {}, "sha1": "1af4a490e8fc4010a620039ae8fc1e86a9fc1d09", "source": "// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.2;\n\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\n\ninterface IBundleToken is\n IERC721\n{\n event LogBundleTokenMinted(uint256 bundleId, uint256 tokenId, address tokenOwner);\n event LogBundleTokenBurned(uint256 bundleId, uint256 tokenId); \n\n function burned(uint tokenId) external view returns(bool isBurned);\n function exists(uint256 tokenId) external view returns(bool doesExist);\n function getBundleId(uint256 tokenId) external view returns(uint256 bundleId);\n function totalSupply() external view returns(uint256 tokenCount);\n}\n", "sourceMap": "", "sourcePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/tokens/IBundleToken.sol", "type": "interface" }