refactor contract w/ structs

main
lza_menace 3 years ago
parent 0f399395d0
commit adacab1df7

File diff suppressed because one or more lines are too long

@ -0,0 +1,508 @@
{
"contractName": "Context",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Provides information about the current execution context, including the sender of the transaction and its data. While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned). This contract is only required for intermediate, library-like contracts.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/Context.sol\":\"Context\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6df0ddf21ce9f58271bdfaa85cde98b200ef242a05a3f85c2bc10a8294800a92\",\"dweb:/ipfs/QmRK2Y5Yc6BK7tGKkgsgn3aJEQGi5aakeSPZvS65PV8Xp3\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\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 Context {\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",
"sourcePath": "@openzeppelin/contracts/utils/Context.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts/utils/Context.sol",
"exportedSymbols": {
"Context": [
1543
]
},
"id": 1544,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1523,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "86:23:7"
},
{
"abstract": true,
"baseContracts": [],
"canonicalName": "Context",
"contractDependencies": [],
"contractKind": "contract",
"documentation": {
"id": 1524,
"nodeType": "StructuredDocumentation",
"src": "111:496:7",
"text": " @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 This contract is only required for intermediate, library-like contracts."
},
"fullyImplemented": true,
"id": 1543,
"linearizedBaseContracts": [
1543
],
"name": "Context",
"nameLocation": "626:7:7",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 1532,
"nodeType": "Block",
"src": "702:34:7",
"statements": [
{
"expression": {
"expression": {
"id": 1529,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967281,
"src": "719:3:7",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1530,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"src": "719:10:7",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1528,
"id": 1531,
"nodeType": "Return",
"src": "712:17:7"
}
]
},
"id": 1533,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_msgSender",
"nameLocation": "649:10:7",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1525,
"nodeType": "ParameterList",
"parameters": [],
"src": "659:2:7"
},
"returnParameters": {
"id": 1528,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1527,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1533,
"src": "693:7:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1526,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "693:7:7",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "692:9:7"
},
"scope": 1543,
"src": "640:96:7",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
},
{
"body": {
"id": 1541,
"nodeType": "Block",
"src": "809:32:7",
"statements": [
{
"expression": {
"expression": {
"id": 1538,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967281,
"src": "826:3:7",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "data",
"nodeType": "MemberAccess",
"src": "826:8:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
},
"functionReturnParameters": 1537,
"id": 1540,
"nodeType": "Return",
"src": "819:15:7"
}
]
},
"id": 1542,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_msgData",
"nameLocation": "751:8:7",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1534,
"nodeType": "ParameterList",
"parameters": [],
"src": "759:2:7"
},
"returnParameters": {
"id": 1537,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1536,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1542,
"src": "793:14:7",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1535,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "793:5:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "792:16:7"
},
"scope": 1543,
"src": "742:99:7",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
}
],
"scope": 1544,
"src": "608:235:7",
"usedErrors": []
}
],
"src": "86:758:7"
},
"legacyAST": {
"absolutePath": "@openzeppelin/contracts/utils/Context.sol",
"exportedSymbols": {
"Context": [
1543
]
},
"id": 1544,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1523,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "86:23:7"
},
{
"abstract": true,
"baseContracts": [],
"canonicalName": "Context",
"contractDependencies": [],
"contractKind": "contract",
"documentation": {
"id": 1524,
"nodeType": "StructuredDocumentation",
"src": "111:496:7",
"text": " @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 This contract is only required for intermediate, library-like contracts."
},
"fullyImplemented": true,
"id": 1543,
"linearizedBaseContracts": [
1543
],
"name": "Context",
"nameLocation": "626:7:7",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 1532,
"nodeType": "Block",
"src": "702:34:7",
"statements": [
{
"expression": {
"expression": {
"id": 1529,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967281,
"src": "719:3:7",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1530,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"src": "719:10:7",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 1528,
"id": 1531,
"nodeType": "Return",
"src": "712:17:7"
}
]
},
"id": 1533,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_msgSender",
"nameLocation": "649:10:7",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1525,
"nodeType": "ParameterList",
"parameters": [],
"src": "659:2:7"
},
"returnParameters": {
"id": 1528,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1527,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1533,
"src": "693:7:7",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1526,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "693:7:7",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "692:9:7"
},
"scope": 1543,
"src": "640:96:7",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
},
{
"body": {
"id": 1541,
"nodeType": "Block",
"src": "809:32:7",
"statements": [
{
"expression": {
"expression": {
"id": 1538,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967281,
"src": "826:3:7",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 1539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "data",
"nodeType": "MemberAccess",
"src": "826:8:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
},
"functionReturnParameters": 1537,
"id": 1540,
"nodeType": "Return",
"src": "819:15:7"
}
]
},
"id": 1542,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_msgData",
"nameLocation": "751:8:7",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1534,
"nodeType": "ParameterList",
"parameters": [],
"src": "759:2:7"
},
"returnParameters": {
"id": 1537,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1536,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1542,
"src": "793:14:7",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1535,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "793:5:7",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "792:16:7"
},
"scope": 1543,
"src": "742:99:7",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
}
],
"scope": 1544,
"src": "608:235:7",
"usedErrors": []
}
],
"src": "86:758:7"
},
"compiler": {
"name": "solc",
"version": "0.8.11+commit.d7f03943.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.4",
"updatedAt": "2021-12-29T22:14:28.599Z",
"devdoc": {
"details": "Provides information about the current execution context, including the sender of the transaction and its data. While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned). This contract is only required for intermediate, library-like contracts.",
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,622 @@
{
"contractName": "ERC165",
"abi": [
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Implementation of the {IERC165} interface. Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check for the additional interface id that will be supported. For example: ```solidity function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); } ``` Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\",\"kind\":\"dev\",\"methods\":{\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":\"ERC165\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fb0048dee081f6fffa5f74afc3fb328483c2a30504e94a0ddd2a5114d731ec4d\",\"dweb:/ipfs/QmZptt1nmYoA5SgjwnSgWqgUSDgm4q52Yos3xhnMv3MV43\"]},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://be161e54f24e5c6fae81a12db1a8ae87bc5ae1b0ddc805d82a1440a68455088f\",\"dweb:/ipfs/QmP7C3CHdY9urF4dEMb9wmsp1wMxHF6nhA2yQE5SKiPAdy\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.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 ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n",
"sourcePath": "@openzeppelin/contracts/utils/introspection/ERC165.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts/utils/introspection/ERC165.sol",
"exportedSymbols": {
"ERC165": [
1844
],
"IERC165": [
1856
]
},
"id": 1845,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1822,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "99:23:10"
},
{
"absolutePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol",
"file": "./IERC165.sol",
"id": 1823,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 1845,
"sourceUnit": 1857,
"src": "124:23:10",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": true,
"baseContracts": [
{
"baseName": {
"id": 1825,
"name": "IERC165",
"nodeType": "IdentifierPath",
"referencedDeclaration": 1856,
"src": "754:7:10"
},
"id": 1826,
"nodeType": "InheritanceSpecifier",
"src": "754:7:10"
}
],
"canonicalName": "ERC165",
"contractDependencies": [],
"contractKind": "contract",
"documentation": {
"id": 1824,
"nodeType": "StructuredDocumentation",
"src": "149:576:10",
"text": " @dev Implementation of the {IERC165} interface.\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 ```solidity\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n }\n ```\n Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation."
},
"fullyImplemented": true,
"id": 1844,
"linearizedBaseContracts": [
1844,
1856
],
"name": "ERC165",
"nameLocation": "744:6:10",
"nodeType": "ContractDefinition",
"nodes": [
{
"baseFunctions": [
1855
],
"body": {
"id": 1842,
"nodeType": "Block",
"src": "920:64:10",
"statements": [
{
"expression": {
"commonType": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"id": 1840,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 1835,
"name": "interfaceId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1829,
"src": "937:11:10",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"expression": {
"arguments": [
{
"id": 1837,
"name": "IERC165",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1856,
"src": "957:7:10",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC165_$1856_$",
"typeString": "type(contract IERC165)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_type$_t_contract$_IERC165_$1856_$",
"typeString": "type(contract IERC165)"
}
],
"id": 1836,
"name": "type",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967269,
"src": "952:4:10",
"typeDescriptions": {
"typeIdentifier": "t_function_metatype_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1838,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "952:13:10",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_magic_meta_type_t_contract$_IERC165_$1856",
"typeString": "type(contract IERC165)"
}
},
"id": 1839,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "interfaceId",
"nodeType": "MemberAccess",
"src": "952:25:10",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"src": "937:40:10",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1834,
"id": 1841,
"nodeType": "Return",
"src": "930:47:10"
}
]
},
"documentation": {
"id": 1827,
"nodeType": "StructuredDocumentation",
"src": "768:56:10",
"text": " @dev See {IERC165-supportsInterface}."
},
"functionSelector": "01ffc9a7",
"id": 1843,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "supportsInterface",
"nameLocation": "838:17:10",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 1831,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "896:8:10"
},
"parameters": {
"id": 1830,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1829,
"mutability": "mutable",
"name": "interfaceId",
"nameLocation": "863:11:10",
"nodeType": "VariableDeclaration",
"scope": 1843,
"src": "856:18:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1828,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "856:6:10",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "internal"
}
],
"src": "855:20:10"
},
"returnParameters": {
"id": 1834,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1833,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1843,
"src": "914:4:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1832,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "914:4:10",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "913:6:10"
},
"scope": 1844,
"src": "829:155:10",
"stateMutability": "view",
"virtual": true,
"visibility": "public"
}
],
"scope": 1845,
"src": "726:260:10",
"usedErrors": []
}
],
"src": "99:888:10"
},
"legacyAST": {
"absolutePath": "@openzeppelin/contracts/utils/introspection/ERC165.sol",
"exportedSymbols": {
"ERC165": [
1844
],
"IERC165": [
1856
]
},
"id": 1845,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1822,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "99:23:10"
},
{
"absolutePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol",
"file": "./IERC165.sol",
"id": 1823,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 1845,
"sourceUnit": 1857,
"src": "124:23:10",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": true,
"baseContracts": [
{
"baseName": {
"id": 1825,
"name": "IERC165",
"nodeType": "IdentifierPath",
"referencedDeclaration": 1856,
"src": "754:7:10"
},
"id": 1826,
"nodeType": "InheritanceSpecifier",
"src": "754:7:10"
}
],
"canonicalName": "ERC165",
"contractDependencies": [],
"contractKind": "contract",
"documentation": {
"id": 1824,
"nodeType": "StructuredDocumentation",
"src": "149:576:10",
"text": " @dev Implementation of the {IERC165} interface.\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 ```solidity\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n }\n ```\n Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation."
},
"fullyImplemented": true,
"id": 1844,
"linearizedBaseContracts": [
1844,
1856
],
"name": "ERC165",
"nameLocation": "744:6:10",
"nodeType": "ContractDefinition",
"nodes": [
{
"baseFunctions": [
1855
],
"body": {
"id": 1842,
"nodeType": "Block",
"src": "920:64:10",
"statements": [
{
"expression": {
"commonType": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"id": 1840,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 1835,
"name": "interfaceId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1829,
"src": "937:11:10",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"expression": {
"arguments": [
{
"id": 1837,
"name": "IERC165",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1856,
"src": "957:7:10",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC165_$1856_$",
"typeString": "type(contract IERC165)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_type$_t_contract$_IERC165_$1856_$",
"typeString": "type(contract IERC165)"
}
],
"id": 1836,
"name": "type",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967269,
"src": "952:4:10",
"typeDescriptions": {
"typeIdentifier": "t_function_metatype_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 1838,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "952:13:10",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_magic_meta_type_t_contract$_IERC165_$1856",
"typeString": "type(contract IERC165)"
}
},
"id": 1839,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "interfaceId",
"nodeType": "MemberAccess",
"src": "952:25:10",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"src": "937:40:10",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1834,
"id": 1841,
"nodeType": "Return",
"src": "930:47:10"
}
]
},
"documentation": {
"id": 1827,
"nodeType": "StructuredDocumentation",
"src": "768:56:10",
"text": " @dev See {IERC165-supportsInterface}."
},
"functionSelector": "01ffc9a7",
"id": 1843,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "supportsInterface",
"nameLocation": "838:17:10",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 1831,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "896:8:10"
},
"parameters": {
"id": 1830,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1829,
"mutability": "mutable",
"name": "interfaceId",
"nameLocation": "863:11:10",
"nodeType": "VariableDeclaration",
"scope": 1843,
"src": "856:18:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1828,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "856:6:10",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "internal"
}
],
"src": "855:20:10"
},
"returnParameters": {
"id": 1834,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1833,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1843,
"src": "914:4:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1832,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "914:4:10",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "913:6:10"
},
"scope": 1844,
"src": "829:155:10",
"stateMutability": "view",
"virtual": true,
"visibility": "public"
}
],
"scope": 1845,
"src": "726:260:10",
"usedErrors": []
}
],
"src": "99:888:10"
},
"compiler": {
"name": "solc",
"version": "0.8.11+commit.d7f03943.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.4",
"updatedAt": "2021-12-29T22:14:28.601Z",
"devdoc": {
"details": "Implementation of the {IERC165} interface. Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check for the additional interface id that will be supported. For example: ```solidity function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); } ``` Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.",
"kind": "dev",
"methods": {
"supportsInterface(bytes4)": {
"details": "See {IERC165-supportsInterface}."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,336 @@
{
"contractName": "IERC165",
"abi": [
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.\",\"kind\":\"dev\",\"methods\":{\"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.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":\"IERC165\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://be161e54f24e5c6fae81a12db1a8ae87bc5ae1b0ddc805d82a1440a68455088f\",\"dweb:/ipfs/QmP7C3CHdY9urF4dEMb9wmsp1wMxHF6nhA2yQE5SKiPAdy\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "",
"deployedSourceMap": "",
"source": "// 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",
"sourcePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol",
"exportedSymbols": {
"IERC165": [
1856
]
},
"id": 1857,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1846,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "100:23:11"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "IERC165",
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 1847,
"nodeType": "StructuredDocumentation",
"src": "125:279:11",
"text": " @dev Interface of the ERC165 standard, as defined in the\n https://eips.ethereum.org/EIPS/eip-165[EIP].\n Implementers can declare support of contract interfaces, which can then be\n queried by others ({ERC165Checker}).\n For an implementation, see {ERC165}."
},
"fullyImplemented": false,
"id": 1856,
"linearizedBaseContracts": [
1856
],
"name": "IERC165",
"nameLocation": "415:7:11",
"nodeType": "ContractDefinition",
"nodes": [
{
"documentation": {
"id": 1848,
"nodeType": "StructuredDocumentation",
"src": "429:340:11",
"text": " @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 This function call must use less than 30 000 gas."
},
"functionSelector": "01ffc9a7",
"id": 1855,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "supportsInterface",
"nameLocation": "783:17:11",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1851,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1850,
"mutability": "mutable",
"name": "interfaceId",
"nameLocation": "808:11:11",
"nodeType": "VariableDeclaration",
"scope": 1855,
"src": "801:18:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1849,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "801:6:11",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "internal"
}
],
"src": "800:20:11"
},
"returnParameters": {
"id": 1854,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1853,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1855,
"src": "844:4:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1852,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "844:4:11",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "843:6:11"
},
"scope": 1856,
"src": "774:76:11",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1857,
"src": "405:447:11",
"usedErrors": []
}
],
"src": "100:753:11"
},
"legacyAST": {
"absolutePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol",
"exportedSymbols": {
"IERC165": [
1856
]
},
"id": 1857,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1846,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "100:23:11"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "IERC165",
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 1847,
"nodeType": "StructuredDocumentation",
"src": "125:279:11",
"text": " @dev Interface of the ERC165 standard, as defined in the\n https://eips.ethereum.org/EIPS/eip-165[EIP].\n Implementers can declare support of contract interfaces, which can then be\n queried by others ({ERC165Checker}).\n For an implementation, see {ERC165}."
},
"fullyImplemented": false,
"id": 1856,
"linearizedBaseContracts": [
1856
],
"name": "IERC165",
"nameLocation": "415:7:11",
"nodeType": "ContractDefinition",
"nodes": [
{
"documentation": {
"id": 1848,
"nodeType": "StructuredDocumentation",
"src": "429:340:11",
"text": " @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 This function call must use less than 30 000 gas."
},
"functionSelector": "01ffc9a7",
"id": 1855,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "supportsInterface",
"nameLocation": "783:17:11",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1851,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1850,
"mutability": "mutable",
"name": "interfaceId",
"nameLocation": "808:11:11",
"nodeType": "VariableDeclaration",
"scope": 1855,
"src": "801:18:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1849,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "801:6:11",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "internal"
}
],
"src": "800:20:11"
},
"returnParameters": {
"id": 1854,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1853,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1855,
"src": "844:4:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1852,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "844:4:11",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "843:6:11"
},
"scope": 1856,
"src": "774:76:11",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1857,
"src": "405:447:11",
"usedErrors": []
}
],
"src": "100:753:11"
},
"compiler": {
"name": "solc",
"version": "0.8.11+commit.d7f03943.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.4",
"updatedAt": "2021-12-29T22:14:28.602Z",
"devdoc": {
"details": "Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.",
"kind": "dev",
"methods": {
"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."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,518 @@
{
"contractName": "IERC721Receiver",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "onERC721Received",
"outputs": [
{
"internalType": "bytes4",
"name": "",
"type": "bytes4"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface for any contract that wants to support safeTransfers from ERC721 asset contracts.\",\"kind\":\"dev\",\"methods\":{\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} by `operator` from `from`, this function is called. It must return its Solidity selector to confirm the token transfer. If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\"}},\"title\":\"ERC721 token receiver interface\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":\"IERC721Receiver\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"keccak256\":\"0xd5fa74b4fb323776fa4a8158800fec9d5ac0fec0d6dd046dd93798632ada265f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://33017a30a99cc5411a9e376622c31fc4a55cfc6a335e2f57f00cbf24a817ff3f\",\"dweb:/ipfs/QmWNQtWTPhA7Lo8nbxbc8KFMvZwbFYB8fSeEQ3vuapSV4a\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "",
"deployedSourceMap": "",
"source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (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 IERC721Receiver {\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 `IERC721.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",
"sourcePath": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol",
"exportedSymbols": {
"IERC721Receiver": [
1069
]
},
"id": 1070,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1053,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "101:23:3"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "IERC721Receiver",
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 1054,
"nodeType": "StructuredDocumentation",
"src": "126:152:3",
"text": " @title ERC721 token receiver interface\n @dev Interface for any contract that wants to support safeTransfers\n from ERC721 asset contracts."
},
"fullyImplemented": false,
"id": 1069,
"linearizedBaseContracts": [
1069
],
"name": "IERC721Receiver",
"nameLocation": "289:15:3",
"nodeType": "ContractDefinition",
"nodes": [
{
"documentation": {
"id": 1055,
"nodeType": "StructuredDocumentation",
"src": "311:485:3",
"text": " @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n by `operator` from `from`, this function is called.\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 The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`."
},
"functionSelector": "150b7a02",
"id": 1068,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "onERC721Received",
"nameLocation": "810:16:3",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1064,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1057,
"mutability": "mutable",
"name": "operator",
"nameLocation": "844:8:3",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "836:16:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1056,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "836:7:3",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 1059,
"mutability": "mutable",
"name": "from",
"nameLocation": "870:4:3",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "862:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1058,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "862:7:3",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 1061,
"mutability": "mutable",
"name": "tokenId",
"nameLocation": "892:7:3",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "884:15:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1060,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "884:7:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 1063,
"mutability": "mutable",
"name": "data",
"nameLocation": "924:4:3",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "909:19:3",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1062,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "909:5:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "826:108:3"
},
"returnParameters": {
"id": 1067,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1066,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "953:6:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1065,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "953:6:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "internal"
}
],
"src": "952:8:3"
},
"scope": 1069,
"src": "801:160:3",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 1070,
"src": "279:684:3",
"usedErrors": []
}
],
"src": "101:863:3"
},
"legacyAST": {
"absolutePath": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol",
"exportedSymbols": {
"IERC721Receiver": [
1069
]
},
"id": 1070,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1053,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "101:23:3"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "IERC721Receiver",
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 1054,
"nodeType": "StructuredDocumentation",
"src": "126:152:3",
"text": " @title ERC721 token receiver interface\n @dev Interface for any contract that wants to support safeTransfers\n from ERC721 asset contracts."
},
"fullyImplemented": false,
"id": 1069,
"linearizedBaseContracts": [
1069
],
"name": "IERC721Receiver",
"nameLocation": "289:15:3",
"nodeType": "ContractDefinition",
"nodes": [
{
"documentation": {
"id": 1055,
"nodeType": "StructuredDocumentation",
"src": "311:485:3",
"text": " @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n by `operator` from `from`, this function is called.\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 The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`."
},
"functionSelector": "150b7a02",
"id": 1068,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "onERC721Received",
"nameLocation": "810:16:3",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1064,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1057,
"mutability": "mutable",
"name": "operator",
"nameLocation": "844:8:3",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "836:16:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1056,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "836:7:3",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 1059,
"mutability": "mutable",
"name": "from",
"nameLocation": "870:4:3",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "862:12:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1058,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "862:7:3",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 1061,
"mutability": "mutable",
"name": "tokenId",
"nameLocation": "892:7:3",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "884:15:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1060,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "884:7:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 1063,
"mutability": "mutable",
"name": "data",
"nameLocation": "924:4:3",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "909:19:3",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 1062,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "909:5:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "826:108:3"
},
"returnParameters": {
"id": 1067,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1066,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 1068,
"src": "953:6:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1065,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "953:6:3",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"visibility": "internal"
}
],
"src": "952:8:3"
},
"scope": 1069,
"src": "801:160:3",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 1070,
"src": "279:684:3",
"usedErrors": []
}
],
"src": "101:863:3"
},
"compiler": {
"name": "solc",
"version": "0.8.11+commit.d7f03943.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.4",
"updatedAt": "2021-12-29T22:14:28.596Z",
"devdoc": {
"details": "Interface for any contract that wants to support safeTransfers from ERC721 asset contracts.",
"kind": "dev",
"methods": {
"onERC721Received(address,address,uint256,bytes)": {
"details": "Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} by `operator` from `from`, this function is called. It must return its Solidity selector to confirm the token transfer. If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`."
}
},
"title": "ERC721 token receiver interface",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -0,0 +1,173 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract SuchWowX is ERC721, ERC721URIStorage, Ownable {
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Structs to represent our data
struct Meme {
uint256 publisherTipsAVAX;
uint256 creatorTipsAVAX;
uint256 contractTipsAVAX;
address publisherAddress;
address creatorAddress;
string metadataIPFSHash;
}
struct User {
string wowneroAddress;
string userHandle;
string metadataIPFSHash;
uint256 tippedAVAX;
uint256[] memesPublished;
uint256[] memesCreated;
}
// Data to maintain
mapping (uint256 => Meme) public tokenMeme;
mapping (address => User) public userProfile;
mapping (string => uint256) public metadataTokenId;
// Define starting contract state
string public contractCreator = "lzamenace.eth";
string public contractVersion = "v0.1";
uint256 public contractTipCutPercent = 5;
uint256 public publisherTipCutPercent = 5;
constructor() ERC721("SuchWowX", "SWX") {}
/************
Contract Operations
************/
// Withdraw contract balance to creator (mnemonic seed address 0)
function withdraw() public onlyOwner {
uint256 balance = address(this).balance;
payable(msg.sender).transfer(balance);
}
// Specify new contract tip cut (not to exceed 10%)
function setContractTipCut(uint256 percent) public onlyOwner {
require(percent <= 10, "Contract tip cut cannot exceed 10%");
contractTipCutPercent = percent;
}
// Specify new publisher tip cut (not to exceed 10%)
function setPublisherTipCut(uint256 percent) public onlyOwner {
require(percent <= 10, "Publisher tip cut cannot exceed 10%");
publisherTipCutPercent = percent;
}
// Get total supply based upon counter
function totalSupply() public view returns (uint256) {
return _tokenSupply.current();
}
/************
User Settings
************/
// Specify new Wownero address for user
function setUserWowneroAddress(string memory wowneroAddress) external {
require(bytes(wowneroAddress).length > 0, "Wownero address must be provided.");
userProfile[msg.sender].wowneroAddress = wowneroAddress;
}
// Specify new handle for user
function setUserHandle(string memory handle) external {
require(bytes(handle).length > 0, "Handle must be provided.");
userProfile[msg.sender].userHandle = handle;
}
// Specify new profile metadata IPFS hash for user
function setUserMetadata(string memory metadataIPFSHash) external {
require(bytes(metadataIPFSHash).length > 0, "Metadata IPFS hash must be provided.");
userProfile[msg.sender].metadataIPFSHash = metadataIPFSHash;
}
/************
Minting
************/
// Mint a new token with a specific metadata hash location
function mint(string memory metadataIPFSHash, address creatorAddress) external {
require(bytes(metadataIPFSHash).length > 0, "Metadata IPFS hash cannot be empty.");
require(metadataTokenId[metadataIPFSHash] == 0, "That metadata IPFS hash has already been referenced.");
uint256 tokenId = totalSupply() + 1; // Start at 1
_safeMint(msg.sender, tokenId);
_tokenSupply.increment();
// track metadata IPFS hashes to be unique to each token ID
metadataTokenId[metadataIPFSHash] = tokenId;
// publisher details - track memes published for minter
userProfile[msg.sender].memesPublished.push(tokenId);
// creator details - track memes created for memer
userProfile[creatorAddress].memesCreated.push(tokenId);
// track meme details per token ID
tokenMeme[tokenId] = Meme({
publisherAddress: msg.sender,
creatorAddress: creatorAddress,
metadataIPFSHash: metadataIPFSHash,
publisherTipsAVAX: 0,
creatorTipsAVAX: 0,
contractTipsAVAX: 0
});
}
/************
Tipping
************/
// Tip a token and it's creator
function tipAVAX(uint256 tokenId) public payable {
require(tokenId <= totalSupply(), "Cannot tip non-existent token.");
// Calculate tip amounts based upon stored cut percentages
uint256 hundo = 100;
uint256 contractTipAmount = msg.value.div(hundo.div(contractTipCutPercent));
uint256 publisherTipAmount = msg.value.div(hundo.div(publisherTipCutPercent));
uint256 creatorTipAmount = msg.value.sub(contractTipAmount.add(publisherTipAmount));
// Store addresses to use
address creator = tokenMeme[tokenId].creatorAddress;
address publisher = tokenMeme[tokenId].publisherAddress;
address _contract_ = address(this);
// Store tip amounts for sender and recipients to the chain
userProfile[msg.sender].tippedAVAX = userProfile[msg.sender].tippedAVAX.add(msg.value);
tokenMeme[tokenId].creatorTipsAVAX = tokenMeme[tokenId].creatorTipsAVAX.add(creatorTipAmount);
tokenMeme[tokenId].publisherTipsAVAX = tokenMeme[tokenId].publisherTipsAVAX.add(publisherTipAmount);
tokenMeme[tokenId].contractTipsAVAX = tokenMeme[tokenId].contractTipsAVAX.add(contractTipAmount);
// Send transactions
payable(creator).transfer(creatorTipAmount);
payable(publisher).transfer(publisherTipAmount);
payable(_contract_).transfer(contractTipAmount);
}
/************
Overrides
************/
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
// Each token should return a unique IPFS hash
return string(abi.encodePacked("ipfs://", tokenMeme[tokenId].metadataIPFSHash));
}
function _burn(uint256 tokenId)
internal
override(ERC721, ERC721URIStorage)
{
// Prevent burning
}
}

@ -1,89 +0,0 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract SuchwowX is ERC721, ERC721URIStorage, Ownable {
using SafeMath for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenSupply;
// Data to maintain
mapping (uint256 => address) public tokenCreator;
mapping (uint256 => string) public tokenMetadata;
mapping (uint256 => uint256) public tokenTips;
mapping (address => uint256) public creatorTips;
mapping (address => uint256) public creatorTokensMinted;
mapping (address => uint256) public tipperTips;
mapping (string => uint256) public metadataTokenId;
mapping (address => string) public creatorWowneroAddress;
// Define starting contract state
string public contractCreator = "lzamenace.eth";
string public contractVersion = "v0.1";
constructor() ERC721("SuchwowX", "SWX") {}
// Withdraw contract balance to creator (mnemonic seed address 0)
function withdraw() public onlyOwner {
uint256 balance = address(this).balance;
payable(msg.sender).transfer(balance);
}
// Get total supply based upon counter
function totalSupply() public view returns (uint256) {
return _tokenSupply.current();
}
// Specify new Wownero address
function setWowneroAddress(string memory wowneroAddress) external {
require(bytes(wowneroAddress).length > 0, "Wownero address must be provided.");
creatorWowneroAddress[msg.sender] = wowneroAddress;
}
// Mint a new token with a specific metadata hash location
function mint(string memory metadataIPFSHash) external {
require(bytes(metadataIPFSHash).length > 0, "Metadata IPFS hash cannot be empty.");
require(metadataTokenId[metadataIPFSHash] == 0, "That metadata IPFS hash has already been referenced.");
uint256 tokenId = totalSupply() + 1; // Start at 1
_safeMint(msg.sender, tokenId);
_tokenSupply.increment();
tokenCreator[tokenId] = msg.sender;
tokenMetadata[tokenId] = metadataIPFSHash;
creatorTokensMinted[msg.sender] = creatorTokensMinted[msg.sender].add(1);
}
// Tip a token and it's creator
function tip(uint256 tokenId) public payable {
require(tokenId <= totalSupply(), "Cannot tip non-existent token.");
address creator = tokenCreator[tokenId];
tokenTips[tokenId] = tokenTips[tokenId].add(msg.value);
creatorTips[creator] = creatorTips[creator].add(msg.value);
tipperTips[creator] = tipperTips[creator].add(msg.value);
payable(creator).transfer(msg.value);
}
// Override the below functions from parent contracts
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
// Each token should return a unique IPFS hash
return string(abi.encodePacked("ipfs://", tokenMetadata[tokenId]));
}
function _burn(uint256 tokenId)
internal
override(ERC721, ERC721URIStorage)
{
// Prevent burning
}
}

