refactor: repo structure (#1)
* chore: update .gitignore folders and add testing script * feat: sites nft interface * refactor: implement interface in the contract file * chore: apply code formatting
This commit is contained in:
parent
f3c49a4261
commit
80a0ae98c1
|
|
@ -1,2 +1,6 @@
|
|||
node_modules
|
||||
.env
|
||||
.env
|
||||
|
||||
# hardhat
|
||||
cache
|
||||
artifacts
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"semi": true,
|
||||
"useTabs": false,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
"endOfLine": "lf",
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.sol",
|
||||
"options": {
|
||||
"printWidth": 80,
|
||||
"tabWidth": 4,
|
||||
"singleQuote": false,
|
||||
"bracketSpacing": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0593067611bf3df2fd92fc9e7ccdc02c.json"
|
||||
}
|
||||
|
|
@ -1,215 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "AccessControl",
|
||||
"sourceName": "@openzeppelin/contracts/access/AccessControl.sol",
|
||||
"abi": [
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "previousAdminRole",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "newAdminRole",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "RoleAdminChanged",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "sender",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "RoleGranted",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "sender",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "RoleRevoked",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "DEFAULT_ADMIN_ROLE",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "getRoleAdmin",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "grantRole",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "hasRole",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "renounceRole",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "revokeRole",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes4",
|
||||
"name": "interfaceId",
|
||||
"type": "bytes4"
|
||||
}
|
||||
],
|
||||
"name": "supportsInterface",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/0593067611bf3df2fd92fc9e7ccdc02c.json"
|
||||
}
|
||||
|
|
@ -1,183 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "IAccessControl",
|
||||
"sourceName": "@openzeppelin/contracts/access/IAccessControl.sol",
|
||||
"abi": [
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "previousAdminRole",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "newAdminRole",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "RoleAdminChanged",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "sender",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "RoleGranted",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "sender",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "RoleRevoked",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"name": "getRoleAdmin",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "",
|
||||
"type": "bytes32"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "grantRole",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "hasRole",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "renounceRole",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes32",
|
||||
"name": "role",
|
||||
"type": "bytes32"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "revokeRole",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,296 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "IERC721",
|
||||
"sourceName": "@openzeppelin/contracts/token/ERC721/IERC721.sol",
|
||||
"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": [
|
||||
{
|
||||
"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": [
|
||||
{
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "IERC721Receiver",
|
||||
"sourceName": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol",
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,341 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "ERC721URIStorage",
|
||||
"sourceName": "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol",
|
||||
"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": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "tokenId",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "getApproved",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"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": "",
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,341 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "IERC721Metadata",
|
||||
"sourceName": "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol",
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Address",
|
||||
"sourceName": "@openzeppelin/contracts/utils/Address.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201e58713a6eff295a92abf82c175d6a315f31c1fc64ac23e7dbf028c76c591b5164736f6c63430008070033",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201e58713a6eff295a92abf82c175d6a315f31c1fc64ac23e7dbf028c76c591b5164736f6c63430008070033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Context",
|
||||
"sourceName": "@openzeppelin/contracts/utils/Context.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Counters",
|
||||
"sourceName": "@openzeppelin/contracts/utils/Counters.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220602113592825ad62d95c619e00edc0704502e442bb30773895f163033daecfb264736f6c63430008070033",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220602113592825ad62d95c619e00edc0704502e442bb30773895f163033daecfb264736f6c63430008070033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "Strings",
|
||||
"sourceName": "@openzeppelin/contracts/utils/Strings.sol",
|
||||
"abi": [],
|
||||
"bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122056469c64a1e87964062dd3f1f85f77a87dc74c763f266916fa2f298af8fc1d5564736f6c63430008070033",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122056469c64a1e87964062dd3f1f85f77a87dc74c763f266916fa2f298af8fc1d5564736f6c63430008070033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "ERC165",
|
||||
"sourceName": "@openzeppelin/contracts/utils/introspection/ERC165.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes4",
|
||||
"name": "interfaceId",
|
||||
"type": "bytes4"
|
||||
}
|
||||
],
|
||||
"name": "supportsInterface",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../../build-info/b529dad98ab8434933b98e1e24265db6.json"
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-artifact-1",
|
||||
"contractName": "IERC165",
|
||||
"sourceName": "@openzeppelin/contracts/utils/introspection/IERC165.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bytes4",
|
||||
"name": "interfaceId",
|
||||
"type": "bytes4"
|
||||
}
|
||||
],
|
||||
"name": "supportsInterface",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/c8114b4655c4b5a873d5988a1e627215.json"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,618 +0,0 @@
|
|||
{
|
||||
"_format": "hh-sol-cache-2",
|
||||
"files": {
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/contracts/SitesNFTs.sol": {
|
||||
"lastModificationDate": 1665618621409,
|
||||
"contentHash": "4d32f22cb097d8415a33387e88e2e387",
|
||||
"sourceName": "contracts/SitesNFTs.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol",
|
||||
"@openzeppelin/contracts/utils/Counters.sol",
|
||||
"@openzeppelin/contracts/access/AccessControl.sol"
|
||||
],
|
||||
"versionPragmas": [
|
||||
"^0.8.7"
|
||||
],
|
||||
"artifacts": [
|
||||
"SitesNFTs"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": {
|
||||
"lastModificationDate": 1664309222619,
|
||||
"contentHash": "8af32effd0536e2971ff8496812a5016",
|
||||
"sourceName": "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"../ERC721.sol"
|
||||
],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"ERC721URIStorage"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/utils/Counters.sol": {
|
||||
"lastModificationDate": 1664309222609,
|
||||
"contentHash": "74654e3ae5d7f39555055dfe244dab7a",
|
||||
"sourceName": "@openzeppelin/contracts/utils/Counters.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"Counters"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol": {
|
||||
"lastModificationDate": 1664309222619,
|
||||
"contentHash": "79ff1a7eb801a525aa315fb7a679eede",
|
||||
"sourceName": "@openzeppelin/contracts/token/ERC721/ERC721.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"./IERC721.sol",
|
||||
"./IERC721Receiver.sol",
|
||||
"./extensions/IERC721Metadata.sol",
|
||||
"../../utils/Address.sol",
|
||||
"../../utils/Context.sol",
|
||||
"../../utils/Strings.sol",
|
||||
"../../utils/introspection/ERC165.sol"
|
||||
],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"ERC721"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/utils/Strings.sol": {
|
||||
"lastModificationDate": 1664309222629,
|
||||
"contentHash": "cf46906c4035f51639a22265066a9e78",
|
||||
"sourceName": "@openzeppelin/contracts/utils/Strings.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"Strings"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol": {
|
||||
"lastModificationDate": 1664309222624,
|
||||
"contentHash": "ec99d946db3685a3630554aa6055bd7f",
|
||||
"sourceName": "@openzeppelin/contracts/token/ERC721/IERC721.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"../../utils/introspection/IERC165.sol"
|
||||
],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"IERC721"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/utils/Context.sol": {
|
||||
"lastModificationDate": 1664309222609,
|
||||
"contentHash": "5f2c5c4b6af2dd4551027144797bc8be",
|
||||
"sourceName": "@openzeppelin/contracts/utils/Context.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"Context"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": {
|
||||
"lastModificationDate": 1664309222624,
|
||||
"contentHash": "c22d4395e33763de693fd440c6fd10e1",
|
||||
"sourceName": "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"IERC721Receiver"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/utils/Address.sol": {
|
||||
"lastModificationDate": 1664309222608,
|
||||
"contentHash": "c476b3895a94798b88a4bb97399e6dfe",
|
||||
"sourceName": "@openzeppelin/contracts/utils/Address.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [],
|
||||
"versionPragmas": [
|
||||
"^0.8.1"
|
||||
],
|
||||
"artifacts": [
|
||||
"Address"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": {
|
||||
"lastModificationDate": 1664309222624,
|
||||
"contentHash": "efbc0d15b80a74e34dbe8da0f3e879bb",
|
||||
"sourceName": "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"../IERC721.sol"
|
||||
],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"IERC721Metadata"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol": {
|
||||
"lastModificationDate": 1664309222612,
|
||||
"contentHash": "0e7db055ce108f9da7bb6686a00287c0",
|
||||
"sourceName": "@openzeppelin/contracts/utils/introspection/ERC165.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"./IERC165.sol"
|
||||
],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"ERC165"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol": {
|
||||
"lastModificationDate": 1664309222623,
|
||||
"contentHash": "03e6768535ac4da0e9756f1d8a4a018a",
|
||||
"sourceName": "@openzeppelin/contracts/utils/introspection/IERC165.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"IERC165"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/access/AccessControl.sol": {
|
||||
"lastModificationDate": 1664309222608,
|
||||
"contentHash": "e6ef731d275b1e7b2995f00fa56d9dab",
|
||||
"sourceName": "@openzeppelin/contracts/access/AccessControl.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"./IAccessControl.sol",
|
||||
"../utils/Context.sol",
|
||||
"../utils/Strings.sol",
|
||||
"../utils/introspection/ERC165.sol"
|
||||
],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"AccessControl"
|
||||
]
|
||||
},
|
||||
"/Users/migue/Documents/psychedelic/sites_nfts/node_modules/@openzeppelin/contracts/access/IAccessControl.sol": {
|
||||
"lastModificationDate": 1664309222621,
|
||||
"contentHash": "57c84298234411cea19c7c284d86be8b",
|
||||
"sourceName": "@openzeppelin/contracts/access/IAccessControl.sol",
|
||||
"solcConfig": {
|
||||
"version": "0.8.7",
|
||||
"settings": {
|
||||
"optimizer": {
|
||||
"enabled": false,
|
||||
"runs": 200
|
||||
},
|
||||
"outputSelection": {
|
||||
"*": {
|
||||
"*": [
|
||||
"abi",
|
||||
"evm.bytecode",
|
||||
"evm.deployedBytecode",
|
||||
"evm.methodIdentifiers",
|
||||
"metadata",
|
||||
"devdoc",
|
||||
"userdoc",
|
||||
"storageLayout",
|
||||
"evm.gasEstimates"
|
||||
],
|
||||
"": [
|
||||
"ast"
|
||||
]
|
||||
}
|
||||
},
|
||||
"metadata": {
|
||||
"useLiteralContent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"imports": [],
|
||||
"versionPragmas": [
|
||||
"^0.8.0"
|
||||
],
|
||||
"artifacts": [
|
||||
"IAccessControl"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +1,23 @@
|
|||
// SPDX-License-Identifier: GPL-3.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8.7;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
|
||||
import "@openzeppelin/contracts/utils/Counters.sol";
|
||||
import "@openzeppelin/contracts/access/AccessControl.sol";
|
||||
import "../interfaces/ISitesNFTs.sol";
|
||||
|
||||
contract SitesNFTs is ERC721URIStorage, AccessControl {
|
||||
|
||||
contract SitesNFTs is ISitesNFTs, ERC721URIStorage, AccessControl {
|
||||
using Counters for Counters.Counter;
|
||||
Counters.Counter private _tokenIds;
|
||||
string private baseURI;
|
||||
|
||||
bytes32 public constant MINTER_ROLE = 0x4d494e5445525f524f4c45000000000000000000000000000000000000000000; // "MINTER_ROLE"
|
||||
bytes32 public constant MINTER_ROLE =
|
||||
0x4d494e5445525f524f4c45000000000000000000000000000000000000000000; // "MINTER_ROLE"
|
||||
|
||||
modifier canMint() {
|
||||
bool isMinterOrAdmin = hasRole(MINTER_ROLE, msg.sender) || hasRole(DEFAULT_ADMIN_ROLE, msg.sender);
|
||||
bool isMinterOrAdmin = hasRole(MINTER_ROLE, msg.sender) ||
|
||||
hasRole(DEFAULT_ADMIN_ROLE, msg.sender);
|
||||
require(isMinterOrAdmin, "Caller has no permission to mint.");
|
||||
_;
|
||||
}
|
||||
|
|
@ -30,7 +32,10 @@ contract SitesNFTs is ERC721URIStorage, AccessControl {
|
|||
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
|
||||
}
|
||||
|
||||
function mint(string memory base64EncodedMetadata, address account) public canMint() returns (uint256) {
|
||||
function mint(
|
||||
string memory base64EncodedMetadata,
|
||||
address account
|
||||
) public override canMint returns (uint256) {
|
||||
uint256 newItemId = _tokenIds.current();
|
||||
_safeMint(account, newItemId);
|
||||
_setTokenURI(newItemId, base64EncodedMetadata);
|
||||
|
|
@ -39,30 +44,43 @@ contract SitesNFTs is ERC721URIStorage, AccessControl {
|
|||
return newItemId;
|
||||
}
|
||||
|
||||
function updateTokenURI(address tokenHolderAddress, uint256 tokenId, string memory base64EncodedMetadata) public canMint() {
|
||||
function updateTokenURI(
|
||||
address tokenHolderAddress,
|
||||
uint256 tokenId,
|
||||
string memory base64EncodedMetadata
|
||||
) public override canMint {
|
||||
address tokenOwner = ownerOf(tokenId);
|
||||
require(tokenOwner == tokenHolderAddress, "Address does not own provided tokenId");
|
||||
require(
|
||||
tokenOwner == tokenHolderAddress,
|
||||
"Address does not own provided tokenId"
|
||||
);
|
||||
_setTokenURI(tokenId, base64EncodedMetadata);
|
||||
}
|
||||
|
||||
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, AccessControl) returns (bool) {
|
||||
function supportsInterface(
|
||||
bytes4 interfaceId
|
||||
)
|
||||
public
|
||||
view
|
||||
virtual
|
||||
override(IERC165, ERC721, AccessControl)
|
||||
returns (bool)
|
||||
{
|
||||
return super.supportsInterface(interfaceId);
|
||||
}
|
||||
|
||||
function setBaseURI(string memory _newBbaseURI) public canChangeBaseURI() returns (string memory) {
|
||||
function setBaseURI(
|
||||
string memory _newBbaseURI
|
||||
) public override canChangeBaseURI returns (string memory) {
|
||||
baseURI = _newBbaseURI;
|
||||
return baseURI;
|
||||
}
|
||||
|
||||
function getCurrentTokenId() public view returns (uint256) {
|
||||
function getCurrentTokenId() public view override returns (uint256) {
|
||||
return _tokenIds.current();
|
||||
}
|
||||
|
||||
function _baseURI() internal view override returns (string memory) {
|
||||
return baseURI;
|
||||
}
|
||||
|
||||
receive() external payable {}
|
||||
|
||||
fallback() external {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,116 +1,122 @@
|
|||
require("@nomiclabs/hardhat-waffle")
|
||||
require("@nomiclabs/hardhat-etherscan")
|
||||
require("hardhat-deploy")
|
||||
require("solidity-coverage")
|
||||
require("hardhat-gas-reporter")
|
||||
require("hardhat-contract-sizer")
|
||||
require("dotenv").config()
|
||||
require('@nomiclabs/hardhat-waffle');
|
||||
require('@nomiclabs/hardhat-etherscan');
|
||||
require('hardhat-deploy');
|
||||
require('solidity-coverage');
|
||||
require('hardhat-gas-reporter');
|
||||
require('hardhat-contract-sizer');
|
||||
require('dotenv').config();
|
||||
|
||||
/**
|
||||
* @type import('hardhat/config').HardhatUserConfig
|
||||
*/
|
||||
|
||||
const MAINNET_RPC_URL =
|
||||
process.env.MAINNET_RPC_URL ||
|
||||
process.env.ALCHEMY_MAINNET_RPC_URL ||
|
||||
"https://eth-mainnet.alchemyapi.io/v2/your-api-key"
|
||||
process.env.MAINNET_RPC_URL ||
|
||||
process.env.ALCHEMY_MAINNET_RPC_URL ||
|
||||
'https://eth-mainnet.alchemyapi.io/v2/your-api-key';
|
||||
const GOERLI_RPC_URL =
|
||||
process.env.GOERLI_RPC_URL || "https://eth-goerli.alchemyapi.io/v2/your-api-key"
|
||||
process.env.GOERLI_RPC_URL ||
|
||||
'https://eth-goerli.alchemyapi.io/v2/your-api-key';
|
||||
const POLYGON_MAINNET_RPC_URL =
|
||||
process.env.POLYGON_MAINNET_RPC_URL || "https://polygon-mainnet.alchemyapi.io/v2/your-api-key"
|
||||
process.env.POLYGON_MAINNET_RPC_URL ||
|
||||
'https://polygon-mainnet.alchemyapi.io/v2/your-api-key';
|
||||
|
||||
const POLYGON_MUMBAI_RPC_URL = process.env.POLYGON_MUMBAI_RPC_URL || "https://polygon-mumbai.g.alchemy.com/v2/aIjNlC4r4aLYOHrdCTFT_JUX6OJsOsu0"
|
||||
const PRIVATE_KEY = process.env.PRIVATE_KEY || "0x"
|
||||
const POLYGON_MUMBAI_RPC_URL =
|
||||
process.env.POLYGON_MUMBAI_RPC_URL ||
|
||||
'https://polygon-mumbai.g.alchemy.com/v2/aIjNlC4r4aLYOHrdCTFT_JUX6OJsOsu0';
|
||||
const PRIVATE_KEY = process.env.PRIVATE_KEY || '0x';
|
||||
// optional
|
||||
const MNEMONIC = process.env.MNEMONIC || "your mnemonic"
|
||||
const MNEMONIC = process.env.MNEMONIC || 'your mnemonic';
|
||||
|
||||
// Your API key for Etherscan, obtain one at https://etherscan.io/
|
||||
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || "Your etherscan API key"
|
||||
const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY || "Your polygonscan API key"
|
||||
const REPORT_GAS = process.env.REPORT_GAS || false
|
||||
const ETHERSCAN_API_KEY =
|
||||
process.env.ETHERSCAN_API_KEY || 'Your etherscan API key';
|
||||
const POLYGONSCAN_API_KEY =
|
||||
process.env.POLYGONSCAN_API_KEY || 'Your polygonscan API key';
|
||||
const REPORT_GAS = process.env.REPORT_GAS || false;
|
||||
|
||||
module.exports = {
|
||||
defaultNetwork: "hardhat",
|
||||
networks: {
|
||||
hardhat: {
|
||||
// // If you want to do some forking, uncomment this
|
||||
// forking: {
|
||||
// url: MAINNET_RPC_URL
|
||||
// }
|
||||
chainId: 31337,
|
||||
},
|
||||
localhost: {
|
||||
chainId: 31337,
|
||||
},
|
||||
// goerli: {
|
||||
// url: GOERLI_RPC_URL,
|
||||
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
|
||||
// // accounts: {
|
||||
// // mnemonic: MNEMONIC,
|
||||
// // },
|
||||
// saveDeployments: true,
|
||||
// chainId: 5,
|
||||
// },
|
||||
// mainnet: {
|
||||
// url: MAINNET_RPC_URL,
|
||||
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
|
||||
// // accounts: {
|
||||
// // mnemonic: MNEMONIC,
|
||||
// // },
|
||||
// saveDeployments: true,
|
||||
// chainId: 1,
|
||||
// },
|
||||
// polygon: {
|
||||
// url: POLYGON_MAINNET_RPC_URL,
|
||||
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
|
||||
// saveDeployments: true,
|
||||
// chainId: 137,
|
||||
// },
|
||||
// poligonMumbai: {
|
||||
// url: POLYGON_MUMBAI_RPC_URL,
|
||||
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
|
||||
// saveDeployments: true,
|
||||
// chainId: 80001,
|
||||
// }
|
||||
defaultNetwork: 'hardhat',
|
||||
networks: {
|
||||
hardhat: {
|
||||
// // If you want to do some forking, uncomment this
|
||||
// forking: {
|
||||
// url: MAINNET_RPC_URL
|
||||
// }
|
||||
chainId: 31337,
|
||||
},
|
||||
etherscan: {
|
||||
// npx hardhat verify --network <NETWORK> <CONTRACT_ADDRESS> <CONSTRUCTOR_PARAMETERS>
|
||||
apiKey: {
|
||||
goerli: ETHERSCAN_API_KEY,
|
||||
polygon: POLYGONSCAN_API_KEY,
|
||||
},
|
||||
localhost: {
|
||||
chainId: 31337,
|
||||
},
|
||||
gasReporter: {
|
||||
enabled: REPORT_GAS,
|
||||
currency: "USD",
|
||||
outputFile: "gas-report.txt",
|
||||
noColors: true,
|
||||
// coinmarketcap: process.env.COINMARKETCAP_API_KEY,
|
||||
// goerli: {
|
||||
// url: GOERLI_RPC_URL,
|
||||
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
|
||||
// // accounts: {
|
||||
// // mnemonic: MNEMONIC,
|
||||
// // },
|
||||
// saveDeployments: true,
|
||||
// chainId: 5,
|
||||
// },
|
||||
// mainnet: {
|
||||
// url: MAINNET_RPC_URL,
|
||||
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
|
||||
// // accounts: {
|
||||
// // mnemonic: MNEMONIC,
|
||||
// // },
|
||||
// saveDeployments: true,
|
||||
// chainId: 1,
|
||||
// },
|
||||
// polygon: {
|
||||
// url: POLYGON_MAINNET_RPC_URL,
|
||||
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
|
||||
// saveDeployments: true,
|
||||
// chainId: 137,
|
||||
// },
|
||||
// poligonMumbai: {
|
||||
// url: POLYGON_MUMBAI_RPC_URL,
|
||||
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
|
||||
// saveDeployments: true,
|
||||
// chainId: 80001,
|
||||
// }
|
||||
},
|
||||
etherscan: {
|
||||
// npx hardhat verify --network <NETWORK> <CONTRACT_ADDRESS> <CONSTRUCTOR_PARAMETERS>
|
||||
apiKey: {
|
||||
goerli: ETHERSCAN_API_KEY,
|
||||
polygon: POLYGONSCAN_API_KEY,
|
||||
},
|
||||
contractSizer: {
|
||||
runOnCompile: false,
|
||||
only: ["NftMarketplace"],
|
||||
},
|
||||
gasReporter: {
|
||||
enabled: REPORT_GAS,
|
||||
currency: 'USD',
|
||||
outputFile: 'gas-report.txt',
|
||||
noColors: true,
|
||||
// coinmarketcap: process.env.COINMARKETCAP_API_KEY,
|
||||
},
|
||||
contractSizer: {
|
||||
runOnCompile: false,
|
||||
only: ['NftMarketplace'],
|
||||
},
|
||||
namedAccounts: {
|
||||
deployer: {
|
||||
default: 0, // here this will by default take the first account as deployer
|
||||
1: 0, // similarly on mainnet it will take the first account as deployer. Note though that depending on how hardhat network are configured, the account 0 on one network can be different than on another
|
||||
},
|
||||
namedAccounts: {
|
||||
deployer: {
|
||||
default: 0, // here this will by default take the first account as deployer
|
||||
1: 0, // similarly on mainnet it will take the first account as deployer. Note though that depending on how hardhat network are configured, the account 0 on one network can be different than on another
|
||||
},
|
||||
player: {
|
||||
default: 1,
|
||||
},
|
||||
player: {
|
||||
default: 1,
|
||||
},
|
||||
solidity: {
|
||||
compilers: [
|
||||
{
|
||||
version: "0.8.7",
|
||||
},
|
||||
{
|
||||
version: "0.4.24",
|
||||
},
|
||||
],
|
||||
},
|
||||
mocha: {
|
||||
timeout: 200000, // 200 seconds max for running tests
|
||||
},
|
||||
}
|
||||
},
|
||||
solidity: {
|
||||
compilers: [
|
||||
{
|
||||
version: '0.8.7',
|
||||
},
|
||||
{
|
||||
version: '0.4.24',
|
||||
},
|
||||
],
|
||||
},
|
||||
mocha: {
|
||||
timeout: 200000, // 200 seconds max for running tests
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8.7;
|
||||
|
||||
import "@openzeppelin/contracts/interfaces/IERC721.sol";
|
||||
import "@openzeppelin/contracts/access/IAccessControl.sol";
|
||||
|
||||
/// @title SitesNFTs - A contract for managing sites NFTs
|
||||
/// @dev See
|
||||
interface ISitesNFTs is IERC721 {
|
||||
function mint(
|
||||
string memory base64EncodedMetadata,
|
||||
address account
|
||||
) external returns (uint256);
|
||||
|
||||
function updateTokenURI(
|
||||
address tokenHolderAddress,
|
||||
uint256 tokenId,
|
||||
string memory base64EncodedMetadata
|
||||
) external;
|
||||
|
||||
function setBaseURI(
|
||||
string memory _newBbaseURI
|
||||
) external returns (string memory);
|
||||
|
||||
function getCurrentTokenId() external view returns (uint256);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,7 +4,8 @@
|
|||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "hardhat test",
|
||||
"format": "prettier --write \"./**/*.{js,ts,sol}\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
@ -29,6 +30,8 @@
|
|||
"hardhat-contract-sizer": "^2.6.1",
|
||||
"hardhat-deploy": "^0.11.15",
|
||||
"hardhat-gas-reporter": "^1.0.9",
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-plugin-solidity": "^1.0.0",
|
||||
"solidity-coverage": "^0.8.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
async function main() {
|
||||
const [deployer] = await ethers.getSigners();
|
||||
|
||||
console.log("Deploying contracts with the account:", deployer.address);
|
||||
|
||||
console.log("Account balance:", (await deployer.getBalance()).toString());
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
const sitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
console.log("SitesNFTs address:", sitesNFTs.address);
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
const [deployer] = await ethers.getSigners();
|
||||
|
||||
console.log('Deploying contracts with the account:', deployer.address);
|
||||
|
||||
console.log('Account balance:', (await deployer.getBalance()).toString());
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
const sitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
console.log('SitesNFTs address:', sitesNFTs.address);
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,232 +1,297 @@
|
|||
const { expect } = require("chai");
|
||||
const { expect } = require('chai');
|
||||
|
||||
describe("SitesNFTs contract", function () {
|
||||
describe("Deployment", () => {
|
||||
it("Deployment should assign the name and the symbol of the ERC721 contract", async () => {
|
||||
const [owner] = await ethers.getSigners();
|
||||
|
||||
const name = "Sites NFTs";
|
||||
const symbol = "SNFT";
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
const contractName = await hardhatSitesNFTs.name();
|
||||
const contractSymbol = await hardhatSitesNFTs.symbol();
|
||||
|
||||
expect(contractName).to.equal(name);
|
||||
expect(contractSymbol).to.equal(symbol);
|
||||
});
|
||||
|
||||
it("Deployment should assign the deployer DEFAULT_ADMIN_ROLE", async () => {
|
||||
const [owner] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
const DEFAULT_ADMIN_ROLE_STRING = ""
|
||||
|
||||
const hasAdminRole = await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE_STRING) , await owner.getAddress());
|
||||
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
});
|
||||
|
||||
it("Deployment should assign initial tokenId to 0", async () => {
|
||||
const [owner] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
const currentTokenId = await hardhatSitesNFTs.getCurrentTokenId();
|
||||
|
||||
expect(currentTokenId).to.equal(0);
|
||||
});
|
||||
describe('SitesNFTs contract', function () {
|
||||
describe('Deployment', () => {
|
||||
it('Deployment should assign the name and the symbol of the ERC721 contract', async () => {
|
||||
const [owner] = await ethers.getSigners();
|
||||
|
||||
const name = 'Sites NFTs';
|
||||
const symbol = 'SNFT';
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const contractName = await hardhatSitesNFTs.name();
|
||||
const contractSymbol = await hardhatSitesNFTs.symbol();
|
||||
|
||||
expect(contractName).to.equal(name);
|
||||
expect(contractSymbol).to.equal(symbol);
|
||||
});
|
||||
|
||||
describe("Access control", () => {
|
||||
it("User with DEFAULT_ADMIN_ROLE should be able to assign MINTER_ROLE to another user", async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
const MINTER_ROLE = "MINTER_ROLE"
|
||||
it('Deployment should assign the deployer DEFAULT_ADMIN_ROLE', async () => {
|
||||
const [owner] = await ethers.getSigners();
|
||||
|
||||
await hardhatSitesNFTs.grantRole(ethers.utils.formatBytes32String(MINTER_ROLE), await address1.getAddress());
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hasMinterRole = await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(MINTER_ROLE), await address1.getAddress());
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
expect(hasMinterRole).to.equal(true);
|
||||
});
|
||||
const DEFAULT_ADMIN_ROLE_STRING = '';
|
||||
|
||||
it("User with DEFAULT_ADMIN_ROLE should be able to assign MINTER_ROLE to himself and still have DEFAULT_ADMIN_ROLE", async () => {
|
||||
const [owner] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
const MINTER_ROLE = "MINTER_ROLE";
|
||||
const DEFAULT_ADMIN_ROLE = "";
|
||||
const hasAdminRole = await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE_STRING),
|
||||
await owner.getAddress()
|
||||
);
|
||||
|
||||
await hardhatSitesNFTs.grantRole(ethers.utils.formatBytes32String(MINTER_ROLE), await owner.getAddress());
|
||||
|
||||
const hasMinterRole = await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(MINTER_ROLE), await owner.getAddress());
|
||||
const hasAdminRole = await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE), await owner.getAddress());
|
||||
|
||||
expect(hasMinterRole).to.equal(true);
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
});
|
||||
|
||||
it("User with DEFAULT_ADMIN_ROLE should be able to assign DEFAULT_ADMIN_ROLE to another user", async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
const DEFAULT_ADMIN_ROLE = "";
|
||||
|
||||
await hardhatSitesNFTs.grantRole(ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE), await address1.getAddress());
|
||||
|
||||
const hasAdminRole = await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE), await address1.getAddress());
|
||||
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
});
|
||||
|
||||
it("User with DEFAULT_ADMIN_ROLE should be able to assign DEFAULT_ADMIN_ROLE to another user and still have DEFAULT_ADMIN_ROLE", async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
const DEFAULT_ADMIN_ROLE = "";
|
||||
|
||||
await hardhatSitesNFTs.grantRole(ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE), await address1.getAddress());
|
||||
|
||||
let hasAdminRole = await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE), await address1.getAddress());
|
||||
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
|
||||
hasAdminRole = await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE), await owner.getAddress());
|
||||
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
});
|
||||
|
||||
it("User without DEFAULT_ADMIN_ROLE shouldnt be able to assign DEFAULT_ADMIN_ROLE to another user", async () => {
|
||||
const [owner, address1, address2] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
const DEFAULT_ADMIN_ROLE = "";
|
||||
|
||||
try {
|
||||
await hardhatSitesNFTs.connect(address1).grantRole(ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE), await address2.getAddress());
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
const hasAdminRole = await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE), await address2.getAddress());
|
||||
|
||||
expect(hasAdminRole).to.equal(false);
|
||||
});
|
||||
|
||||
it("User without DEFAULT_ADMIN_ROLE shouldnt be able to assign MINTER_ROLE to another user", async () => {
|
||||
const [owner, address1, address2] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
|
||||
const MINTER_ROLE = "MINTER_ROLE"
|
||||
|
||||
try {
|
||||
await hardhatSitesNFTs.connect(address1).grantRole(ethers.utils.formatBytes32String(MINTER_ROLE), await address2.getAddress());
|
||||
} catch (e) {}
|
||||
|
||||
const hasMinterRole = await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(MINTER_ROLE), await address2.getAddress());
|
||||
|
||||
expect(hasMinterRole).to.equal(false);
|
||||
});
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
});
|
||||
|
||||
describe("Minting", () => {
|
||||
it("User with DEFAULT_ADMIN_ROLE should be able to mint", async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
it('Deployment should assign initial tokenId to 0', async () => {
|
||||
const [owner] = await ethers.getSigners();
|
||||
|
||||
const tokenURI = "tokenURI";
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
await hardhatSitesNFTs.mint(tokenURI, await address1.getAddress());
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const balance = await hardhatSitesNFTs.balanceOf(await address1.getAddress());
|
||||
const currentTokenId = await hardhatSitesNFTs.getCurrentTokenId();
|
||||
|
||||
expect(balance).to.equal(1);
|
||||
});
|
||||
expect(currentTokenId).to.equal(0);
|
||||
});
|
||||
});
|
||||
|
||||
it("User with MINTER_ROLE should be able to mint", async () => {
|
||||
const [owner, address1, address2] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
describe('Access control', () => {
|
||||
it('User with DEFAULT_ADMIN_ROLE should be able to assign MINTER_ROLE to another user', async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const MINTER_ROLE = "MINTER_ROLE";
|
||||
const tokenURI = "tokenURI";
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
await hardhatSitesNFTs.grantRole(ethers.utils.formatBytes32String(MINTER_ROLE), await address1.getAddress());
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
await hardhatSitesNFTs.hasRole(ethers.utils.formatBytes32String(MINTER_ROLE), await address1.getAddress());
|
||||
|
||||
await hardhatSitesNFTs.connect(address1).mint(tokenURI, await address2.getAddress());
|
||||
const MINTER_ROLE = 'MINTER_ROLE';
|
||||
|
||||
const balance = await hardhatSitesNFTs.balanceOf(await address2.getAddress());
|
||||
await hardhatSitesNFTs.grantRole(
|
||||
ethers.utils.formatBytes32String(MINTER_ROLE),
|
||||
await address1.getAddress()
|
||||
);
|
||||
|
||||
expect(balance).to.equal(1);
|
||||
});
|
||||
const hasMinterRole = await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(MINTER_ROLE),
|
||||
await address1.getAddress()
|
||||
);
|
||||
|
||||
it("User without MINTER_ROLE or DEFAULT_ADMIN_ROLE shouldnt be able to mint", async () => {
|
||||
const [owner, address1, address2] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
expect(hasMinterRole).to.equal(true);
|
||||
});
|
||||
|
||||
const tokenURI = "tokenURI";
|
||||
|
||||
try {
|
||||
await hardhatSitesNFTs.connect(address1).mint(tokenURI, await address2.getAddress());
|
||||
} catch(e) {}
|
||||
it('User with DEFAULT_ADMIN_ROLE should be able to assign MINTER_ROLE to himself and still have DEFAULT_ADMIN_ROLE', async () => {
|
||||
const [owner] = await ethers.getSigners();
|
||||
|
||||
const balance = await hardhatSitesNFTs.balanceOf(await address2.getAddress());
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
expect(balance).to.equal(0);
|
||||
});
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
it("Minted NFT should have data:application/json;base64, baseURI", async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory("SitesNFTs");
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy("Sites NFTs", "SNFT");
|
||||
const MINTER_ROLE = 'MINTER_ROLE';
|
||||
const DEFAULT_ADMIN_ROLE = '';
|
||||
|
||||
const tokenURI = "tokenURI";
|
||||
await hardhatSitesNFTs.grantRole(
|
||||
ethers.utils.formatBytes32String(MINTER_ROLE),
|
||||
await owner.getAddress()
|
||||
);
|
||||
|
||||
await hardhatSitesNFTs.mint(tokenURI, await address1.getAddress());
|
||||
const hasMinterRole = await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(MINTER_ROLE),
|
||||
await owner.getAddress()
|
||||
);
|
||||
const hasAdminRole = await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE),
|
||||
await owner.getAddress()
|
||||
);
|
||||
|
||||
const mintedNFT = await hardhatSitesNFTs.tokenURI(0);
|
||||
expect(hasMinterRole).to.equal(true);
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
});
|
||||
|
||||
expect(mintedNFT.includes("data:application/json;base64,")).to.equal(true);
|
||||
});
|
||||
})
|
||||
});
|
||||
it('User with DEFAULT_ADMIN_ROLE should be able to assign DEFAULT_ADMIN_ROLE to another user', async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const DEFAULT_ADMIN_ROLE = '';
|
||||
|
||||
await hardhatSitesNFTs.grantRole(
|
||||
ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE),
|
||||
await address1.getAddress()
|
||||
);
|
||||
|
||||
const hasAdminRole = await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE),
|
||||
await address1.getAddress()
|
||||
);
|
||||
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
});
|
||||
|
||||
it('User with DEFAULT_ADMIN_ROLE should be able to assign DEFAULT_ADMIN_ROLE to another user and still have DEFAULT_ADMIN_ROLE', async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const DEFAULT_ADMIN_ROLE = '';
|
||||
|
||||
await hardhatSitesNFTs.grantRole(
|
||||
ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE),
|
||||
await address1.getAddress()
|
||||
);
|
||||
|
||||
let hasAdminRole = await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE),
|
||||
await address1.getAddress()
|
||||
);
|
||||
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
|
||||
hasAdminRole = await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE),
|
||||
await owner.getAddress()
|
||||
);
|
||||
|
||||
expect(hasAdminRole).to.equal(true);
|
||||
});
|
||||
|
||||
it('User without DEFAULT_ADMIN_ROLE shouldnt be able to assign DEFAULT_ADMIN_ROLE to another user', async () => {
|
||||
const [owner, address1, address2] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const DEFAULT_ADMIN_ROLE = '';
|
||||
|
||||
try {
|
||||
await hardhatSitesNFTs
|
||||
.connect(address1)
|
||||
.grantRole(
|
||||
ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE),
|
||||
await address2.getAddress()
|
||||
);
|
||||
} catch (e) {}
|
||||
|
||||
const hasAdminRole = await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(DEFAULT_ADMIN_ROLE),
|
||||
await address2.getAddress()
|
||||
);
|
||||
|
||||
expect(hasAdminRole).to.equal(false);
|
||||
});
|
||||
|
||||
it('User without DEFAULT_ADMIN_ROLE shouldnt be able to assign MINTER_ROLE to another user', async () => {
|
||||
const [owner, address1, address2] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const MINTER_ROLE = 'MINTER_ROLE';
|
||||
|
||||
try {
|
||||
await hardhatSitesNFTs
|
||||
.connect(address1)
|
||||
.grantRole(
|
||||
ethers.utils.formatBytes32String(MINTER_ROLE),
|
||||
await address2.getAddress()
|
||||
);
|
||||
} catch (e) {}
|
||||
|
||||
const hasMinterRole = await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(MINTER_ROLE),
|
||||
await address2.getAddress()
|
||||
);
|
||||
|
||||
expect(hasMinterRole).to.equal(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Minting', () => {
|
||||
it('User with DEFAULT_ADMIN_ROLE should be able to mint', async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const tokenURI = 'tokenURI';
|
||||
|
||||
await hardhatSitesNFTs.mint(tokenURI, await address1.getAddress());
|
||||
|
||||
const balance = await hardhatSitesNFTs.balanceOf(
|
||||
await address1.getAddress()
|
||||
);
|
||||
|
||||
expect(balance).to.equal(1);
|
||||
});
|
||||
|
||||
it('User with MINTER_ROLE should be able to mint', async () => {
|
||||
const [owner, address1, address2] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const MINTER_ROLE = 'MINTER_ROLE';
|
||||
const tokenURI = 'tokenURI';
|
||||
|
||||
await hardhatSitesNFTs.grantRole(
|
||||
ethers.utils.formatBytes32String(MINTER_ROLE),
|
||||
await address1.getAddress()
|
||||
);
|
||||
|
||||
await hardhatSitesNFTs.hasRole(
|
||||
ethers.utils.formatBytes32String(MINTER_ROLE),
|
||||
await address1.getAddress()
|
||||
);
|
||||
|
||||
await hardhatSitesNFTs
|
||||
.connect(address1)
|
||||
.mint(tokenURI, await address2.getAddress());
|
||||
|
||||
const balance = await hardhatSitesNFTs.balanceOf(
|
||||
await address2.getAddress()
|
||||
);
|
||||
|
||||
expect(balance).to.equal(1);
|
||||
});
|
||||
|
||||
it('User without MINTER_ROLE or DEFAULT_ADMIN_ROLE shouldnt be able to mint', async () => {
|
||||
const [owner, address1, address2] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const tokenURI = 'tokenURI';
|
||||
|
||||
try {
|
||||
await hardhatSitesNFTs
|
||||
.connect(address1)
|
||||
.mint(tokenURI, await address2.getAddress());
|
||||
} catch (e) {}
|
||||
|
||||
const balance = await hardhatSitesNFTs.balanceOf(
|
||||
await address2.getAddress()
|
||||
);
|
||||
|
||||
expect(balance).to.equal(0);
|
||||
});
|
||||
|
||||
it('Minted NFT should have data:application/json;base64, baseURI', async () => {
|
||||
const [owner, address1] = await ethers.getSigners();
|
||||
|
||||
const SitesNFTs = await ethers.getContractFactory('SitesNFTs');
|
||||
|
||||
const hardhatSitesNFTs = await SitesNFTs.deploy('Sites NFTs', 'SNFT');
|
||||
|
||||
const tokenURI = 'tokenURI';
|
||||
|
||||
await hardhatSitesNFTs.mint(tokenURI, await address1.getAddress());
|
||||
|
||||
const mintedNFT = await hardhatSitesNFTs.tokenURI(0);
|
||||
|
||||
expect(mintedNFT.includes('data:application/json;base64,')).to.equal(
|
||||
true
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue