├── .gitignore ├── LICENSE ├── README.md ├── contracts ├── Migrations.sol └── SmartContract.sol ├── migrations ├── 1_initial_migration.js └── 2_smart_contract_migration.js ├── package.json ├── public ├── assets │ └── meta │ │ ├── data.json │ │ └── data.png ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt ├── src ├── App.css ├── App.js ├── contracts │ ├── Address.json │ ├── Context.json │ ├── Counters.json │ ├── ERC165.json │ ├── ERC721.json │ ├── IERC165.json │ ├── IERC721.json │ ├── IERC721Metadata.json │ ├── IERC721Receiver.json │ ├── Migrations.json │ ├── MyNFT.json │ ├── Ownable.json │ ├── SmartContract.json │ └── Strings.json ├── index.js ├── logo.svg ├── redux │ ├── blockchain │ │ ├── blockchainActions.js │ │ └── blockchainReducer.js │ ├── data │ │ ├── dataActions.js │ │ └── dataReducer.js │ └── store.js ├── reportWebVitals.js ├── setupTests.js ├── styles │ ├── globalStyles.js │ ├── reset.css │ └── theme.css └── test.js ├── test └── smartContract.test.js └── truffle-config.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 HashLips 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to HashLips 👄 2 | 3 | All the code in these repos was created and explained by HashLips on the main YouTube channel. 4 | 5 | To find out more please visit: 6 | 7 | [📺 YouTube](https://www.youtube.com/channel/UC1LV4_VQGBJHTJjEWUmy8nA) 8 | 9 | [👄 Discord](https://discord.com/invite/qh6MWhMJDN) 10 | 11 | [💬 Telegram](https://t.me/hashlipsnft) 12 | 13 | [🐦 Twitter](https://twitter.com/hashlipsnft) 14 | 15 | [ℹ️ Website](https://hashlips.online/HashLips) 16 | 17 | # Base Dapp Frontend Layout 18 | 19 | A base project to start your dapp from. 20 | -------------------------------------------------------------------------------- /contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.4.22 <0.9.0; 3 | 4 | contract Migrations { 5 | address public owner = msg.sender; 6 | uint public last_completed_migration; 7 | 8 | modifier restricted() { 9 | require( 10 | msg.sender == owner, 11 | "This function is restricted to the contract's owner" 12 | ); 13 | _; 14 | } 15 | 16 | function setCompleted(uint completed) public restricted { 17 | last_completed_migration = completed; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /contracts/SmartContract.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; 6 | import "@openzeppelin/contracts/utils/Counters.sol"; 7 | import "@openzeppelin/contracts/access/Ownable.sol"; 8 | 9 | contract SmartContract is ERC721, Ownable { 10 | using Counters for Counters.Counter; 11 | using Strings for uint256; 12 | Counters.Counter _tokenIds; 13 | mapping(uint256 => string) _tokenURIs; 14 | 15 | struct RenderToken { 16 | uint256 id; 17 | string uri; 18 | } 19 | 20 | constructor() ERC721("Smart Contract", "SC") {} 21 | 22 | function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal { 23 | _tokenURIs[tokenId] = _tokenURI; 24 | } 25 | 26 | function tokenURI(uint256 tokenId) 27 | public 28 | view 29 | virtual 30 | override 31 | returns (string memory) 32 | { 33 | require(_exists(tokenId)); 34 | string memory _tokenURI = _tokenURIs[tokenId]; 35 | return _tokenURI; 36 | } 37 | 38 | function getAllTokens() public view returns (RenderToken[] memory) { 39 | uint256 lastestId = _tokenIds.current(); 40 | uint256 counter = 0; 41 | RenderToken[] memory res = new RenderToken[](lastestId); 42 | for (uint256 i = 0; i < lastestId; i++) { 43 | if (_exists(counter)) { 44 | string memory uri = tokenURI(counter); 45 | res[counter] = RenderToken(counter, uri); 46 | } 47 | counter++; 48 | } 49 | return res; 50 | } 51 | 52 | function mint(address recipient, string memory uri) public returns (uint256) { 53 | uint256 newId = _tokenIds.current(); 54 | _mint(recipient, newId); 55 | _setTokenURI(newId, uri); 56 | _tokenIds.increment(); 57 | return newId; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | const Migrations = artifacts.require("Migrations"); 2 | 3 | module.exports = function (deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /migrations/2_smart_contract_migration.js: -------------------------------------------------------------------------------- 1 | const SmartContract = artifacts.require("SmartContract"); 2 | 3 | module.exports = function (deployer) { 4 | deployer.deploy(SmartContract); 5 | }; 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend_base_dapp", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@openzeppelin/contracts": "^4.2.0", 7 | "@testing-library/jest-dom": "^5.11.4", 8 | "@testing-library/react": "^11.1.0", 9 | "@testing-library/user-event": "^12.1.10", 10 | "all": "^0.0.0", 11 | "chai": "^4.3.4", 12 | "chai-as-promised": "^7.1.1", 13 | "ipfs-http-client": "^52.0.0", 14 | "react": "^17.0.2", 15 | "react-canvas-draw": "^1.1.1", 16 | "react-dom": "^17.0.2", 17 | "react-redux": "^7.2.4", 18 | "react-scripts": "4.0.3", 19 | "react-signature-canvas": "^1.0.3", 20 | "redux": "^4.1.1", 21 | "redux-thunk": "^2.3.0", 22 | "styled-components": "^5.3.0", 23 | "web-vitals": "^1.0.1", 24 | "web3": "^1.5.1" 25 | }, 26 | "scripts": { 27 | "start": "react-scripts start", 28 | "build": "react-scripts build", 29 | "test": "react-scripts test", 30 | "eject": "react-scripts eject" 31 | }, 32 | "eslintConfig": { 33 | "extends": [ 34 | "react-app", 35 | "react-app/jest" 36 | ] 37 | }, 38 | "browserslist": { 39 | "production": [ 40 | ">0.2%", 41 | "not dead", 42 | "not op_mini all" 43 | ], 44 | "development": [ 45 | "last 1 chrome version", 46 | "last 1 firefox version", 47 | "last 1 safari version" 48 | ] 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /public/assets/meta/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SafeLips Game", 3 | "description": "SafeLips is a NFT based game where players can collect HashLips NFTS", 4 | "image": "https://safelips.online/assets/meta/data.png" 5 | } 6 | -------------------------------------------------------------------------------- /public/assets/meta/data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashLips/nft_ipfs_minter/470d4ee59bf08d559bb2a4e5de98fc45b2f7ba6d/public/assets/meta/data.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashLips/nft_ipfs_minter/470d4ee59bf08d559bb2a4e5de98fc45b2f7ba6d/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 18 | 19 | 28 | React App 29 | 30 | 31 | 32 |
33 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashLips/nft_ipfs_minter/470d4ee59bf08d559bb2a4e5de98fc45b2f7ba6d/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HashLips/nft_ipfs_minter/470d4ee59bf08d559bb2a4e5de98fc45b2f7ba6d/public/logo512.png -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState, useRef } from "react"; 2 | import { useDispatch, useSelector } from "react-redux"; 3 | import { connect } from "./redux/blockchain/blockchainActions"; 4 | import { fetchData } from "./redux/data/dataActions"; 5 | import * as s from "./styles/globalStyles"; 6 | import styled from "styled-components"; 7 | import { create } from "ipfs-http-client"; 8 | import SignatureCanvas from "react-signature-canvas"; 9 | 10 | const ipfsClient = create("https://ipfs.infura.io:5001/api/v0"); 11 | 12 | export const StyledButton = styled.button` 13 | padding: 8px; 14 | `; 15 | 16 | function App() { 17 | const dispatch = useDispatch(); 18 | const blockchain = useSelector((state) => state.blockchain); 19 | const data = useSelector((state) => state.data); 20 | const [loading, setLoading] = useState(false); 21 | const [status, setStatus] = useState(""); 22 | const [NFTS, setNFTS] = useState([]); 23 | const elementRef = useRef(); 24 | const ipfsBaseUrl = "https://ipfs.infura.io/ipfs/"; 25 | const name = "NFT name"; 26 | const description = "IPFS minted nft woooooo."; 27 | 28 | console.log(NFTS); 29 | 30 | const mint = (_uri) => { 31 | blockchain.smartContract.methods 32 | .mint(blockchain.account, _uri) 33 | .send({ from: blockchain.account }) 34 | .once("error", (err) => { 35 | console.log(err); 36 | setLoading(false); 37 | setStatus("Error"); 38 | }) 39 | .then((receipt) => { 40 | console.log(receipt); 41 | setLoading(false); 42 | clearCanvas(); 43 | dispatch(fetchData(blockchain.account)); 44 | setStatus("Successfully minting your NFT"); 45 | }); 46 | }; 47 | 48 | const createMetaDataAndMint = async (_name, _des, _imgBuffer) => { 49 | setLoading(true); 50 | setStatus("Uploading to IPFS"); 51 | try { 52 | const addedImage = await ipfsClient.add(_imgBuffer); 53 | const metaDataObj = { 54 | name: _name, 55 | description: _des, 56 | image: ipfsBaseUrl + addedImage.path, 57 | }; 58 | const addedMetaData = await ipfsClient.add(JSON.stringify(metaDataObj)); 59 | console.log(ipfsBaseUrl + addedMetaData.path); 60 | mint(ipfsBaseUrl + addedMetaData.path); 61 | } catch (err) { 62 | console.log(err); 63 | setLoading(false); 64 | setStatus("Error"); 65 | } 66 | }; 67 | 68 | const startMintingProcess = () => { 69 | createMetaDataAndMint(name, description, getImageData()); 70 | }; 71 | 72 | const getImageData = () => { 73 | const canvasEl = elementRef.current; 74 | let dataUrl = canvasEl.toDataURL("image/png"); 75 | const buffer = Buffer(dataUrl.split(",")[1], "base64"); 76 | return buffer; 77 | }; 78 | 79 | const fetchMetatDataForNFTS = () => { 80 | setNFTS([]); 81 | data.allTokens.forEach((nft) => { 82 | fetch(nft.uri) 83 | .then((response) => response.json()) 84 | .then((metaData) => { 85 | setNFTS((prevState) => [ 86 | ...prevState, 87 | { id: nft.id, metaData: metaData }, 88 | ]); 89 | }) 90 | .catch((err) => { 91 | console.log(err); 92 | }); 93 | }); 94 | }; 95 | 96 | const clearCanvas = () => { 97 | const canvasEl = elementRef.current; 98 | canvasEl.clear(); 99 | }; 100 | 101 | useEffect(() => { 102 | if (blockchain.account !== "" && blockchain.smartContract !== null) { 103 | dispatch(fetchData(blockchain.account)); 104 | } 105 | }, [blockchain.smartContract, dispatch]); 106 | 107 | useEffect(() => { 108 | fetchMetatDataForNFTS(); 109 | }, [data.allTokens]); 110 | 111 | return ( 112 | 113 | {blockchain.account === "" || blockchain.smartContract === null ? ( 114 | 115 | Connect to the Blockchain 116 | 117 | { 119 | e.preventDefault(); 120 | dispatch(connect()); 121 | }} 122 | > 123 | CONNECT 124 | 125 | 126 | {blockchain.errorMsg !== "" ? ( 127 | {blockchain.errorMsg} 128 | ) : null} 129 | 130 | ) : ( 131 | 132 | 133 | Welcome mint your signature 134 | 135 | {loading ? ( 136 | <> 137 | 138 | 139 | loading... 140 | 141 | 142 | ) : null} 143 | {status !== "" ? ( 144 | <> 145 | 146 | 147 | {status} 148 | 149 | 150 | ) : null} 151 | 152 | 153 | { 155 | e.preventDefault(); 156 | startMintingProcess(); 157 | }} 158 | > 159 | MINT 160 | 161 | 162 | { 164 | e.preventDefault(); 165 | clearCanvas(); 166 | }} 167 | > 168 | CLEAR 169 | 170 | 171 | 172 | 177 | 178 | {data.loading ? ( 179 | <> 180 | 181 | 182 | loading... 183 | 184 | 185 | ) : ( 186 | NFTS.map((nft, index) => { 187 | return ( 188 | 189 | {nft.metaData.name} 190 | {nft.metaData.name} 195 | 196 | ); 197 | }) 198 | )} 199 | 200 | )} 201 | 202 | ); 203 | } 204 | 205 | export default App; 206 | -------------------------------------------------------------------------------- /src/contracts/Context.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "Context", 3 | "abi": [], 4 | "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"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\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://26e8b38a7ac8e7b4463af00cf7fff1bf48ae9875765bf4f7751e100124d0bc8c\",\"dweb:/ipfs/QmWcsmkVr24xmmjfnBQZoemFniXjj3vwT78Cz6uqZW1Hux\"]}},\"version\":1}", 5 | "bytecode": "0x", 6 | "deployedBytecode": "0x", 7 | "immutableReferences": {}, 8 | "generatedSources": [], 9 | "deployedGeneratedSources": [], 10 | "sourceMap": "", 11 | "deployedSourceMap": "", 12 | "source": "// SPDX-License-Identifier: MIT\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", 13 | "sourcePath": "@openzeppelin/contracts/utils/Context.sol", 14 | "ast": { 15 | "absolutePath": "@openzeppelin/contracts/utils/Context.sol", 16 | "exportedSymbols": { 17 | "Context": [ 18 | 1601 19 | ] 20 | }, 21 | "id": 1602, 22 | "license": "MIT", 23 | "nodeType": "SourceUnit", 24 | "nodes": [ 25 | { 26 | "id": 1581, 27 | "literals": [ 28 | "solidity", 29 | "^", 30 | "0.8", 31 | ".0" 32 | ], 33 | "nodeType": "PragmaDirective", 34 | "src": "33:23:8" 35 | }, 36 | { 37 | "abstract": true, 38 | "baseContracts": [], 39 | "contractDependencies": [], 40 | "contractKind": "contract", 41 | "documentation": { 42 | "id": 1582, 43 | "nodeType": "StructuredDocumentation", 44 | "src": "58:496:8", 45 | "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." 46 | }, 47 | "fullyImplemented": true, 48 | "id": 1601, 49 | "linearizedBaseContracts": [ 50 | 1601 51 | ], 52 | "name": "Context", 53 | "nodeType": "ContractDefinition", 54 | "nodes": [ 55 | { 56 | "body": { 57 | "id": 1590, 58 | "nodeType": "Block", 59 | "src": "649:34:8", 60 | "statements": [ 61 | { 62 | "expression": { 63 | "expression": { 64 | "id": 1587, 65 | "name": "msg", 66 | "nodeType": "Identifier", 67 | "overloadedDeclarations": [], 68 | "referencedDeclaration": 4294967281, 69 | "src": "666:3:8", 70 | "typeDescriptions": { 71 | "typeIdentifier": "t_magic_message", 72 | "typeString": "msg" 73 | } 74 | }, 75 | "id": 1588, 76 | "isConstant": false, 77 | "isLValue": false, 78 | "isPure": false, 79 | "lValueRequested": false, 80 | "memberName": "sender", 81 | "nodeType": "MemberAccess", 82 | "src": "666:10:8", 83 | "typeDescriptions": { 84 | "typeIdentifier": "t_address", 85 | "typeString": "address" 86 | } 87 | }, 88 | "functionReturnParameters": 1586, 89 | "id": 1589, 90 | "nodeType": "Return", 91 | "src": "659:17:8" 92 | } 93 | ] 94 | }, 95 | "id": 1591, 96 | "implemented": true, 97 | "kind": "function", 98 | "modifiers": [], 99 | "name": "_msgSender", 100 | "nodeType": "FunctionDefinition", 101 | "parameters": { 102 | "id": 1583, 103 | "nodeType": "ParameterList", 104 | "parameters": [], 105 | "src": "606:2:8" 106 | }, 107 | "returnParameters": { 108 | "id": 1586, 109 | "nodeType": "ParameterList", 110 | "parameters": [ 111 | { 112 | "constant": false, 113 | "id": 1585, 114 | "mutability": "mutable", 115 | "name": "", 116 | "nodeType": "VariableDeclaration", 117 | "scope": 1591, 118 | "src": "640:7:8", 119 | "stateVariable": false, 120 | "storageLocation": "default", 121 | "typeDescriptions": { 122 | "typeIdentifier": "t_address", 123 | "typeString": "address" 124 | }, 125 | "typeName": { 126 | "id": 1584, 127 | "name": "address", 128 | "nodeType": "ElementaryTypeName", 129 | "src": "640:7:8", 130 | "stateMutability": "nonpayable", 131 | "typeDescriptions": { 132 | "typeIdentifier": "t_address", 133 | "typeString": "address" 134 | } 135 | }, 136 | "visibility": "internal" 137 | } 138 | ], 139 | "src": "639:9:8" 140 | }, 141 | "scope": 1601, 142 | "src": "587:96:8", 143 | "stateMutability": "view", 144 | "virtual": true, 145 | "visibility": "internal" 146 | }, 147 | { 148 | "body": { 149 | "id": 1599, 150 | "nodeType": "Block", 151 | "src": "756:32:8", 152 | "statements": [ 153 | { 154 | "expression": { 155 | "expression": { 156 | "id": 1596, 157 | "name": "msg", 158 | "nodeType": "Identifier", 159 | "overloadedDeclarations": [], 160 | "referencedDeclaration": 4294967281, 161 | "src": "773:3:8", 162 | "typeDescriptions": { 163 | "typeIdentifier": "t_magic_message", 164 | "typeString": "msg" 165 | } 166 | }, 167 | "id": 1597, 168 | "isConstant": false, 169 | "isLValue": false, 170 | "isPure": false, 171 | "lValueRequested": false, 172 | "memberName": "data", 173 | "nodeType": "MemberAccess", 174 | "src": "773:8:8", 175 | "typeDescriptions": { 176 | "typeIdentifier": "t_bytes_calldata_ptr", 177 | "typeString": "bytes calldata" 178 | } 179 | }, 180 | "functionReturnParameters": 1595, 181 | "id": 1598, 182 | "nodeType": "Return", 183 | "src": "766:15:8" 184 | } 185 | ] 186 | }, 187 | "id": 1600, 188 | "implemented": true, 189 | "kind": "function", 190 | "modifiers": [], 191 | "name": "_msgData", 192 | "nodeType": "FunctionDefinition", 193 | "parameters": { 194 | "id": 1592, 195 | "nodeType": "ParameterList", 196 | "parameters": [], 197 | "src": "706:2:8" 198 | }, 199 | "returnParameters": { 200 | "id": 1595, 201 | "nodeType": "ParameterList", 202 | "parameters": [ 203 | { 204 | "constant": false, 205 | "id": 1594, 206 | "mutability": "mutable", 207 | "name": "", 208 | "nodeType": "VariableDeclaration", 209 | "scope": 1600, 210 | "src": "740:14:8", 211 | "stateVariable": false, 212 | "storageLocation": "calldata", 213 | "typeDescriptions": { 214 | "typeIdentifier": "t_bytes_calldata_ptr", 215 | "typeString": "bytes" 216 | }, 217 | "typeName": { 218 | "id": 1593, 219 | "name": "bytes", 220 | "nodeType": "ElementaryTypeName", 221 | "src": "740:5:8", 222 | "typeDescriptions": { 223 | "typeIdentifier": "t_bytes_storage_ptr", 224 | "typeString": "bytes" 225 | } 226 | }, 227 | "visibility": "internal" 228 | } 229 | ], 230 | "src": "739:16:8" 231 | }, 232 | "scope": 1601, 233 | "src": "689:99:8", 234 | "stateMutability": "view", 235 | "virtual": true, 236 | "visibility": "internal" 237 | } 238 | ], 239 | "scope": 1602, 240 | "src": "555:235:8" 241 | } 242 | ], 243 | "src": "33:758:8" 244 | }, 245 | "legacyAST": { 246 | "absolutePath": "@openzeppelin/contracts/utils/Context.sol", 247 | "exportedSymbols": { 248 | "Context": [ 249 | 1601 250 | ] 251 | }, 252 | "id": 1602, 253 | "license": "MIT", 254 | "nodeType": "SourceUnit", 255 | "nodes": [ 256 | { 257 | "id": 1581, 258 | "literals": [ 259 | "solidity", 260 | "^", 261 | "0.8", 262 | ".0" 263 | ], 264 | "nodeType": "PragmaDirective", 265 | "src": "33:23:8" 266 | }, 267 | { 268 | "abstract": true, 269 | "baseContracts": [], 270 | "contractDependencies": [], 271 | "contractKind": "contract", 272 | "documentation": { 273 | "id": 1582, 274 | "nodeType": "StructuredDocumentation", 275 | "src": "58:496:8", 276 | "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." 277 | }, 278 | "fullyImplemented": true, 279 | "id": 1601, 280 | "linearizedBaseContracts": [ 281 | 1601 282 | ], 283 | "name": "Context", 284 | "nodeType": "ContractDefinition", 285 | "nodes": [ 286 | { 287 | "body": { 288 | "id": 1590, 289 | "nodeType": "Block", 290 | "src": "649:34:8", 291 | "statements": [ 292 | { 293 | "expression": { 294 | "expression": { 295 | "id": 1587, 296 | "name": "msg", 297 | "nodeType": "Identifier", 298 | "overloadedDeclarations": [], 299 | "referencedDeclaration": 4294967281, 300 | "src": "666:3:8", 301 | "typeDescriptions": { 302 | "typeIdentifier": "t_magic_message", 303 | "typeString": "msg" 304 | } 305 | }, 306 | "id": 1588, 307 | "isConstant": false, 308 | "isLValue": false, 309 | "isPure": false, 310 | "lValueRequested": false, 311 | "memberName": "sender", 312 | "nodeType": "MemberAccess", 313 | "src": "666:10:8", 314 | "typeDescriptions": { 315 | "typeIdentifier": "t_address", 316 | "typeString": "address" 317 | } 318 | }, 319 | "functionReturnParameters": 1586, 320 | "id": 1589, 321 | "nodeType": "Return", 322 | "src": "659:17:8" 323 | } 324 | ] 325 | }, 326 | "id": 1591, 327 | "implemented": true, 328 | "kind": "function", 329 | "modifiers": [], 330 | "name": "_msgSender", 331 | "nodeType": "FunctionDefinition", 332 | "parameters": { 333 | "id": 1583, 334 | "nodeType": "ParameterList", 335 | "parameters": [], 336 | "src": "606:2:8" 337 | }, 338 | "returnParameters": { 339 | "id": 1586, 340 | "nodeType": "ParameterList", 341 | "parameters": [ 342 | { 343 | "constant": false, 344 | "id": 1585, 345 | "mutability": "mutable", 346 | "name": "", 347 | "nodeType": "VariableDeclaration", 348 | "scope": 1591, 349 | "src": "640:7:8", 350 | "stateVariable": false, 351 | "storageLocation": "default", 352 | "typeDescriptions": { 353 | "typeIdentifier": "t_address", 354 | "typeString": "address" 355 | }, 356 | "typeName": { 357 | "id": 1584, 358 | "name": "address", 359 | "nodeType": "ElementaryTypeName", 360 | "src": "640:7:8", 361 | "stateMutability": "nonpayable", 362 | "typeDescriptions": { 363 | "typeIdentifier": "t_address", 364 | "typeString": "address" 365 | } 366 | }, 367 | "visibility": "internal" 368 | } 369 | ], 370 | "src": "639:9:8" 371 | }, 372 | "scope": 1601, 373 | "src": "587:96:8", 374 | "stateMutability": "view", 375 | "virtual": true, 376 | "visibility": "internal" 377 | }, 378 | { 379 | "body": { 380 | "id": 1599, 381 | "nodeType": "Block", 382 | "src": "756:32:8", 383 | "statements": [ 384 | { 385 | "expression": { 386 | "expression": { 387 | "id": 1596, 388 | "name": "msg", 389 | "nodeType": "Identifier", 390 | "overloadedDeclarations": [], 391 | "referencedDeclaration": 4294967281, 392 | "src": "773:3:8", 393 | "typeDescriptions": { 394 | "typeIdentifier": "t_magic_message", 395 | "typeString": "msg" 396 | } 397 | }, 398 | "id": 1597, 399 | "isConstant": false, 400 | "isLValue": false, 401 | "isPure": false, 402 | "lValueRequested": false, 403 | "memberName": "data", 404 | "nodeType": "MemberAccess", 405 | "src": "773:8:8", 406 | "typeDescriptions": { 407 | "typeIdentifier": "t_bytes_calldata_ptr", 408 | "typeString": "bytes calldata" 409 | } 410 | }, 411 | "functionReturnParameters": 1595, 412 | "id": 1598, 413 | "nodeType": "Return", 414 | "src": "766:15:8" 415 | } 416 | ] 417 | }, 418 | "id": 1600, 419 | "implemented": true, 420 | "kind": "function", 421 | "modifiers": [], 422 | "name": "_msgData", 423 | "nodeType": "FunctionDefinition", 424 | "parameters": { 425 | "id": 1592, 426 | "nodeType": "ParameterList", 427 | "parameters": [], 428 | "src": "706:2:8" 429 | }, 430 | "returnParameters": { 431 | "id": 1595, 432 | "nodeType": "ParameterList", 433 | "parameters": [ 434 | { 435 | "constant": false, 436 | "id": 1594, 437 | "mutability": "mutable", 438 | "name": "", 439 | "nodeType": "VariableDeclaration", 440 | "scope": 1600, 441 | "src": "740:14:8", 442 | "stateVariable": false, 443 | "storageLocation": "calldata", 444 | "typeDescriptions": { 445 | "typeIdentifier": "t_bytes_calldata_ptr", 446 | "typeString": "bytes" 447 | }, 448 | "typeName": { 449 | "id": 1593, 450 | "name": "bytes", 451 | "nodeType": "ElementaryTypeName", 452 | "src": "740:5:8", 453 | "typeDescriptions": { 454 | "typeIdentifier": "t_bytes_storage_ptr", 455 | "typeString": "bytes" 456 | } 457 | }, 458 | "visibility": "internal" 459 | } 460 | ], 461 | "src": "739:16:8" 462 | }, 463 | "scope": 1601, 464 | "src": "689:99:8", 465 | "stateMutability": "view", 466 | "virtual": true, 467 | "visibility": "internal" 468 | } 469 | ], 470 | "scope": 1602, 471 | "src": "555:235:8" 472 | } 473 | ], 474 | "src": "33:758:8" 475 | }, 476 | "compiler": { 477 | "name": "solc", 478 | "version": "0.8.0+commit.c7dfd78e.Emscripten.clang" 479 | }, 480 | "networks": {}, 481 | "schemaVersion": "3.4.1", 482 | "updatedAt": "2021-08-21T06:21:41.724Z", 483 | "devdoc": { 484 | "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.", 485 | "kind": "dev", 486 | "methods": {}, 487 | "version": 1 488 | }, 489 | "userdoc": { 490 | "kind": "user", 491 | "methods": {}, 492 | "version": 1 493 | } 494 | } -------------------------------------------------------------------------------- /src/contracts/ERC165.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "ERC165", 3 | "abi": [ 4 | { 5 | "inputs": [ 6 | { 7 | "internalType": "bytes4", 8 | "name": "interfaceId", 9 | "type": "bytes4" 10 | } 11 | ], 12 | "name": "supportsInterface", 13 | "outputs": [ 14 | { 15 | "internalType": "bool", 16 | "name": "", 17 | "type": "bool" 18 | } 19 | ], 20 | "stateMutability": "view", 21 | "type": "function" 22 | } 23 | ], 24 | "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"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\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"keccak256\":\"0x5718c5df9bd67ac68a796961df938821bb5dc0cd4c6118d77e9145afb187409b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d10e1d9b26042424789246603906ad06143bf9a928f4e99de8b5e3bdc662f549\",\"dweb:/ipfs/Qmejonoaj5MLekPus229rJQHcC6E9dz2xorjHJR84fMfmn\"]},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0xa28007762d9da9db878dd421960c8cb9a10471f47ab5c1b3309bfe48e9e79ff4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://796ab6e88af7bf0e78def0f059310c903af6a312b565344e0ff524a0f26e81c6\",\"dweb:/ipfs/QmcsVgLgzWdor3UnAztUkXKNGcysm1MPneWksF72AvnwBx\"]}},\"version\":1}", 25 | "bytecode": "0x", 26 | "deployedBytecode": "0x", 27 | "immutableReferences": {}, 28 | "generatedSources": [], 29 | "deployedGeneratedSources": [], 30 | "sourceMap": "", 31 | "deployedSourceMap": "", 32 | "source": "// SPDX-License-Identifier: MIT\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", 33 | "sourcePath": "@openzeppelin/contracts/utils/introspection/ERC165.sol", 34 | "ast": { 35 | "absolutePath": "@openzeppelin/contracts/utils/introspection/ERC165.sol", 36 | "exportedSymbols": { 37 | "ERC165": [ 38 | 1902 39 | ], 40 | "IERC165": [ 41 | 1914 42 | ] 43 | }, 44 | "id": 1903, 45 | "license": "MIT", 46 | "nodeType": "SourceUnit", 47 | "nodes": [ 48 | { 49 | "id": 1880, 50 | "literals": [ 51 | "solidity", 52 | "^", 53 | "0.8", 54 | ".0" 55 | ], 56 | "nodeType": "PragmaDirective", 57 | "src": "33:23:11" 58 | }, 59 | { 60 | "absolutePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol", 61 | "file": "./IERC165.sol", 62 | "id": 1881, 63 | "nodeType": "ImportDirective", 64 | "scope": 1903, 65 | "sourceUnit": 1915, 66 | "src": "58:23:11", 67 | "symbolAliases": [], 68 | "unitAlias": "" 69 | }, 70 | { 71 | "abstract": true, 72 | "baseContracts": [ 73 | { 74 | "baseName": { 75 | "id": 1883, 76 | "name": "IERC165", 77 | "nodeType": "IdentifierPath", 78 | "referencedDeclaration": 1914, 79 | "src": "688:7:11" 80 | }, 81 | "id": 1884, 82 | "nodeType": "InheritanceSpecifier", 83 | "src": "688:7:11" 84 | } 85 | ], 86 | "contractDependencies": [ 87 | 1914 88 | ], 89 | "contractKind": "contract", 90 | "documentation": { 91 | "id": 1882, 92 | "nodeType": "StructuredDocumentation", 93 | "src": "83:576:11", 94 | "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." 95 | }, 96 | "fullyImplemented": true, 97 | "id": 1902, 98 | "linearizedBaseContracts": [ 99 | 1902, 100 | 1914 101 | ], 102 | "name": "ERC165", 103 | "nodeType": "ContractDefinition", 104 | "nodes": [ 105 | { 106 | "baseFunctions": [ 107 | 1913 108 | ], 109 | "body": { 110 | "id": 1900, 111 | "nodeType": "Block", 112 | "src": "854:64:11", 113 | "statements": [ 114 | { 115 | "expression": { 116 | "commonType": { 117 | "typeIdentifier": "t_bytes4", 118 | "typeString": "bytes4" 119 | }, 120 | "id": 1898, 121 | "isConstant": false, 122 | "isLValue": false, 123 | "isPure": false, 124 | "lValueRequested": false, 125 | "leftExpression": { 126 | "id": 1893, 127 | "name": "interfaceId", 128 | "nodeType": "Identifier", 129 | "overloadedDeclarations": [], 130 | "referencedDeclaration": 1887, 131 | "src": "871:11:11", 132 | "typeDescriptions": { 133 | "typeIdentifier": "t_bytes4", 134 | "typeString": "bytes4" 135 | } 136 | }, 137 | "nodeType": "BinaryOperation", 138 | "operator": "==", 139 | "rightExpression": { 140 | "expression": { 141 | "arguments": [ 142 | { 143 | "id": 1895, 144 | "name": "IERC165", 145 | "nodeType": "Identifier", 146 | "overloadedDeclarations": [], 147 | "referencedDeclaration": 1914, 148 | "src": "891:7:11", 149 | "typeDescriptions": { 150 | "typeIdentifier": "t_type$_t_contract$_IERC165_$1914_$", 151 | "typeString": "type(contract IERC165)" 152 | } 153 | } 154 | ], 155 | "expression": { 156 | "argumentTypes": [ 157 | { 158 | "typeIdentifier": "t_type$_t_contract$_IERC165_$1914_$", 159 | "typeString": "type(contract IERC165)" 160 | } 161 | ], 162 | "id": 1894, 163 | "name": "type", 164 | "nodeType": "Identifier", 165 | "overloadedDeclarations": [], 166 | "referencedDeclaration": 4294967269, 167 | "src": "886:4:11", 168 | "typeDescriptions": { 169 | "typeIdentifier": "t_function_metatype_pure$__$returns$__$", 170 | "typeString": "function () pure" 171 | } 172 | }, 173 | "id": 1896, 174 | "isConstant": false, 175 | "isLValue": false, 176 | "isPure": true, 177 | "kind": "functionCall", 178 | "lValueRequested": false, 179 | "names": [], 180 | "nodeType": "FunctionCall", 181 | "src": "886:13:11", 182 | "tryCall": false, 183 | "typeDescriptions": { 184 | "typeIdentifier": "t_magic_meta_type_t_contract$_IERC165_$1914", 185 | "typeString": "type(contract IERC165)" 186 | } 187 | }, 188 | "id": 1897, 189 | "isConstant": false, 190 | "isLValue": false, 191 | "isPure": true, 192 | "lValueRequested": false, 193 | "memberName": "interfaceId", 194 | "nodeType": "MemberAccess", 195 | "src": "886:25:11", 196 | "typeDescriptions": { 197 | "typeIdentifier": "t_bytes4", 198 | "typeString": "bytes4" 199 | } 200 | }, 201 | "src": "871:40:11", 202 | "typeDescriptions": { 203 | "typeIdentifier": "t_bool", 204 | "typeString": "bool" 205 | } 206 | }, 207 | "functionReturnParameters": 1892, 208 | "id": 1899, 209 | "nodeType": "Return", 210 | "src": "864:47:11" 211 | } 212 | ] 213 | }, 214 | "documentation": { 215 | "id": 1885, 216 | "nodeType": "StructuredDocumentation", 217 | "src": "702:56:11", 218 | "text": " @dev See {IERC165-supportsInterface}." 219 | }, 220 | "functionSelector": "01ffc9a7", 221 | "id": 1901, 222 | "implemented": true, 223 | "kind": "function", 224 | "modifiers": [], 225 | "name": "supportsInterface", 226 | "nodeType": "FunctionDefinition", 227 | "overrides": { 228 | "id": 1889, 229 | "nodeType": "OverrideSpecifier", 230 | "overrides": [], 231 | "src": "830:8:11" 232 | }, 233 | "parameters": { 234 | "id": 1888, 235 | "nodeType": "ParameterList", 236 | "parameters": [ 237 | { 238 | "constant": false, 239 | "id": 1887, 240 | "mutability": "mutable", 241 | "name": "interfaceId", 242 | "nodeType": "VariableDeclaration", 243 | "scope": 1901, 244 | "src": "790:18:11", 245 | "stateVariable": false, 246 | "storageLocation": "default", 247 | "typeDescriptions": { 248 | "typeIdentifier": "t_bytes4", 249 | "typeString": "bytes4" 250 | }, 251 | "typeName": { 252 | "id": 1886, 253 | "name": "bytes4", 254 | "nodeType": "ElementaryTypeName", 255 | "src": "790:6:11", 256 | "typeDescriptions": { 257 | "typeIdentifier": "t_bytes4", 258 | "typeString": "bytes4" 259 | } 260 | }, 261 | "visibility": "internal" 262 | } 263 | ], 264 | "src": "789:20:11" 265 | }, 266 | "returnParameters": { 267 | "id": 1892, 268 | "nodeType": "ParameterList", 269 | "parameters": [ 270 | { 271 | "constant": false, 272 | "id": 1891, 273 | "mutability": "mutable", 274 | "name": "", 275 | "nodeType": "VariableDeclaration", 276 | "scope": 1901, 277 | "src": "848:4:11", 278 | "stateVariable": false, 279 | "storageLocation": "default", 280 | "typeDescriptions": { 281 | "typeIdentifier": "t_bool", 282 | "typeString": "bool" 283 | }, 284 | "typeName": { 285 | "id": 1890, 286 | "name": "bool", 287 | "nodeType": "ElementaryTypeName", 288 | "src": "848:4:11", 289 | "typeDescriptions": { 290 | "typeIdentifier": "t_bool", 291 | "typeString": "bool" 292 | } 293 | }, 294 | "visibility": "internal" 295 | } 296 | ], 297 | "src": "847:6:11" 298 | }, 299 | "scope": 1902, 300 | "src": "763:155:11", 301 | "stateMutability": "view", 302 | "virtual": true, 303 | "visibility": "public" 304 | } 305 | ], 306 | "scope": 1903, 307 | "src": "660:260:11" 308 | } 309 | ], 310 | "src": "33:888:11" 311 | }, 312 | "legacyAST": { 313 | "absolutePath": "@openzeppelin/contracts/utils/introspection/ERC165.sol", 314 | "exportedSymbols": { 315 | "ERC165": [ 316 | 1902 317 | ], 318 | "IERC165": [ 319 | 1914 320 | ] 321 | }, 322 | "id": 1903, 323 | "license": "MIT", 324 | "nodeType": "SourceUnit", 325 | "nodes": [ 326 | { 327 | "id": 1880, 328 | "literals": [ 329 | "solidity", 330 | "^", 331 | "0.8", 332 | ".0" 333 | ], 334 | "nodeType": "PragmaDirective", 335 | "src": "33:23:11" 336 | }, 337 | { 338 | "absolutePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol", 339 | "file": "./IERC165.sol", 340 | "id": 1881, 341 | "nodeType": "ImportDirective", 342 | "scope": 1903, 343 | "sourceUnit": 1915, 344 | "src": "58:23:11", 345 | "symbolAliases": [], 346 | "unitAlias": "" 347 | }, 348 | { 349 | "abstract": true, 350 | "baseContracts": [ 351 | { 352 | "baseName": { 353 | "id": 1883, 354 | "name": "IERC165", 355 | "nodeType": "IdentifierPath", 356 | "referencedDeclaration": 1914, 357 | "src": "688:7:11" 358 | }, 359 | "id": 1884, 360 | "nodeType": "InheritanceSpecifier", 361 | "src": "688:7:11" 362 | } 363 | ], 364 | "contractDependencies": [ 365 | 1914 366 | ], 367 | "contractKind": "contract", 368 | "documentation": { 369 | "id": 1882, 370 | "nodeType": "StructuredDocumentation", 371 | "src": "83:576:11", 372 | "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." 373 | }, 374 | "fullyImplemented": true, 375 | "id": 1902, 376 | "linearizedBaseContracts": [ 377 | 1902, 378 | 1914 379 | ], 380 | "name": "ERC165", 381 | "nodeType": "ContractDefinition", 382 | "nodes": [ 383 | { 384 | "baseFunctions": [ 385 | 1913 386 | ], 387 | "body": { 388 | "id": 1900, 389 | "nodeType": "Block", 390 | "src": "854:64:11", 391 | "statements": [ 392 | { 393 | "expression": { 394 | "commonType": { 395 | "typeIdentifier": "t_bytes4", 396 | "typeString": "bytes4" 397 | }, 398 | "id": 1898, 399 | "isConstant": false, 400 | "isLValue": false, 401 | "isPure": false, 402 | "lValueRequested": false, 403 | "leftExpression": { 404 | "id": 1893, 405 | "name": "interfaceId", 406 | "nodeType": "Identifier", 407 | "overloadedDeclarations": [], 408 | "referencedDeclaration": 1887, 409 | "src": "871:11:11", 410 | "typeDescriptions": { 411 | "typeIdentifier": "t_bytes4", 412 | "typeString": "bytes4" 413 | } 414 | }, 415 | "nodeType": "BinaryOperation", 416 | "operator": "==", 417 | "rightExpression": { 418 | "expression": { 419 | "arguments": [ 420 | { 421 | "id": 1895, 422 | "name": "IERC165", 423 | "nodeType": "Identifier", 424 | "overloadedDeclarations": [], 425 | "referencedDeclaration": 1914, 426 | "src": "891:7:11", 427 | "typeDescriptions": { 428 | "typeIdentifier": "t_type$_t_contract$_IERC165_$1914_$", 429 | "typeString": "type(contract IERC165)" 430 | } 431 | } 432 | ], 433 | "expression": { 434 | "argumentTypes": [ 435 | { 436 | "typeIdentifier": "t_type$_t_contract$_IERC165_$1914_$", 437 | "typeString": "type(contract IERC165)" 438 | } 439 | ], 440 | "id": 1894, 441 | "name": "type", 442 | "nodeType": "Identifier", 443 | "overloadedDeclarations": [], 444 | "referencedDeclaration": 4294967269, 445 | "src": "886:4:11", 446 | "typeDescriptions": { 447 | "typeIdentifier": "t_function_metatype_pure$__$returns$__$", 448 | "typeString": "function () pure" 449 | } 450 | }, 451 | "id": 1896, 452 | "isConstant": false, 453 | "isLValue": false, 454 | "isPure": true, 455 | "kind": "functionCall", 456 | "lValueRequested": false, 457 | "names": [], 458 | "nodeType": "FunctionCall", 459 | "src": "886:13:11", 460 | "tryCall": false, 461 | "typeDescriptions": { 462 | "typeIdentifier": "t_magic_meta_type_t_contract$_IERC165_$1914", 463 | "typeString": "type(contract IERC165)" 464 | } 465 | }, 466 | "id": 1897, 467 | "isConstant": false, 468 | "isLValue": false, 469 | "isPure": true, 470 | "lValueRequested": false, 471 | "memberName": "interfaceId", 472 | "nodeType": "MemberAccess", 473 | "src": "886:25:11", 474 | "typeDescriptions": { 475 | "typeIdentifier": "t_bytes4", 476 | "typeString": "bytes4" 477 | } 478 | }, 479 | "src": "871:40:11", 480 | "typeDescriptions": { 481 | "typeIdentifier": "t_bool", 482 | "typeString": "bool" 483 | } 484 | }, 485 | "functionReturnParameters": 1892, 486 | "id": 1899, 487 | "nodeType": "Return", 488 | "src": "864:47:11" 489 | } 490 | ] 491 | }, 492 | "documentation": { 493 | "id": 1885, 494 | "nodeType": "StructuredDocumentation", 495 | "src": "702:56:11", 496 | "text": " @dev See {IERC165-supportsInterface}." 497 | }, 498 | "functionSelector": "01ffc9a7", 499 | "id": 1901, 500 | "implemented": true, 501 | "kind": "function", 502 | "modifiers": [], 503 | "name": "supportsInterface", 504 | "nodeType": "FunctionDefinition", 505 | "overrides": { 506 | "id": 1889, 507 | "nodeType": "OverrideSpecifier", 508 | "overrides": [], 509 | "src": "830:8:11" 510 | }, 511 | "parameters": { 512 | "id": 1888, 513 | "nodeType": "ParameterList", 514 | "parameters": [ 515 | { 516 | "constant": false, 517 | "id": 1887, 518 | "mutability": "mutable", 519 | "name": "interfaceId", 520 | "nodeType": "VariableDeclaration", 521 | "scope": 1901, 522 | "src": "790:18:11", 523 | "stateVariable": false, 524 | "storageLocation": "default", 525 | "typeDescriptions": { 526 | "typeIdentifier": "t_bytes4", 527 | "typeString": "bytes4" 528 | }, 529 | "typeName": { 530 | "id": 1886, 531 | "name": "bytes4", 532 | "nodeType": "ElementaryTypeName", 533 | "src": "790:6:11", 534 | "typeDescriptions": { 535 | "typeIdentifier": "t_bytes4", 536 | "typeString": "bytes4" 537 | } 538 | }, 539 | "visibility": "internal" 540 | } 541 | ], 542 | "src": "789:20:11" 543 | }, 544 | "returnParameters": { 545 | "id": 1892, 546 | "nodeType": "ParameterList", 547 | "parameters": [ 548 | { 549 | "constant": false, 550 | "id": 1891, 551 | "mutability": "mutable", 552 | "name": "", 553 | "nodeType": "VariableDeclaration", 554 | "scope": 1901, 555 | "src": "848:4:11", 556 | "stateVariable": false, 557 | "storageLocation": "default", 558 | "typeDescriptions": { 559 | "typeIdentifier": "t_bool", 560 | "typeString": "bool" 561 | }, 562 | "typeName": { 563 | "id": 1890, 564 | "name": "bool", 565 | "nodeType": "ElementaryTypeName", 566 | "src": "848:4:11", 567 | "typeDescriptions": { 568 | "typeIdentifier": "t_bool", 569 | "typeString": "bool" 570 | } 571 | }, 572 | "visibility": "internal" 573 | } 574 | ], 575 | "src": "847:6:11" 576 | }, 577 | "scope": 1902, 578 | "src": "763:155:11", 579 | "stateMutability": "view", 580 | "virtual": true, 581 | "visibility": "public" 582 | } 583 | ], 584 | "scope": 1903, 585 | "src": "660:260:11" 586 | } 587 | ], 588 | "src": "33:888:11" 589 | }, 590 | "compiler": { 591 | "name": "solc", 592 | "version": "0.8.0+commit.c7dfd78e.Emscripten.clang" 593 | }, 594 | "networks": {}, 595 | "schemaVersion": "3.4.1", 596 | "updatedAt": "2021-08-21T06:21:41.731Z", 597 | "devdoc": { 598 | "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.", 599 | "kind": "dev", 600 | "methods": { 601 | "supportsInterface(bytes4)": { 602 | "details": "See {IERC165-supportsInterface}." 603 | } 604 | }, 605 | "version": 1 606 | }, 607 | "userdoc": { 608 | "kind": "user", 609 | "methods": {}, 610 | "version": 1 611 | } 612 | } -------------------------------------------------------------------------------- /src/contracts/IERC165.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "IERC165", 3 | "abi": [ 4 | { 5 | "inputs": [ 6 | { 7 | "internalType": "bytes4", 8 | "name": "interfaceId", 9 | "type": "bytes4" 10 | } 11 | ], 12 | "name": "supportsInterface", 13 | "outputs": [ 14 | { 15 | "internalType": "bool", 16 | "name": "", 17 | "type": "bool" 18 | } 19 | ], 20 | "stateMutability": "view", 21 | "type": "function" 22 | } 23 | ], 24 | "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"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\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0xa28007762d9da9db878dd421960c8cb9a10471f47ab5c1b3309bfe48e9e79ff4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://796ab6e88af7bf0e78def0f059310c903af6a312b565344e0ff524a0f26e81c6\",\"dweb:/ipfs/QmcsVgLgzWdor3UnAztUkXKNGcysm1MPneWksF72AvnwBx\"]}},\"version\":1}", 25 | "bytecode": "0x", 26 | "deployedBytecode": "0x", 27 | "immutableReferences": {}, 28 | "generatedSources": [], 29 | "deployedGeneratedSources": [], 30 | "sourceMap": "", 31 | "deployedSourceMap": "", 32 | "source": "// SPDX-License-Identifier: MIT\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", 33 | "sourcePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol", 34 | "ast": { 35 | "absolutePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol", 36 | "exportedSymbols": { 37 | "IERC165": [ 38 | 1914 39 | ] 40 | }, 41 | "id": 1915, 42 | "license": "MIT", 43 | "nodeType": "SourceUnit", 44 | "nodes": [ 45 | { 46 | "id": 1904, 47 | "literals": [ 48 | "solidity", 49 | "^", 50 | "0.8", 51 | ".0" 52 | ], 53 | "nodeType": "PragmaDirective", 54 | "src": "33:23:12" 55 | }, 56 | { 57 | "abstract": false, 58 | "baseContracts": [], 59 | "contractDependencies": [], 60 | "contractKind": "interface", 61 | "documentation": { 62 | "id": 1905, 63 | "nodeType": "StructuredDocumentation", 64 | "src": "58:279:12", 65 | "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}." 66 | }, 67 | "fullyImplemented": false, 68 | "id": 1914, 69 | "linearizedBaseContracts": [ 70 | 1914 71 | ], 72 | "name": "IERC165", 73 | "nodeType": "ContractDefinition", 74 | "nodes": [ 75 | { 76 | "documentation": { 77 | "id": 1906, 78 | "nodeType": "StructuredDocumentation", 79 | "src": "362:340:12", 80 | "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." 81 | }, 82 | "functionSelector": "01ffc9a7", 83 | "id": 1913, 84 | "implemented": false, 85 | "kind": "function", 86 | "modifiers": [], 87 | "name": "supportsInterface", 88 | "nodeType": "FunctionDefinition", 89 | "parameters": { 90 | "id": 1909, 91 | "nodeType": "ParameterList", 92 | "parameters": [ 93 | { 94 | "constant": false, 95 | "id": 1908, 96 | "mutability": "mutable", 97 | "name": "interfaceId", 98 | "nodeType": "VariableDeclaration", 99 | "scope": 1913, 100 | "src": "734:18:12", 101 | "stateVariable": false, 102 | "storageLocation": "default", 103 | "typeDescriptions": { 104 | "typeIdentifier": "t_bytes4", 105 | "typeString": "bytes4" 106 | }, 107 | "typeName": { 108 | "id": 1907, 109 | "name": "bytes4", 110 | "nodeType": "ElementaryTypeName", 111 | "src": "734:6:12", 112 | "typeDescriptions": { 113 | "typeIdentifier": "t_bytes4", 114 | "typeString": "bytes4" 115 | } 116 | }, 117 | "visibility": "internal" 118 | } 119 | ], 120 | "src": "733:20:12" 121 | }, 122 | "returnParameters": { 123 | "id": 1912, 124 | "nodeType": "ParameterList", 125 | "parameters": [ 126 | { 127 | "constant": false, 128 | "id": 1911, 129 | "mutability": "mutable", 130 | "name": "", 131 | "nodeType": "VariableDeclaration", 132 | "scope": 1913, 133 | "src": "777:4:12", 134 | "stateVariable": false, 135 | "storageLocation": "default", 136 | "typeDescriptions": { 137 | "typeIdentifier": "t_bool", 138 | "typeString": "bool" 139 | }, 140 | "typeName": { 141 | "id": 1910, 142 | "name": "bool", 143 | "nodeType": "ElementaryTypeName", 144 | "src": "777:4:12", 145 | "typeDescriptions": { 146 | "typeIdentifier": "t_bool", 147 | "typeString": "bool" 148 | } 149 | }, 150 | "visibility": "internal" 151 | } 152 | ], 153 | "src": "776:6:12" 154 | }, 155 | "scope": 1914, 156 | "src": "707:76:12", 157 | "stateMutability": "view", 158 | "virtual": false, 159 | "visibility": "external" 160 | } 161 | ], 162 | "scope": 1915, 163 | "src": "338:447:12" 164 | } 165 | ], 166 | "src": "33:753:12" 167 | }, 168 | "legacyAST": { 169 | "absolutePath": "@openzeppelin/contracts/utils/introspection/IERC165.sol", 170 | "exportedSymbols": { 171 | "IERC165": [ 172 | 1914 173 | ] 174 | }, 175 | "id": 1915, 176 | "license": "MIT", 177 | "nodeType": "SourceUnit", 178 | "nodes": [ 179 | { 180 | "id": 1904, 181 | "literals": [ 182 | "solidity", 183 | "^", 184 | "0.8", 185 | ".0" 186 | ], 187 | "nodeType": "PragmaDirective", 188 | "src": "33:23:12" 189 | }, 190 | { 191 | "abstract": false, 192 | "baseContracts": [], 193 | "contractDependencies": [], 194 | "contractKind": "interface", 195 | "documentation": { 196 | "id": 1905, 197 | "nodeType": "StructuredDocumentation", 198 | "src": "58:279:12", 199 | "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}." 200 | }, 201 | "fullyImplemented": false, 202 | "id": 1914, 203 | "linearizedBaseContracts": [ 204 | 1914 205 | ], 206 | "name": "IERC165", 207 | "nodeType": "ContractDefinition", 208 | "nodes": [ 209 | { 210 | "documentation": { 211 | "id": 1906, 212 | "nodeType": "StructuredDocumentation", 213 | "src": "362:340:12", 214 | "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." 215 | }, 216 | "functionSelector": "01ffc9a7", 217 | "id": 1913, 218 | "implemented": false, 219 | "kind": "function", 220 | "modifiers": [], 221 | "name": "supportsInterface", 222 | "nodeType": "FunctionDefinition", 223 | "parameters": { 224 | "id": 1909, 225 | "nodeType": "ParameterList", 226 | "parameters": [ 227 | { 228 | "constant": false, 229 | "id": 1908, 230 | "mutability": "mutable", 231 | "name": "interfaceId", 232 | "nodeType": "VariableDeclaration", 233 | "scope": 1913, 234 | "src": "734:18:12", 235 | "stateVariable": false, 236 | "storageLocation": "default", 237 | "typeDescriptions": { 238 | "typeIdentifier": "t_bytes4", 239 | "typeString": "bytes4" 240 | }, 241 | "typeName": { 242 | "id": 1907, 243 | "name": "bytes4", 244 | "nodeType": "ElementaryTypeName", 245 | "src": "734:6:12", 246 | "typeDescriptions": { 247 | "typeIdentifier": "t_bytes4", 248 | "typeString": "bytes4" 249 | } 250 | }, 251 | "visibility": "internal" 252 | } 253 | ], 254 | "src": "733:20:12" 255 | }, 256 | "returnParameters": { 257 | "id": 1912, 258 | "nodeType": "ParameterList", 259 | "parameters": [ 260 | { 261 | "constant": false, 262 | "id": 1911, 263 | "mutability": "mutable", 264 | "name": "", 265 | "nodeType": "VariableDeclaration", 266 | "scope": 1913, 267 | "src": "777:4:12", 268 | "stateVariable": false, 269 | "storageLocation": "default", 270 | "typeDescriptions": { 271 | "typeIdentifier": "t_bool", 272 | "typeString": "bool" 273 | }, 274 | "typeName": { 275 | "id": 1910, 276 | "name": "bool", 277 | "nodeType": "ElementaryTypeName", 278 | "src": "777:4:12", 279 | "typeDescriptions": { 280 | "typeIdentifier": "t_bool", 281 | "typeString": "bool" 282 | } 283 | }, 284 | "visibility": "internal" 285 | } 286 | ], 287 | "src": "776:6:12" 288 | }, 289 | "scope": 1914, 290 | "src": "707:76:12", 291 | "stateMutability": "view", 292 | "virtual": false, 293 | "visibility": "external" 294 | } 295 | ], 296 | "scope": 1915, 297 | "src": "338:447:12" 298 | } 299 | ], 300 | "src": "33:753:12" 301 | }, 302 | "compiler": { 303 | "name": "solc", 304 | "version": "0.8.0+commit.c7dfd78e.Emscripten.clang" 305 | }, 306 | "networks": {}, 307 | "schemaVersion": "3.4.1", 308 | "updatedAt": "2021-08-21T06:21:41.732Z", 309 | "devdoc": { 310 | "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}.", 311 | "kind": "dev", 312 | "methods": { 313 | "supportsInterface(bytes4)": { 314 | "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." 315 | } 316 | }, 317 | "version": 1 318 | }, 319 | "userdoc": { 320 | "kind": "user", 321 | "methods": {}, 322 | "version": 1 323 | } 324 | } -------------------------------------------------------------------------------- /src/contracts/IERC721Metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "IERC721Metadata", 3 | "abi": [ 4 | { 5 | "anonymous": false, 6 | "inputs": [ 7 | { 8 | "indexed": true, 9 | "internalType": "address", 10 | "name": "owner", 11 | "type": "address" 12 | }, 13 | { 14 | "indexed": true, 15 | "internalType": "address", 16 | "name": "approved", 17 | "type": "address" 18 | }, 19 | { 20 | "indexed": true, 21 | "internalType": "uint256", 22 | "name": "tokenId", 23 | "type": "uint256" 24 | } 25 | ], 26 | "name": "Approval", 27 | "type": "event" 28 | }, 29 | { 30 | "anonymous": false, 31 | "inputs": [ 32 | { 33 | "indexed": true, 34 | "internalType": "address", 35 | "name": "owner", 36 | "type": "address" 37 | }, 38 | { 39 | "indexed": true, 40 | "internalType": "address", 41 | "name": "operator", 42 | "type": "address" 43 | }, 44 | { 45 | "indexed": false, 46 | "internalType": "bool", 47 | "name": "approved", 48 | "type": "bool" 49 | } 50 | ], 51 | "name": "ApprovalForAll", 52 | "type": "event" 53 | }, 54 | { 55 | "anonymous": false, 56 | "inputs": [ 57 | { 58 | "indexed": true, 59 | "internalType": "address", 60 | "name": "from", 61 | "type": "address" 62 | }, 63 | { 64 | "indexed": true, 65 | "internalType": "address", 66 | "name": "to", 67 | "type": "address" 68 | }, 69 | { 70 | "indexed": true, 71 | "internalType": "uint256", 72 | "name": "tokenId", 73 | "type": "uint256" 74 | } 75 | ], 76 | "name": "Transfer", 77 | "type": "event" 78 | }, 79 | { 80 | "inputs": [ 81 | { 82 | "internalType": "address", 83 | "name": "to", 84 | "type": "address" 85 | }, 86 | { 87 | "internalType": "uint256", 88 | "name": "tokenId", 89 | "type": "uint256" 90 | } 91 | ], 92 | "name": "approve", 93 | "outputs": [], 94 | "stateMutability": "nonpayable", 95 | "type": "function" 96 | }, 97 | { 98 | "inputs": [ 99 | { 100 | "internalType": "address", 101 | "name": "owner", 102 | "type": "address" 103 | } 104 | ], 105 | "name": "balanceOf", 106 | "outputs": [ 107 | { 108 | "internalType": "uint256", 109 | "name": "balance", 110 | "type": "uint256" 111 | } 112 | ], 113 | "stateMutability": "view", 114 | "type": "function" 115 | }, 116 | { 117 | "inputs": [ 118 | { 119 | "internalType": "uint256", 120 | "name": "tokenId", 121 | "type": "uint256" 122 | } 123 | ], 124 | "name": "getApproved", 125 | "outputs": [ 126 | { 127 | "internalType": "address", 128 | "name": "operator", 129 | "type": "address" 130 | } 131 | ], 132 | "stateMutability": "view", 133 | "type": "function" 134 | }, 135 | { 136 | "inputs": [ 137 | { 138 | "internalType": "address", 139 | "name": "owner", 140 | "type": "address" 141 | }, 142 | { 143 | "internalType": "address", 144 | "name": "operator", 145 | "type": "address" 146 | } 147 | ], 148 | "name": "isApprovedForAll", 149 | "outputs": [ 150 | { 151 | "internalType": "bool", 152 | "name": "", 153 | "type": "bool" 154 | } 155 | ], 156 | "stateMutability": "view", 157 | "type": "function" 158 | }, 159 | { 160 | "inputs": [ 161 | { 162 | "internalType": "uint256", 163 | "name": "tokenId", 164 | "type": "uint256" 165 | } 166 | ], 167 | "name": "ownerOf", 168 | "outputs": [ 169 | { 170 | "internalType": "address", 171 | "name": "owner", 172 | "type": "address" 173 | } 174 | ], 175 | "stateMutability": "view", 176 | "type": "function" 177 | }, 178 | { 179 | "inputs": [ 180 | { 181 | "internalType": "address", 182 | "name": "from", 183 | "type": "address" 184 | }, 185 | { 186 | "internalType": "address", 187 | "name": "to", 188 | "type": "address" 189 | }, 190 | { 191 | "internalType": "uint256", 192 | "name": "tokenId", 193 | "type": "uint256" 194 | } 195 | ], 196 | "name": "safeTransferFrom", 197 | "outputs": [], 198 | "stateMutability": "nonpayable", 199 | "type": "function" 200 | }, 201 | { 202 | "inputs": [ 203 | { 204 | "internalType": "address", 205 | "name": "from", 206 | "type": "address" 207 | }, 208 | { 209 | "internalType": "address", 210 | "name": "to", 211 | "type": "address" 212 | }, 213 | { 214 | "internalType": "uint256", 215 | "name": "tokenId", 216 | "type": "uint256" 217 | }, 218 | { 219 | "internalType": "bytes", 220 | "name": "data", 221 | "type": "bytes" 222 | } 223 | ], 224 | "name": "safeTransferFrom", 225 | "outputs": [], 226 | "stateMutability": "nonpayable", 227 | "type": "function" 228 | }, 229 | { 230 | "inputs": [ 231 | { 232 | "internalType": "address", 233 | "name": "operator", 234 | "type": "address" 235 | }, 236 | { 237 | "internalType": "bool", 238 | "name": "_approved", 239 | "type": "bool" 240 | } 241 | ], 242 | "name": "setApprovalForAll", 243 | "outputs": [], 244 | "stateMutability": "nonpayable", 245 | "type": "function" 246 | }, 247 | { 248 | "inputs": [ 249 | { 250 | "internalType": "bytes4", 251 | "name": "interfaceId", 252 | "type": "bytes4" 253 | } 254 | ], 255 | "name": "supportsInterface", 256 | "outputs": [ 257 | { 258 | "internalType": "bool", 259 | "name": "", 260 | "type": "bool" 261 | } 262 | ], 263 | "stateMutability": "view", 264 | "type": "function" 265 | }, 266 | { 267 | "inputs": [ 268 | { 269 | "internalType": "address", 270 | "name": "from", 271 | "type": "address" 272 | }, 273 | { 274 | "internalType": "address", 275 | "name": "to", 276 | "type": "address" 277 | }, 278 | { 279 | "internalType": "uint256", 280 | "name": "tokenId", 281 | "type": "uint256" 282 | } 283 | ], 284 | "name": "transferFrom", 285 | "outputs": [], 286 | "stateMutability": "nonpayable", 287 | "type": "function" 288 | }, 289 | { 290 | "inputs": [], 291 | "name": "name", 292 | "outputs": [ 293 | { 294 | "internalType": "string", 295 | "name": "", 296 | "type": "string" 297 | } 298 | ], 299 | "stateMutability": "view", 300 | "type": "function" 301 | }, 302 | { 303 | "inputs": [], 304 | "name": "symbol", 305 | "outputs": [ 306 | { 307 | "internalType": "string", 308 | "name": "", 309 | "type": "string" 310 | } 311 | ], 312 | "stateMutability": "view", 313 | "type": "function" 314 | }, 315 | { 316 | "inputs": [ 317 | { 318 | "internalType": "uint256", 319 | "name": "tokenId", 320 | "type": "uint256" 321 | } 322 | ], 323 | "name": "tokenURI", 324 | "outputs": [ 325 | { 326 | "internalType": "string", 327 | "name": "", 328 | "type": "string" 329 | } 330 | ], 331 | "stateMutability": "view", 332 | "type": "function" 333 | } 334 | ], 335 | "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"language\":\"Solidity\",\"output\":{\"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\":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\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"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\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"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\"}],\"devdoc\":{\"details\":\"See https://eips.ethereum.org/EIPS/eip-721\",\"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}\"},\"name()\":{\"details\":\"Returns the token collection name.\"},\"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 be 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.\"},\"symbol()\":{\"details\":\"Returns the token collection symbol.\"},\"tokenURI(uint256)\":{\"details\":\"Returns the Uniform Resource Identifier (URI) for `tokenId` token.\"},\"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.\"}},\"title\":\"ERC-721 Non-Fungible Token Standard, optional metadata extension\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":\"IERC721Metadata\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"keccak256\":\"0xf101e8720213560fab41104d53b3cc7ba0456ef3a98455aa7f022391783144a0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3e7820bcf567e6892d937c3cb10db263a4042e446799bca602535868d822384e\",\"dweb:/ipfs/QmPG2oeDjKncqsEeyYGjAN7CwAJmMgHterXGGnpzhha4z7\"]},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"keccak256\":\"0xd32fb7f530a914b1083d10a6bed3a586f2451952fec04fe542bcc670a82f7ba5\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://af63ab940a34687c45f0ad84960b048fc5f49330c92ccb422db7822a444733b9\",\"dweb:/ipfs/QmUShaQEu8HS1GjDnsMJQ8jkZEBrecn6NuDZ3pfjY1gVck\"]},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0xa28007762d9da9db878dd421960c8cb9a10471f47ab5c1b3309bfe48e9e79ff4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://796ab6e88af7bf0e78def0f059310c903af6a312b565344e0ff524a0f26e81c6\",\"dweb:/ipfs/QmcsVgLgzWdor3UnAztUkXKNGcysm1MPneWksF72AvnwBx\"]}},\"version\":1}", 336 | "bytecode": "0x", 337 | "deployedBytecode": "0x", 338 | "immutableReferences": {}, 339 | "generatedSources": [], 340 | "deployedGeneratedSources": [], 341 | "sourceMap": "", 342 | "deployedSourceMap": "", 343 | "source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.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 IERC721Metadata is IERC721 {\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", 344 | "sourcePath": "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol", 345 | "ast": { 346 | "absolutePath": "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol", 347 | "exportedSymbols": { 348 | "IERC165": [ 349 | 1914 350 | ], 351 | "IERC721": [ 352 | 1237 353 | ], 354 | "IERC721Metadata": [ 355 | 1282 356 | ] 357 | }, 358 | "id": 1283, 359 | "license": "MIT", 360 | "nodeType": "SourceUnit", 361 | "nodes": [ 362 | { 363 | "id": 1257, 364 | "literals": [ 365 | "solidity", 366 | "^", 367 | "0.8", 368 | ".0" 369 | ], 370 | "nodeType": "PragmaDirective", 371 | "src": "33:23:6" 372 | }, 373 | { 374 | "absolutePath": "@openzeppelin/contracts/token/ERC721/IERC721.sol", 375 | "file": "../IERC721.sol", 376 | "id": 1258, 377 | "nodeType": "ImportDirective", 378 | "scope": 1283, 379 | "sourceUnit": 1238, 380 | "src": "58:24:6", 381 | "symbolAliases": [], 382 | "unitAlias": "" 383 | }, 384 | { 385 | "abstract": false, 386 | "baseContracts": [ 387 | { 388 | "baseName": { 389 | "id": 1260, 390 | "name": "IERC721", 391 | "nodeType": "IdentifierPath", 392 | "referencedDeclaration": 1237, 393 | "src": "247:7:6" 394 | }, 395 | "id": 1261, 396 | "nodeType": "InheritanceSpecifier", 397 | "src": "247:7:6" 398 | } 399 | ], 400 | "contractDependencies": [ 401 | 1237, 402 | 1914 403 | ], 404 | "contractKind": "interface", 405 | "documentation": { 406 | "id": 1259, 407 | "nodeType": "StructuredDocumentation", 408 | "src": "84:133:6", 409 | "text": " @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n @dev See https://eips.ethereum.org/EIPS/eip-721" 410 | }, 411 | "fullyImplemented": false, 412 | "id": 1282, 413 | "linearizedBaseContracts": [ 414 | 1282, 415 | 1237, 416 | 1914 417 | ], 418 | "name": "IERC721Metadata", 419 | "nodeType": "ContractDefinition", 420 | "nodes": [ 421 | { 422 | "documentation": { 423 | "id": 1262, 424 | "nodeType": "StructuredDocumentation", 425 | "src": "261:58:6", 426 | "text": " @dev Returns the token collection name." 427 | }, 428 | "functionSelector": "06fdde03", 429 | "id": 1267, 430 | "implemented": false, 431 | "kind": "function", 432 | "modifiers": [], 433 | "name": "name", 434 | "nodeType": "FunctionDefinition", 435 | "parameters": { 436 | "id": 1263, 437 | "nodeType": "ParameterList", 438 | "parameters": [], 439 | "src": "337:2:6" 440 | }, 441 | "returnParameters": { 442 | "id": 1266, 443 | "nodeType": "ParameterList", 444 | "parameters": [ 445 | { 446 | "constant": false, 447 | "id": 1265, 448 | "mutability": "mutable", 449 | "name": "", 450 | "nodeType": "VariableDeclaration", 451 | "scope": 1267, 452 | "src": "363:13:6", 453 | "stateVariable": false, 454 | "storageLocation": "memory", 455 | "typeDescriptions": { 456 | "typeIdentifier": "t_string_memory_ptr", 457 | "typeString": "string" 458 | }, 459 | "typeName": { 460 | "id": 1264, 461 | "name": "string", 462 | "nodeType": "ElementaryTypeName", 463 | "src": "363:6:6", 464 | "typeDescriptions": { 465 | "typeIdentifier": "t_string_storage_ptr", 466 | "typeString": "string" 467 | } 468 | }, 469 | "visibility": "internal" 470 | } 471 | ], 472 | "src": "362:15:6" 473 | }, 474 | "scope": 1282, 475 | "src": "324:54:6", 476 | "stateMutability": "view", 477 | "virtual": false, 478 | "visibility": "external" 479 | }, 480 | { 481 | "documentation": { 482 | "id": 1268, 483 | "nodeType": "StructuredDocumentation", 484 | "src": "384:60:6", 485 | "text": " @dev Returns the token collection symbol." 486 | }, 487 | "functionSelector": "95d89b41", 488 | "id": 1273, 489 | "implemented": false, 490 | "kind": "function", 491 | "modifiers": [], 492 | "name": "symbol", 493 | "nodeType": "FunctionDefinition", 494 | "parameters": { 495 | "id": 1269, 496 | "nodeType": "ParameterList", 497 | "parameters": [], 498 | "src": "464:2:6" 499 | }, 500 | "returnParameters": { 501 | "id": 1272, 502 | "nodeType": "ParameterList", 503 | "parameters": [ 504 | { 505 | "constant": false, 506 | "id": 1271, 507 | "mutability": "mutable", 508 | "name": "", 509 | "nodeType": "VariableDeclaration", 510 | "scope": 1273, 511 | "src": "490:13:6", 512 | "stateVariable": false, 513 | "storageLocation": "memory", 514 | "typeDescriptions": { 515 | "typeIdentifier": "t_string_memory_ptr", 516 | "typeString": "string" 517 | }, 518 | "typeName": { 519 | "id": 1270, 520 | "name": "string", 521 | "nodeType": "ElementaryTypeName", 522 | "src": "490:6:6", 523 | "typeDescriptions": { 524 | "typeIdentifier": "t_string_storage_ptr", 525 | "typeString": "string" 526 | } 527 | }, 528 | "visibility": "internal" 529 | } 530 | ], 531 | "src": "489:15:6" 532 | }, 533 | "scope": 1282, 534 | "src": "449:56:6", 535 | "stateMutability": "view", 536 | "virtual": false, 537 | "visibility": "external" 538 | }, 539 | { 540 | "documentation": { 541 | "id": 1274, 542 | "nodeType": "StructuredDocumentation", 543 | "src": "511:90:6", 544 | "text": " @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token." 545 | }, 546 | "functionSelector": "c87b56dd", 547 | "id": 1281, 548 | "implemented": false, 549 | "kind": "function", 550 | "modifiers": [], 551 | "name": "tokenURI", 552 | "nodeType": "FunctionDefinition", 553 | "parameters": { 554 | "id": 1277, 555 | "nodeType": "ParameterList", 556 | "parameters": [ 557 | { 558 | "constant": false, 559 | "id": 1276, 560 | "mutability": "mutable", 561 | "name": "tokenId", 562 | "nodeType": "VariableDeclaration", 563 | "scope": 1281, 564 | "src": "624:15:6", 565 | "stateVariable": false, 566 | "storageLocation": "default", 567 | "typeDescriptions": { 568 | "typeIdentifier": "t_uint256", 569 | "typeString": "uint256" 570 | }, 571 | "typeName": { 572 | "id": 1275, 573 | "name": "uint256", 574 | "nodeType": "ElementaryTypeName", 575 | "src": "624:7:6", 576 | "typeDescriptions": { 577 | "typeIdentifier": "t_uint256", 578 | "typeString": "uint256" 579 | } 580 | }, 581 | "visibility": "internal" 582 | } 583 | ], 584 | "src": "623:17:6" 585 | }, 586 | "returnParameters": { 587 | "id": 1280, 588 | "nodeType": "ParameterList", 589 | "parameters": [ 590 | { 591 | "constant": false, 592 | "id": 1279, 593 | "mutability": "mutable", 594 | "name": "", 595 | "nodeType": "VariableDeclaration", 596 | "scope": 1281, 597 | "src": "664:13:6", 598 | "stateVariable": false, 599 | "storageLocation": "memory", 600 | "typeDescriptions": { 601 | "typeIdentifier": "t_string_memory_ptr", 602 | "typeString": "string" 603 | }, 604 | "typeName": { 605 | "id": 1278, 606 | "name": "string", 607 | "nodeType": "ElementaryTypeName", 608 | "src": "664:6:6", 609 | "typeDescriptions": { 610 | "typeIdentifier": "t_string_storage_ptr", 611 | "typeString": "string" 612 | } 613 | }, 614 | "visibility": "internal" 615 | } 616 | ], 617 | "src": "663:15:6" 618 | }, 619 | "scope": 1282, 620 | "src": "606:73:6", 621 | "stateMutability": "view", 622 | "virtual": false, 623 | "visibility": "external" 624 | } 625 | ], 626 | "scope": 1283, 627 | "src": "218:463:6" 628 | } 629 | ], 630 | "src": "33:649:6" 631 | }, 632 | "legacyAST": { 633 | "absolutePath": "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol", 634 | "exportedSymbols": { 635 | "IERC165": [ 636 | 1914 637 | ], 638 | "IERC721": [ 639 | 1237 640 | ], 641 | "IERC721Metadata": [ 642 | 1282 643 | ] 644 | }, 645 | "id": 1283, 646 | "license": "MIT", 647 | "nodeType": "SourceUnit", 648 | "nodes": [ 649 | { 650 | "id": 1257, 651 | "literals": [ 652 | "solidity", 653 | "^", 654 | "0.8", 655 | ".0" 656 | ], 657 | "nodeType": "PragmaDirective", 658 | "src": "33:23:6" 659 | }, 660 | { 661 | "absolutePath": "@openzeppelin/contracts/token/ERC721/IERC721.sol", 662 | "file": "../IERC721.sol", 663 | "id": 1258, 664 | "nodeType": "ImportDirective", 665 | "scope": 1283, 666 | "sourceUnit": 1238, 667 | "src": "58:24:6", 668 | "symbolAliases": [], 669 | "unitAlias": "" 670 | }, 671 | { 672 | "abstract": false, 673 | "baseContracts": [ 674 | { 675 | "baseName": { 676 | "id": 1260, 677 | "name": "IERC721", 678 | "nodeType": "IdentifierPath", 679 | "referencedDeclaration": 1237, 680 | "src": "247:7:6" 681 | }, 682 | "id": 1261, 683 | "nodeType": "InheritanceSpecifier", 684 | "src": "247:7:6" 685 | } 686 | ], 687 | "contractDependencies": [ 688 | 1237, 689 | 1914 690 | ], 691 | "contractKind": "interface", 692 | "documentation": { 693 | "id": 1259, 694 | "nodeType": "StructuredDocumentation", 695 | "src": "84:133:6", 696 | "text": " @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n @dev See https://eips.ethereum.org/EIPS/eip-721" 697 | }, 698 | "fullyImplemented": false, 699 | "id": 1282, 700 | "linearizedBaseContracts": [ 701 | 1282, 702 | 1237, 703 | 1914 704 | ], 705 | "name": "IERC721Metadata", 706 | "nodeType": "ContractDefinition", 707 | "nodes": [ 708 | { 709 | "documentation": { 710 | "id": 1262, 711 | "nodeType": "StructuredDocumentation", 712 | "src": "261:58:6", 713 | "text": " @dev Returns the token collection name." 714 | }, 715 | "functionSelector": "06fdde03", 716 | "id": 1267, 717 | "implemented": false, 718 | "kind": "function", 719 | "modifiers": [], 720 | "name": "name", 721 | "nodeType": "FunctionDefinition", 722 | "parameters": { 723 | "id": 1263, 724 | "nodeType": "ParameterList", 725 | "parameters": [], 726 | "src": "337:2:6" 727 | }, 728 | "returnParameters": { 729 | "id": 1266, 730 | "nodeType": "ParameterList", 731 | "parameters": [ 732 | { 733 | "constant": false, 734 | "id": 1265, 735 | "mutability": "mutable", 736 | "name": "", 737 | "nodeType": "VariableDeclaration", 738 | "scope": 1267, 739 | "src": "363:13:6", 740 | "stateVariable": false, 741 | "storageLocation": "memory", 742 | "typeDescriptions": { 743 | "typeIdentifier": "t_string_memory_ptr", 744 | "typeString": "string" 745 | }, 746 | "typeName": { 747 | "id": 1264, 748 | "name": "string", 749 | "nodeType": "ElementaryTypeName", 750 | "src": "363:6:6", 751 | "typeDescriptions": { 752 | "typeIdentifier": "t_string_storage_ptr", 753 | "typeString": "string" 754 | } 755 | }, 756 | "visibility": "internal" 757 | } 758 | ], 759 | "src": "362:15:6" 760 | }, 761 | "scope": 1282, 762 | "src": "324:54:6", 763 | "stateMutability": "view", 764 | "virtual": false, 765 | "visibility": "external" 766 | }, 767 | { 768 | "documentation": { 769 | "id": 1268, 770 | "nodeType": "StructuredDocumentation", 771 | "src": "384:60:6", 772 | "text": " @dev Returns the token collection symbol." 773 | }, 774 | "functionSelector": "95d89b41", 775 | "id": 1273, 776 | "implemented": false, 777 | "kind": "function", 778 | "modifiers": [], 779 | "name": "symbol", 780 | "nodeType": "FunctionDefinition", 781 | "parameters": { 782 | "id": 1269, 783 | "nodeType": "ParameterList", 784 | "parameters": [], 785 | "src": "464:2:6" 786 | }, 787 | "returnParameters": { 788 | "id": 1272, 789 | "nodeType": "ParameterList", 790 | "parameters": [ 791 | { 792 | "constant": false, 793 | "id": 1271, 794 | "mutability": "mutable", 795 | "name": "", 796 | "nodeType": "VariableDeclaration", 797 | "scope": 1273, 798 | "src": "490:13:6", 799 | "stateVariable": false, 800 | "storageLocation": "memory", 801 | "typeDescriptions": { 802 | "typeIdentifier": "t_string_memory_ptr", 803 | "typeString": "string" 804 | }, 805 | "typeName": { 806 | "id": 1270, 807 | "name": "string", 808 | "nodeType": "ElementaryTypeName", 809 | "src": "490:6:6", 810 | "typeDescriptions": { 811 | "typeIdentifier": "t_string_storage_ptr", 812 | "typeString": "string" 813 | } 814 | }, 815 | "visibility": "internal" 816 | } 817 | ], 818 | "src": "489:15:6" 819 | }, 820 | "scope": 1282, 821 | "src": "449:56:6", 822 | "stateMutability": "view", 823 | "virtual": false, 824 | "visibility": "external" 825 | }, 826 | { 827 | "documentation": { 828 | "id": 1274, 829 | "nodeType": "StructuredDocumentation", 830 | "src": "511:90:6", 831 | "text": " @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token." 832 | }, 833 | "functionSelector": "c87b56dd", 834 | "id": 1281, 835 | "implemented": false, 836 | "kind": "function", 837 | "modifiers": [], 838 | "name": "tokenURI", 839 | "nodeType": "FunctionDefinition", 840 | "parameters": { 841 | "id": 1277, 842 | "nodeType": "ParameterList", 843 | "parameters": [ 844 | { 845 | "constant": false, 846 | "id": 1276, 847 | "mutability": "mutable", 848 | "name": "tokenId", 849 | "nodeType": "VariableDeclaration", 850 | "scope": 1281, 851 | "src": "624:15:6", 852 | "stateVariable": false, 853 | "storageLocation": "default", 854 | "typeDescriptions": { 855 | "typeIdentifier": "t_uint256", 856 | "typeString": "uint256" 857 | }, 858 | "typeName": { 859 | "id": 1275, 860 | "name": "uint256", 861 | "nodeType": "ElementaryTypeName", 862 | "src": "624:7:6", 863 | "typeDescriptions": { 864 | "typeIdentifier": "t_uint256", 865 | "typeString": "uint256" 866 | } 867 | }, 868 | "visibility": "internal" 869 | } 870 | ], 871 | "src": "623:17:6" 872 | }, 873 | "returnParameters": { 874 | "id": 1280, 875 | "nodeType": "ParameterList", 876 | "parameters": [ 877 | { 878 | "constant": false, 879 | "id": 1279, 880 | "mutability": "mutable", 881 | "name": "", 882 | "nodeType": "VariableDeclaration", 883 | "scope": 1281, 884 | "src": "664:13:6", 885 | "stateVariable": false, 886 | "storageLocation": "memory", 887 | "typeDescriptions": { 888 | "typeIdentifier": "t_string_memory_ptr", 889 | "typeString": "string" 890 | }, 891 | "typeName": { 892 | "id": 1278, 893 | "name": "string", 894 | "nodeType": "ElementaryTypeName", 895 | "src": "664:6:6", 896 | "typeDescriptions": { 897 | "typeIdentifier": "t_string_storage_ptr", 898 | "typeString": "string" 899 | } 900 | }, 901 | "visibility": "internal" 902 | } 903 | ], 904 | "src": "663:15:6" 905 | }, 906 | "scope": 1282, 907 | "src": "606:73:6", 908 | "stateMutability": "view", 909 | "virtual": false, 910 | "visibility": "external" 911 | } 912 | ], 913 | "scope": 1283, 914 | "src": "218:463:6" 915 | } 916 | ], 917 | "src": "33:649:6" 918 | }, 919 | "compiler": { 920 | "name": "solc", 921 | "version": "0.8.0+commit.c7dfd78e.Emscripten.clang" 922 | }, 923 | "networks": {}, 924 | "schemaVersion": "3.4.1", 925 | "updatedAt": "2021-08-21T06:21:41.716Z", 926 | "devdoc": { 927 | "details": "See https://eips.ethereum.org/EIPS/eip-721", 928 | "kind": "dev", 929 | "methods": { 930 | "approve(address,uint256)": { 931 | "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." 932 | }, 933 | "balanceOf(address)": { 934 | "details": "Returns the number of tokens in ``owner``'s account." 935 | }, 936 | "getApproved(uint256)": { 937 | "details": "Returns the account approved for `tokenId` token. Requirements: - `tokenId` must exist." 938 | }, 939 | "isApprovedForAll(address,address)": { 940 | "details": "Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}" 941 | }, 942 | "name()": { 943 | "details": "Returns the token collection name." 944 | }, 945 | "ownerOf(uint256)": { 946 | "details": "Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist." 947 | }, 948 | "safeTransferFrom(address,address,uint256)": { 949 | "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 be 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." 950 | }, 951 | "safeTransferFrom(address,address,uint256,bytes)": { 952 | "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." 953 | }, 954 | "setApprovalForAll(address,bool)": { 955 | "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." 956 | }, 957 | "supportsInterface(bytes4)": { 958 | "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." 959 | }, 960 | "symbol()": { 961 | "details": "Returns the token collection symbol." 962 | }, 963 | "tokenURI(uint256)": { 964 | "details": "Returns the Uniform Resource Identifier (URI) for `tokenId` token." 965 | }, 966 | "transferFrom(address,address,uint256)": { 967 | "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." 968 | } 969 | }, 970 | "title": "ERC-721 Non-Fungible Token Standard, optional metadata extension", 971 | "version": 1 972 | }, 973 | "userdoc": { 974 | "kind": "user", 975 | "methods": {}, 976 | "version": 1 977 | } 978 | } -------------------------------------------------------------------------------- /src/contracts/IERC721Receiver.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "IERC721Receiver", 3 | "abi": [ 4 | { 5 | "inputs": [ 6 | { 7 | "internalType": "address", 8 | "name": "operator", 9 | "type": "address" 10 | }, 11 | { 12 | "internalType": "address", 13 | "name": "from", 14 | "type": "address" 15 | }, 16 | { 17 | "internalType": "uint256", 18 | "name": "tokenId", 19 | "type": "uint256" 20 | }, 21 | { 22 | "internalType": "bytes", 23 | "name": "data", 24 | "type": "bytes" 25 | } 26 | ], 27 | "name": "onERC721Received", 28 | "outputs": [ 29 | { 30 | "internalType": "bytes4", 31 | "name": "", 32 | "type": "bytes4" 33 | } 34 | ], 35 | "stateMutability": "nonpayable", 36 | "type": "function" 37 | } 38 | ], 39 | "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"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\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"keccak256\":\"0xd9517254724276e2e8de3769183c1f738f445f0095c26fd9b86d3c6687e887b9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0e604bcdcd5e5b2fb299ad09769cde6db19d5aa1929d1b5e939234a0f10d7eb8\",\"dweb:/ipfs/Qmd8hXE3GZfBHuWx3RNiYgFW2ci7KvHtib8DiwzJ2dgo9V\"]}},\"version\":1}", 40 | "bytecode": "0x", 41 | "deployedBytecode": "0x", 42 | "immutableReferences": {}, 43 | "generatedSources": [], 44 | "deployedGeneratedSources": [], 45 | "sourceMap": "", 46 | "deployedSourceMap": "", 47 | "source": "// SPDX-License-Identifier: MIT\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", 48 | "sourcePath": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol", 49 | "ast": { 50 | "absolutePath": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol", 51 | "exportedSymbols": { 52 | "IERC721Receiver": [ 53 | 1255 54 | ] 55 | }, 56 | "id": 1256, 57 | "license": "MIT", 58 | "nodeType": "SourceUnit", 59 | "nodes": [ 60 | { 61 | "id": 1239, 62 | "literals": [ 63 | "solidity", 64 | "^", 65 | "0.8", 66 | ".0" 67 | ], 68 | "nodeType": "PragmaDirective", 69 | "src": "33:23:5" 70 | }, 71 | { 72 | "abstract": false, 73 | "baseContracts": [], 74 | "contractDependencies": [], 75 | "contractKind": "interface", 76 | "documentation": { 77 | "id": 1240, 78 | "nodeType": "StructuredDocumentation", 79 | "src": "58:152:5", 80 | "text": " @title ERC721 token receiver interface\n @dev Interface for any contract that wants to support safeTransfers\n from ERC721 asset contracts." 81 | }, 82 | "fullyImplemented": false, 83 | "id": 1255, 84 | "linearizedBaseContracts": [ 85 | 1255 86 | ], 87 | "name": "IERC721Receiver", 88 | "nodeType": "ContractDefinition", 89 | "nodes": [ 90 | { 91 | "documentation": { 92 | "id": 1241, 93 | "nodeType": "StructuredDocumentation", 94 | "src": "243:485:5", 95 | "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`." 96 | }, 97 | "functionSelector": "150b7a02", 98 | "id": 1254, 99 | "implemented": false, 100 | "kind": "function", 101 | "modifiers": [], 102 | "name": "onERC721Received", 103 | "nodeType": "FunctionDefinition", 104 | "parameters": { 105 | "id": 1250, 106 | "nodeType": "ParameterList", 107 | "parameters": [ 108 | { 109 | "constant": false, 110 | "id": 1243, 111 | "mutability": "mutable", 112 | "name": "operator", 113 | "nodeType": "VariableDeclaration", 114 | "scope": 1254, 115 | "src": "768:16:5", 116 | "stateVariable": false, 117 | "storageLocation": "default", 118 | "typeDescriptions": { 119 | "typeIdentifier": "t_address", 120 | "typeString": "address" 121 | }, 122 | "typeName": { 123 | "id": 1242, 124 | "name": "address", 125 | "nodeType": "ElementaryTypeName", 126 | "src": "768:7:5", 127 | "stateMutability": "nonpayable", 128 | "typeDescriptions": { 129 | "typeIdentifier": "t_address", 130 | "typeString": "address" 131 | } 132 | }, 133 | "visibility": "internal" 134 | }, 135 | { 136 | "constant": false, 137 | "id": 1245, 138 | "mutability": "mutable", 139 | "name": "from", 140 | "nodeType": "VariableDeclaration", 141 | "scope": 1254, 142 | "src": "794:12:5", 143 | "stateVariable": false, 144 | "storageLocation": "default", 145 | "typeDescriptions": { 146 | "typeIdentifier": "t_address", 147 | "typeString": "address" 148 | }, 149 | "typeName": { 150 | "id": 1244, 151 | "name": "address", 152 | "nodeType": "ElementaryTypeName", 153 | "src": "794:7:5", 154 | "stateMutability": "nonpayable", 155 | "typeDescriptions": { 156 | "typeIdentifier": "t_address", 157 | "typeString": "address" 158 | } 159 | }, 160 | "visibility": "internal" 161 | }, 162 | { 163 | "constant": false, 164 | "id": 1247, 165 | "mutability": "mutable", 166 | "name": "tokenId", 167 | "nodeType": "VariableDeclaration", 168 | "scope": 1254, 169 | "src": "816:15:5", 170 | "stateVariable": false, 171 | "storageLocation": "default", 172 | "typeDescriptions": { 173 | "typeIdentifier": "t_uint256", 174 | "typeString": "uint256" 175 | }, 176 | "typeName": { 177 | "id": 1246, 178 | "name": "uint256", 179 | "nodeType": "ElementaryTypeName", 180 | "src": "816:7:5", 181 | "typeDescriptions": { 182 | "typeIdentifier": "t_uint256", 183 | "typeString": "uint256" 184 | } 185 | }, 186 | "visibility": "internal" 187 | }, 188 | { 189 | "constant": false, 190 | "id": 1249, 191 | "mutability": "mutable", 192 | "name": "data", 193 | "nodeType": "VariableDeclaration", 194 | "scope": 1254, 195 | "src": "841:19:5", 196 | "stateVariable": false, 197 | "storageLocation": "calldata", 198 | "typeDescriptions": { 199 | "typeIdentifier": "t_bytes_calldata_ptr", 200 | "typeString": "bytes" 201 | }, 202 | "typeName": { 203 | "id": 1248, 204 | "name": "bytes", 205 | "nodeType": "ElementaryTypeName", 206 | "src": "841:5:5", 207 | "typeDescriptions": { 208 | "typeIdentifier": "t_bytes_storage_ptr", 209 | "typeString": "bytes" 210 | } 211 | }, 212 | "visibility": "internal" 213 | } 214 | ], 215 | "src": "758:108:5" 216 | }, 217 | "returnParameters": { 218 | "id": 1253, 219 | "nodeType": "ParameterList", 220 | "parameters": [ 221 | { 222 | "constant": false, 223 | "id": 1252, 224 | "mutability": "mutable", 225 | "name": "", 226 | "nodeType": "VariableDeclaration", 227 | "scope": 1254, 228 | "src": "885:6:5", 229 | "stateVariable": false, 230 | "storageLocation": "default", 231 | "typeDescriptions": { 232 | "typeIdentifier": "t_bytes4", 233 | "typeString": "bytes4" 234 | }, 235 | "typeName": { 236 | "id": 1251, 237 | "name": "bytes4", 238 | "nodeType": "ElementaryTypeName", 239 | "src": "885:6:5", 240 | "typeDescriptions": { 241 | "typeIdentifier": "t_bytes4", 242 | "typeString": "bytes4" 243 | } 244 | }, 245 | "visibility": "internal" 246 | } 247 | ], 248 | "src": "884:8:5" 249 | }, 250 | "scope": 1255, 251 | "src": "733:160:5", 252 | "stateMutability": "nonpayable", 253 | "virtual": false, 254 | "visibility": "external" 255 | } 256 | ], 257 | "scope": 1256, 258 | "src": "211:684:5" 259 | } 260 | ], 261 | "src": "33:863:5" 262 | }, 263 | "legacyAST": { 264 | "absolutePath": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol", 265 | "exportedSymbols": { 266 | "IERC721Receiver": [ 267 | 1255 268 | ] 269 | }, 270 | "id": 1256, 271 | "license": "MIT", 272 | "nodeType": "SourceUnit", 273 | "nodes": [ 274 | { 275 | "id": 1239, 276 | "literals": [ 277 | "solidity", 278 | "^", 279 | "0.8", 280 | ".0" 281 | ], 282 | "nodeType": "PragmaDirective", 283 | "src": "33:23:5" 284 | }, 285 | { 286 | "abstract": false, 287 | "baseContracts": [], 288 | "contractDependencies": [], 289 | "contractKind": "interface", 290 | "documentation": { 291 | "id": 1240, 292 | "nodeType": "StructuredDocumentation", 293 | "src": "58:152:5", 294 | "text": " @title ERC721 token receiver interface\n @dev Interface for any contract that wants to support safeTransfers\n from ERC721 asset contracts." 295 | }, 296 | "fullyImplemented": false, 297 | "id": 1255, 298 | "linearizedBaseContracts": [ 299 | 1255 300 | ], 301 | "name": "IERC721Receiver", 302 | "nodeType": "ContractDefinition", 303 | "nodes": [ 304 | { 305 | "documentation": { 306 | "id": 1241, 307 | "nodeType": "StructuredDocumentation", 308 | "src": "243:485:5", 309 | "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`." 310 | }, 311 | "functionSelector": "150b7a02", 312 | "id": 1254, 313 | "implemented": false, 314 | "kind": "function", 315 | "modifiers": [], 316 | "name": "onERC721Received", 317 | "nodeType": "FunctionDefinition", 318 | "parameters": { 319 | "id": 1250, 320 | "nodeType": "ParameterList", 321 | "parameters": [ 322 | { 323 | "constant": false, 324 | "id": 1243, 325 | "mutability": "mutable", 326 | "name": "operator", 327 | "nodeType": "VariableDeclaration", 328 | "scope": 1254, 329 | "src": "768:16:5", 330 | "stateVariable": false, 331 | "storageLocation": "default", 332 | "typeDescriptions": { 333 | "typeIdentifier": "t_address", 334 | "typeString": "address" 335 | }, 336 | "typeName": { 337 | "id": 1242, 338 | "name": "address", 339 | "nodeType": "ElementaryTypeName", 340 | "src": "768:7:5", 341 | "stateMutability": "nonpayable", 342 | "typeDescriptions": { 343 | "typeIdentifier": "t_address", 344 | "typeString": "address" 345 | } 346 | }, 347 | "visibility": "internal" 348 | }, 349 | { 350 | "constant": false, 351 | "id": 1245, 352 | "mutability": "mutable", 353 | "name": "from", 354 | "nodeType": "VariableDeclaration", 355 | "scope": 1254, 356 | "src": "794:12:5", 357 | "stateVariable": false, 358 | "storageLocation": "default", 359 | "typeDescriptions": { 360 | "typeIdentifier": "t_address", 361 | "typeString": "address" 362 | }, 363 | "typeName": { 364 | "id": 1244, 365 | "name": "address", 366 | "nodeType": "ElementaryTypeName", 367 | "src": "794:7:5", 368 | "stateMutability": "nonpayable", 369 | "typeDescriptions": { 370 | "typeIdentifier": "t_address", 371 | "typeString": "address" 372 | } 373 | }, 374 | "visibility": "internal" 375 | }, 376 | { 377 | "constant": false, 378 | "id": 1247, 379 | "mutability": "mutable", 380 | "name": "tokenId", 381 | "nodeType": "VariableDeclaration", 382 | "scope": 1254, 383 | "src": "816:15:5", 384 | "stateVariable": false, 385 | "storageLocation": "default", 386 | "typeDescriptions": { 387 | "typeIdentifier": "t_uint256", 388 | "typeString": "uint256" 389 | }, 390 | "typeName": { 391 | "id": 1246, 392 | "name": "uint256", 393 | "nodeType": "ElementaryTypeName", 394 | "src": "816:7:5", 395 | "typeDescriptions": { 396 | "typeIdentifier": "t_uint256", 397 | "typeString": "uint256" 398 | } 399 | }, 400 | "visibility": "internal" 401 | }, 402 | { 403 | "constant": false, 404 | "id": 1249, 405 | "mutability": "mutable", 406 | "name": "data", 407 | "nodeType": "VariableDeclaration", 408 | "scope": 1254, 409 | "src": "841:19:5", 410 | "stateVariable": false, 411 | "storageLocation": "calldata", 412 | "typeDescriptions": { 413 | "typeIdentifier": "t_bytes_calldata_ptr", 414 | "typeString": "bytes" 415 | }, 416 | "typeName": { 417 | "id": 1248, 418 | "name": "bytes", 419 | "nodeType": "ElementaryTypeName", 420 | "src": "841:5:5", 421 | "typeDescriptions": { 422 | "typeIdentifier": "t_bytes_storage_ptr", 423 | "typeString": "bytes" 424 | } 425 | }, 426 | "visibility": "internal" 427 | } 428 | ], 429 | "src": "758:108:5" 430 | }, 431 | "returnParameters": { 432 | "id": 1253, 433 | "nodeType": "ParameterList", 434 | "parameters": [ 435 | { 436 | "constant": false, 437 | "id": 1252, 438 | "mutability": "mutable", 439 | "name": "", 440 | "nodeType": "VariableDeclaration", 441 | "scope": 1254, 442 | "src": "885:6:5", 443 | "stateVariable": false, 444 | "storageLocation": "default", 445 | "typeDescriptions": { 446 | "typeIdentifier": "t_bytes4", 447 | "typeString": "bytes4" 448 | }, 449 | "typeName": { 450 | "id": 1251, 451 | "name": "bytes4", 452 | "nodeType": "ElementaryTypeName", 453 | "src": "885:6:5", 454 | "typeDescriptions": { 455 | "typeIdentifier": "t_bytes4", 456 | "typeString": "bytes4" 457 | } 458 | }, 459 | "visibility": "internal" 460 | } 461 | ], 462 | "src": "884:8:5" 463 | }, 464 | "scope": 1255, 465 | "src": "733:160:5", 466 | "stateMutability": "nonpayable", 467 | "virtual": false, 468 | "visibility": "external" 469 | } 470 | ], 471 | "scope": 1256, 472 | "src": "211:684:5" 473 | } 474 | ], 475 | "src": "33:863:5" 476 | }, 477 | "compiler": { 478 | "name": "solc", 479 | "version": "0.8.0+commit.c7dfd78e.Emscripten.clang" 480 | }, 481 | "networks": {}, 482 | "schemaVersion": "3.4.1", 483 | "updatedAt": "2021-08-21T06:21:41.715Z", 484 | "devdoc": { 485 | "details": "Interface for any contract that wants to support safeTransfers from ERC721 asset contracts.", 486 | "kind": "dev", 487 | "methods": { 488 | "onERC721Received(address,address,uint256,bytes)": { 489 | "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`." 490 | } 491 | }, 492 | "title": "ERC721 token receiver interface", 493 | "version": 1 494 | }, 495 | "userdoc": { 496 | "kind": "user", 497 | "methods": {}, 498 | "version": 1 499 | } 500 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import App from "./App"; 4 | import reportWebVitals from "./reportWebVitals"; 5 | import store from "./redux/store"; 6 | import { Provider } from "react-redux"; 7 | import "./styles/reset.css"; 8 | import "./styles/theme.css"; 9 | 10 | ReactDOM.render( 11 | 12 | 13 | , 14 | document.getElementById("root") 15 | ); 16 | 17 | // If you want to start measuring performance in your app, pass a function 18 | // to log results (for example: reportWebVitals(console.log)) 19 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 20 | reportWebVitals(); 21 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/redux/blockchain/blockchainActions.js: -------------------------------------------------------------------------------- 1 | // constants 2 | import Web3 from "web3"; 3 | import SmartContract from "../../contracts/SmartContract.json"; 4 | // log 5 | import { fetchData } from "../data/dataActions"; 6 | 7 | const connectRequest = () => { 8 | return { 9 | type: "CONNECTION_REQUEST", 10 | }; 11 | }; 12 | 13 | const connectSuccess = (payload) => { 14 | return { 15 | type: "CONNECTION_SUCCESS", 16 | payload: payload, 17 | }; 18 | }; 19 | 20 | const connectFailed = (payload) => { 21 | return { 22 | type: "CONNECTION_FAILED", 23 | payload: payload, 24 | }; 25 | }; 26 | 27 | const updateAccountRequest = (payload) => { 28 | return { 29 | type: "UPDATE_ACCOUNT", 30 | payload: payload, 31 | }; 32 | }; 33 | 34 | export const connect = () => { 35 | return async (dispatch) => { 36 | dispatch(connectRequest()); 37 | if (window.ethereum) { 38 | let web3 = new Web3(window.ethereum); 39 | try { 40 | const accounts = await window.ethereum.request({ 41 | method: "eth_accounts", 42 | }); 43 | const networkId = await window.ethereum.request({ 44 | method: "net_version", 45 | }); 46 | const NetworkData = await SmartContract.networks[networkId]; 47 | if (NetworkData) { 48 | const SmartContractObj = new web3.eth.Contract( 49 | SmartContract.abi, 50 | NetworkData.address 51 | ); 52 | dispatch( 53 | connectSuccess({ 54 | account: accounts[0], 55 | smartContract: SmartContractObj, 56 | web3: web3, 57 | }) 58 | ); 59 | // Add listeners start 60 | window.ethereum.on("accountsChanged", (accounts) => { 61 | dispatch(updateAccount(accounts[0])); 62 | }); 63 | window.ethereum.on("chainChanged", () => { 64 | window.location.reload(); 65 | }); 66 | // Add listeners end 67 | } else { 68 | dispatch(connectFailed("Change network to Polygon.")); 69 | } 70 | } catch (err) { 71 | dispatch(connectFailed("Something went wrong.")); 72 | } 73 | } else { 74 | dispatch(connectFailed("Install Metamask.")); 75 | } 76 | }; 77 | }; 78 | 79 | export const updateAccount = (account) => { 80 | return async (dispatch) => { 81 | dispatch(updateAccountRequest({ account: account })); 82 | dispatch(fetchData(account)); 83 | }; 84 | }; 85 | -------------------------------------------------------------------------------- /src/redux/blockchain/blockchainReducer.js: -------------------------------------------------------------------------------- 1 | const initialState = { 2 | loading: false, 3 | account: null, 4 | smartContract: null, 5 | web3: null, 6 | errorMsg: "", 7 | }; 8 | 9 | const blockchainReducer = (state = initialState, action) => { 10 | switch (action.type) { 11 | case "CONNECTION_REQUEST": 12 | return { 13 | ...initialState, 14 | loading: true, 15 | }; 16 | case "CONNECTION_SUCCESS": 17 | return { 18 | ...state, 19 | loading: false, 20 | account: action.payload.account, 21 | smartContract: action.payload.smartContract, 22 | web3: action.payload.web3, 23 | }; 24 | case "CONNECTION_FAILED": 25 | return { 26 | ...initialState, 27 | loading: false, 28 | errorMsg: action.payload, 29 | }; 30 | case "UPDATE_ACCOUNT": 31 | return { 32 | ...state, 33 | account: action.payload.account, 34 | }; 35 | default: 36 | return state; 37 | } 38 | }; 39 | 40 | export default blockchainReducer; 41 | -------------------------------------------------------------------------------- /src/redux/data/dataActions.js: -------------------------------------------------------------------------------- 1 | // log 2 | import store from "../store"; 3 | 4 | const fetchDataRequest = () => { 5 | return { 6 | type: "CHECK_DATA_REQUEST", 7 | }; 8 | }; 9 | 10 | const fetchDataSuccess = (payload) => { 11 | return { 12 | type: "CHECK_DATA_SUCCESS", 13 | payload: payload, 14 | }; 15 | }; 16 | 17 | const fetchDataFailed = (payload) => { 18 | return { 19 | type: "CHECK_DATA_FAILED", 20 | payload: payload, 21 | }; 22 | }; 23 | 24 | export const fetchData = (account) => { 25 | return async (dispatch) => { 26 | dispatch(fetchDataRequest()); 27 | try { 28 | let name = await store 29 | .getState() 30 | .blockchain.smartContract.methods.name() 31 | .call(); 32 | let allTokens = await store 33 | .getState() 34 | .blockchain.smartContract.methods.getAllTokens() 35 | .call(); 36 | 37 | dispatch( 38 | fetchDataSuccess({ 39 | name, 40 | allTokens, 41 | }) 42 | ); 43 | } catch (err) { 44 | console.log(err); 45 | dispatch(fetchDataFailed("Could not load data from contract.")); 46 | } 47 | }; 48 | }; 49 | -------------------------------------------------------------------------------- /src/redux/data/dataReducer.js: -------------------------------------------------------------------------------- 1 | const initialState = { 2 | loading: false, 3 | name: "", 4 | allTokens: [], 5 | error: false, 6 | errorMsg: "", 7 | }; 8 | 9 | const dataReducer = (state = initialState, action) => { 10 | switch (action.type) { 11 | case "CHECK_DATA_REQUEST": 12 | return { 13 | ...initialState, 14 | loading: true, 15 | }; 16 | case "CHECK_DATA_SUCCESS": 17 | return { 18 | ...initialState, 19 | loading: false, 20 | name: action.payload.name, 21 | allTokens: action.payload.allTokens, 22 | }; 23 | case "CHECK_DATA_FAILED": 24 | return { 25 | ...initialState, 26 | loading: false, 27 | error: true, 28 | errorMsg: action.payload, 29 | }; 30 | default: 31 | return state; 32 | } 33 | }; 34 | 35 | export default dataReducer; 36 | -------------------------------------------------------------------------------- /src/redux/store.js: -------------------------------------------------------------------------------- 1 | import { applyMiddleware, compose, createStore, combineReducers } from "redux"; 2 | import thunk from "redux-thunk"; 3 | import blockchainReducer from "./blockchain/blockchainReducer"; 4 | import dataReducer from "./data/dataReducer"; 5 | 6 | const rootReducer = combineReducers({ 7 | blockchain: blockchainReducer, 8 | data: dataReducer, 9 | }); 10 | 11 | const middleware = [thunk]; 12 | const composeEnhancers = compose(applyMiddleware(...middleware)); 13 | 14 | const configureStore = () => { 15 | return createStore(rootReducer, composeEnhancers); 16 | }; 17 | 18 | const store = configureStore(); 19 | 20 | export default store; 21 | -------------------------------------------------------------------------------- /src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /src/styles/globalStyles.js: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | 3 | // Used for wrapping a page component 4 | export const Screen = styled.div` 5 | background-color: var(--dark-grey); 6 | background-image: ${({ image }) => (image ? `url(${image})` : "none")}; 7 | background-size: cover; 8 | background-position: center; 9 | width: 100%; 10 | min-height: 100vh; 11 | display: flex; 12 | flex-direction: column; 13 | `; 14 | 15 | // Used for providing space between components 16 | export const SpacerXSmall = styled.div` 17 | height: 8px; 18 | width: 8px; 19 | `; 20 | 21 | // Used for providing space between components 22 | export const SpacerSmall = styled.div` 23 | height: 16px; 24 | width: 16px; 25 | `; 26 | 27 | // Used for providing space between components 28 | export const SpacerMedium = styled.div` 29 | height: 24px; 30 | width: 24px; 31 | `; 32 | 33 | // Used for providing space between components 34 | export const SpacerLarge = styled.div` 35 | height: 32px; 36 | width: 32px; 37 | `; 38 | 39 | // Used for providing a wrapper around a component 40 | export const Container = styled.div` 41 | display: flex; 42 | flex: ${({ flex }) => (flex ? flex : 0)}; 43 | flex-direction: ${({ fd }) => (fd ? fd : "column")}; 44 | justify-content: ${({ jc }) => (jc ? jc : "flex-start")}; 45 | align-items: ${({ ai }) => (ai ? ai : "flex-start")}; 46 | background-color: ${({ test }) => (test ? "pink" : "none")}; 47 | width: 100%; 48 | background-image: ${({ image }) => (image ? `url(${image})` : "none")}; 49 | background-size: cover; 50 | background-position: center; 51 | `; 52 | 53 | export const TextTitle = styled.p` 54 | color: var(--white); 55 | font-size: 20px; 56 | font-weight: 500; 57 | `; 58 | 59 | export const TextSubTitle = styled.p` 60 | color: var(--white); 61 | font-size: 16px; 62 | font-weight: 500; 63 | `; 64 | 65 | export const TextDescription = styled.p` 66 | color: var(--white); 67 | font-size: 14px; 68 | font-weight: 600; 69 | `; 70 | 71 | export const StyledClickable = styled.div` 72 | :active { 73 | opacity: 0.6; 74 | } 75 | `; 76 | -------------------------------------------------------------------------------- /src/styles/reset.css: -------------------------------------------------------------------------------- 1 | html, 2 | body, 3 | div, 4 | span, 5 | applet, 6 | object, 7 | iframe, 8 | h1, 9 | h2, 10 | h3, 11 | h4, 12 | h5, 13 | h6, 14 | p, 15 | blockquote, 16 | pre, 17 | a, 18 | abbr, 19 | acronym, 20 | address, 21 | big, 22 | cite, 23 | code, 24 | del, 25 | dfn, 26 | em, 27 | img, 28 | ins, 29 | kbd, 30 | q, 31 | s, 32 | samp, 33 | small, 34 | strike, 35 | strong, 36 | sub, 37 | sup, 38 | tt, 39 | var, 40 | b, 41 | u, 42 | i, 43 | center, 44 | dl, 45 | dt, 46 | dd, 47 | ol, 48 | ul, 49 | li, 50 | fieldset, 51 | form, 52 | label, 53 | legend, 54 | table, 55 | caption, 56 | tbody, 57 | tfoot, 58 | thead, 59 | tr, 60 | th, 61 | td, 62 | article, 63 | aside, 64 | canvas, 65 | details, 66 | embed, 67 | figure, 68 | figcaption, 69 | footer, 70 | header, 71 | hgroup, 72 | menu, 73 | nav, 74 | output, 75 | ruby, 76 | section, 77 | summary, 78 | time, 79 | mark, 80 | audio, 81 | video { 82 | margin: 0; 83 | padding: 0; 84 | border: 0; 85 | font-size: 100%; 86 | font: inherit; 87 | vertical-align: baseline; 88 | } 89 | /* HTML5 display-role reset for older browsers */ 90 | article, 91 | aside, 92 | details, 93 | figcaption, 94 | figure, 95 | footer, 96 | header, 97 | hgroup, 98 | menu, 99 | nav, 100 | section { 101 | display: block; 102 | } 103 | body { 104 | line-height: 1; 105 | } 106 | ol, 107 | ul { 108 | list-style: none; 109 | } 110 | blockquote, 111 | q { 112 | quotes: none; 113 | } 114 | blockquote:before, 115 | blockquote:after, 116 | q:before, 117 | q:after { 118 | content: ""; 119 | content: none; 120 | } 121 | table { 122 | border-collapse: collapse; 123 | border-spacing: 0; 124 | } 125 | 126 | body { 127 | margin: 0; 128 | font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Oxygen", "Ubuntu", 129 | "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; 130 | -webkit-font-smoothing: antialiased; 131 | -moz-osx-font-smoothing: grayscale; 132 | } 133 | 134 | * { 135 | margin: 0; 136 | padding: 0; 137 | box-sizing: border-box; 138 | } 139 | 140 | code { 141 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 142 | monospace; 143 | } 144 | 145 | body::-webkit-scrollbar { 146 | display: none; 147 | } 148 | 149 | /* Hide scrollbar for IE, Edge and Firefox */ 150 | body { 151 | -ms-overflow-style: none; /* IE and Edge */ 152 | scrollbar-width: none; /* Firefox */ 153 | font-family: "Baloo 2"; 154 | } 155 | 156 | html { 157 | background-color: "#4C4C4C"; 158 | } 159 | 160 | div { 161 | -moz-user-select: none; 162 | -webkit-user-select: none; 163 | -ms-user-select: none; 164 | user-select: none; 165 | -o-user-select: none; 166 | } 167 | -------------------------------------------------------------------------------- /src/styles/theme.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --yellow: #fccd35; 3 | --pink: #ff19e9; 4 | --green: #00cc00; 5 | --white: #ffffff; 6 | --light-grey: #b1b1b1; 7 | --dark-grey: #2b2b2b; 8 | --black: #000000; 9 | } 10 | -------------------------------------------------------------------------------- /src/test.js: -------------------------------------------------------------------------------- 1 | tuple(string,string,uint256,uint256,uint32,uint32,uint32,uint8,uint8,uint8,bool,bool,bool)[]: NPSCZUSr,no swag,0,9252183311529579,1629107003,1629092916,72003,4,50,3,false,false,true,Ashley's 👻,safelips swag,1,1598124591541123,1629107617,1629021347,288006,9,93,3,false,false,true,agCHJbuD,,2,1315411858406600,1629065440,1629030863,36000,2,67,4,false,false,true,Ashley's 🍌,,3,1315411858406600,1629107329,1629100287,72000,4,19,4,false,false,true,GqbWg0hQ,,4,6489365713190396,1629047515,1629029475,72001,2,54,1,false,false,true,Ashley's 🔥,safelips swag,5,1456768224973861,1629107267,1629029837,147600,9,80,1,false,false,true,Ashley's 🌊,,6,1527446408257492,1629107301,1629100319,90001,4,18,2,false,false,true,9yV2D9RZ,,7,5403907985216001,1629050891,1629032859,18000,1,47,4,false,false,true,Unknown,,8,3430338105094931,1629051207,1629032929,3600,1,65,2,false,false,true,Unknown,,9,6341260708312255,1629051243,1629033223,3600,1,36,1,false,false,true,Unknown,,10,3828336283359427,1629051305,1629033269,18000,1,1,1,false,false,true,OY8fAwxm,,11,9174027147231267,1629051435,1629033379,3600,1,6,3,false,false,true,Unknown,,12,5350736777744379,1629116557,1629098419,72002,3,98,1,false,false,true,MwARw8YY,,13,9766186097671807,1629109223,1629091267,25202,3,42,3,false,false,true,QV11BhLs,,14,3214299699040058,1629063466,1629045448,3600,1,14,3,false,false,true,Unknown,,15,3322318902067494,1629063598,1629045480,3600,1,48,1,false,false,true,Unknown,,16,4905842307628945,1629063654,1629045616,36000,2,87,4,false,false,true,78vDmreE,,17,9117391593261885,1629065582,1629047486,3600,1,48,1,false,false,true,Unknown,,18,9145709370246576,1629065710,1629047624,3600,1,72,1,false,false,true,Unknown,,19,6288023737670753,1629065790,1629047748,3600,1,32,1,false,false,true,Unknown,,20,3801717798038676,1629065900,1629047856,18000,1,31,4,false,false,true,Unknown,,21,2629243011506268,1629121369,1629084465,54001,3,78,4,false,false,true,DKGO06LN,icecream swag,22,1447016370160939,1629116243,1629098519,90002,3,78,3,false,false,true,Unknown,,23,8127775905431101,1629109611,1629091633,25201,2,54,3,false,false,true,Unknown,,24,5378509458468684,1629084487,1629066429,3600,1,18,3,false,false,true,Unknown,,25,3412762914314811,1629121217,1629103285,36000,2,75,4,false,false,true,Unknown,,26,3421550509704871,1629121621,1629103589,21601,2,54,3,false,false,true,Unknown,,27,6283629939975723,1629121403,1629085271,54000,3,95,4,false,false,true,Unknown,,28,6739256341587740,1629109501,1629091541,39600,3,73,2,false,false,true,Unknown,,29,3989989894625323,1629121329,1629084763,90000,5,84,1,false,false,true,Unknown,,30,3799520899191161,1629121451,1629098603,36000,2,11,4,false,false,true,Unknown,,31,3506910299115609,1629103455,1629085411,3600,1,70,3,false,false,true,0R2vLSaS,,32,938408255393727,1629122485,1629085473,54000,3,89,2,false,false,true,Unknown,,33,4895270119545666,1629121853,1629098479,36000,2,63,4,false,false,true,Unknown,,34,4154016516930238,1629121705,1629085578,90000,5,72,1,false,false,true,Unknown,,35,6593868303688339,1629109929,1629091757,25200,3,1,1,false,false,true,Unknown,,36,4027334099997170,1629109733,1629091713,36000,2,71,4,false,false,true,Unknown,,37,4533092080412414,1629109695,1629091663,36000,2,53,2,false,false,true,Unknown,,38,6541617008439367,1629110147,1629091973,39600,3,32,1,false,false,true,Unknown,,39,7855629948475112,1629110003,1629091959,36001,2,98,3,false,false,true,Unknown,,40,7896900159984473,1629110227,1629092187,36000,2,95,4,false,false,true,I8QxfIZ4,,41,3334436577470117,1629117571,1629099383,36000,2,45,2,false,false,true,pVCdTV9y,,42,73293379797096,1629117567,1629099433,36000,2,7,4,false,false,true,94Q7ZVXZ,,43,7701286313960044,1629117663,1629099603,72001,2,2,3,false,false,true,VVQHSnMA,,44,5013426811166663,1629118007,1629099849,54001,2,66,3,false,false,true,Trxivut6,,45,6587457647305051,1629118333,1629100251,54000,3,28,1,false,false,true,ys8jZMep,,46,2511294338456091,1629118583,1629100391,54000,3,96,1,false,false,true,yd9C3lnY,,47,1053936099338045,1629118609,1629100453,72001,2,18,3,false,false,true,LpTIJfPH,,48,2202820867549863,1629118627,1629100525,36000,2,69,2,false,false,true,LC6IFjSb,,49,1063659986412318,1629118841,1629100705,36000,2,27,4,false,false,true,tMUASG1M,,50,2838937724278794,1629118853,1629100759,36000,2,59,4,false,false,true,nB0VLB1j,,51,6687202451293699,1629122677,1629101037,198000,11,99,1,false,false,true -------------------------------------------------------------------------------- /test/smartContract.test.js: -------------------------------------------------------------------------------- 1 | const { assert } = require("chai"); 2 | 3 | const SmartContract = artifacts.require("./SmartContract.sol"); 4 | 5 | require("chai").use(require("chai-as-promised")).should(); 6 | 7 | contract("SmartContract", (accounts) => { 8 | let smartContract; 9 | 10 | before(async () => { 11 | smartContract = await SmartContract.deployed(); 12 | }); 13 | 14 | describe("deployment", async () => { 15 | it("deploys successfully", async () => { 16 | const address = await smartContract.address; 17 | assert.notEqual(address, ""); 18 | assert.notEqual(address, 0x0); 19 | }); 20 | }); 21 | 22 | describe("minting", async () => { 23 | it("minted successfully", async () => { 24 | const uri = "https://example.com"; 25 | await smartContract.mint(accounts[0], uri); 26 | const tokenUri = await smartContract.tokenURI(0); 27 | const balanceOfOwner = await smartContract.balanceOf(accounts[0]); 28 | assert.equal(tokenUri, uri); 29 | assert.equal(balanceOfOwner, 1); 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /truffle-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Use this file to configure your truffle project. It's seeded with some 3 | * common settings for different networks and features like migrations, 4 | * compilation and testing. Uncomment the ones you need or modify 5 | * them to suit your project as necessary. 6 | * 7 | * More information about configuration can be found at: 8 | * 9 | * trufflesuite.com/docs/advanced/configuration 10 | * 11 | * To deploy via Infura you'll need a wallet provider (like @truffle/hdwallet-provider) 12 | * to sign your transactions before they're sent to a remote public node. Infura accounts 13 | * are available for free at: infura.io/register. 14 | * 15 | * You'll also need a mnemonic - the twelve word phrase the wallet uses to generate 16 | * public/private key pairs. If you're publishing your code to GitHub make sure you load this 17 | * phrase from a file you've .gitignored so it doesn't accidentally become public. 18 | * 19 | */ 20 | 21 | // const HDWalletProvider = require('@truffle/hdwallet-provider'); 22 | // const infuraKey = "fj4jll3k....."; 23 | // 24 | // const fs = require('fs'); 25 | // const mnemonic = fs.readFileSync(".secret").toString().trim(); 26 | 27 | module.exports = { 28 | /** 29 | * Networks define how you connect to your ethereum client and let you set the 30 | * defaults web3 uses to send transactions. If you don't specify one truffle 31 | * will spin up a development blockchain for you on port 9545 when you 32 | * run `develop` or `test`. You can ask a truffle command to use a specific 33 | * network from the command line, e.g 34 | * 35 | * $ truffle test --network 36 | */ 37 | 38 | networks: { 39 | // Useful for testing. The `development` name is special - truffle uses it by default 40 | // if it's defined here and no other network is specified at the command line. 41 | // You should run a client (like ganache-cli, geth or parity) in a separate terminal 42 | // tab if you use this network and you must also set the `host`, `port` and `network_id` 43 | // options below to some value. 44 | // 45 | development: { 46 | host: "127.0.0.1", // Localhost (default: none) 47 | port: 8545, // Standard Ethereum port (default: none) 48 | network_id: "*", // Any network (default: none) 49 | }, 50 | // Another network with more advanced options... 51 | // advanced: { 52 | // port: 8777, // Custom port 53 | // network_id: 1342, // Custom network 54 | // gas: 8500000, // Gas sent with each transaction (default: ~6700000) 55 | // gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei) 56 | // from:
, // Account to send txs from (default: accounts[0]) 57 | // websocket: true // Enable EventEmitter interface for web3 (default: false) 58 | // }, 59 | // Useful for deploying to a public network. 60 | // NB: It's important to wrap the provider as a function. 61 | // ropsten: { 62 | // provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/YOUR-PROJECT-ID`), 63 | // network_id: 3, // Ropsten's id 64 | // gas: 5500000, // Ropsten has a lower block limit than mainnet 65 | // confirmations: 2, // # of confs to wait between deployments. (default: 0) 66 | // timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50) 67 | // skipDryRun: true // Skip dry run before migrations? (default: false for public nets ) 68 | // }, 69 | // Useful for private networks 70 | // private: { 71 | // provider: () => new HDWalletProvider(mnemonic, `https://network.io`), 72 | // network_id: 2111, // This network is yours, in the cloud. 73 | // production: true // Treats this network as if it was a public net. (default: false) 74 | // } 75 | }, 76 | 77 | // Set default mocha options here, use special reporters etc. 78 | mocha: { 79 | // timeout: 100000 80 | }, 81 | 82 | // Configure your compilers 83 | contracts_build_directory: "./src/contracts/", 84 | compilers: { 85 | solc: { 86 | version: "0.8.0", // Fetch exact version from solc-bin (default: truffle's version) 87 | settings: { 88 | // See the solidity docs for advice about optimization and evmVersion 89 | optimizer: { 90 | enabled: true, 91 | runs: 200, 92 | }, 93 | }, 94 | }, 95 | }, 96 | 97 | // Truffle DB is currently disabled by default; to enable it, change enabled: false to enabled: true 98 | // 99 | // Note: if you migrated your contracts prior to enabling this field in your Truffle project and want 100 | // those previously migrated contracts available in the .db directory, you will need to run the following: 101 | // $ truffle migrate --reset --compile-all 102 | 103 | db: { 104 | enabled: false, 105 | }, 106 | }; 107 | --------------------------------------------------------------------------------