@ -1,2 +1,2 @@
INFURA_PID=xxxxxxxxxxxxxxxxxxxx
MNEMONIC=this should be your twelve word seed
SNOWTRACE_API=xxxxxxxxxxx

@ -1,5 +1,5 @@
var SuchwowX = artifacts.require("SuchwowX");
var SuchWowX = artifacts.require("SuchWowX");
module.exports = function(deployer) {
deployer.deploy(SuchwowX);
deployer.deploy(SuchWowX);
};

@ -1,7 +1,7 @@
{
"name": "suchwowx-smart-contract",
"version": "1.0.0",
"description": "Smart contract for the SuchwowX interplanetary meme project.",
"description": "Smart contract for the SuchWowX interplanetary meme project.",
"main": "index.js",
"scripts": {
"test": "truffle test"
@ -18,11 +18,11 @@
"homepage": "https://github.com/lalanza808/suchwowx-smart-contract",
"dependencies": {
"@openzeppelin/contracts": "^4.3.3",
"@truffle/hdwallet-provider": "^2.0.0",
"dotenv": "^10.0.0",
"ganache-cli": "^6.12.2",
"truffle": "^5.4.19",
"truffle-hdwallet-provider": "^1.0.17",
"truffle-plugin-verify": "^0.5.18",
"truffle": "^5.4.26",
"truffle-plugin-verify": "^0.5.20",
"web3": "^1.6.1"
},
"engines": {

@ -1,36 +1,38 @@
require('dotenv').config();
const HDWalletProvider = require('truffle-hdwallet-provider');
const HDWalletProvider = require('@truffle/hdwallet-provider');
module.exports = {
networks: {
development: {
local: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
},
rinkeby: {
provider: () => new HDWalletProvider(process.env.MNEMONIC, "https://rinkeby.infura.io/v3/" + process.env.INFURA_PID),
network_id: 4,
testnet: {
provider: () => new HDWalletProvider({
mnemonic: process.env.MNEMONIC,
providerOrUrl: "https://api.avax-test.network/ext/bc/C/rpc",
chainId: '43113',
addressIndex: 0
}),
network_id: "*",
confirmations: 1,
timeoutBlocks: 10,
skipDryRun: true,
production: false,
},
mainnet: {
provider: () => new HDWalletProvider(process.env.MNEMONIC, "https://mainnet.infura.io/v3/" + process.env.INFURA_PID),
network_id: 1,
provider: () => new HDWalletProvider({
mnemonic: process.env.MNEMONIC,
providerOrUrl: "https://api.avax.network/ext/bc/C/rpc",
chainId: '43114',
addressIndex: 0
}),
network_id: "*",
confirmations: 3,
timeoutBlocks: 30,
skipDryRun: false,
production: true,
gasPrice: 150000000000 // 150 gwei
},
},
mocha: {
reporter: "eth-gas-reporter",
reporterOptions: {
currency: "USD",
gasPrice: 2,
},
},
compilers: {
@ -48,6 +50,6 @@ module.exports = {
'truffle-plugin-verify'
],
api_keys: {
'etherscan': process.env.ETHERSCAN_API
'snowtrace': process.env.SNOWTRACE_API
}
};

Loading…
Cancel
Save