From aeb4c51a966e9efce10c404392c5b49fdabe76a3 Mon Sep 17 00:00:00 2001 From: Zafei-Erin <897659752@qq.com> Date: Tue, 20 Feb 2024 15:57:03 +0800 Subject: [PATCH] change sm import --- frontend/src/components/ListModal.tsx | 2 +- .../src/components/UpdateListingModal.tsx | 2 +- frontend/src/constant/NFT.json | 403 ++++++++++++++++++ frontend/src/constant/NFTMarketPlace.json | 231 ++++++++++ frontend/src/pages/Create/ProgressModal.tsx | 4 +- frontend/src/pages/Item/BuyModal.tsx | 2 +- frontend/src/pages/test.tsx | 12 +- 7 files changed, 645 insertions(+), 11 deletions(-) create mode 100644 frontend/src/constant/NFT.json create mode 100644 frontend/src/constant/NFTMarketPlace.json diff --git a/frontend/src/components/ListModal.tsx b/frontend/src/components/ListModal.tsx index 3725e2f..33379ef 100644 --- a/frontend/src/components/ListModal.tsx +++ b/frontend/src/components/ListModal.tsx @@ -13,7 +13,7 @@ import { ethers } from "ethers"; import { ReactNode, useState } from "react"; import { Spinner } from "@/assets"; -import NFTMarketPlace from "../../../smart_contract/artifacts/contracts/NFTMarketplace.sol/NFTMarketPlace.json"; +import NFTMarketPlace from "@/constant/NFTMarketPlace.json"; type ListModalProps = { tokenId: number; diff --git a/frontend/src/components/UpdateListingModal.tsx b/frontend/src/components/UpdateListingModal.tsx index fbc35bd..23f2942 100644 --- a/frontend/src/components/UpdateListingModal.tsx +++ b/frontend/src/components/UpdateListingModal.tsx @@ -15,7 +15,7 @@ import { ethers } from "ethers"; import { ReactNode, useState } from "react"; import useSWR, { Fetcher } from "swr"; -import NFTMarketPlace from "../../../smart_contract/artifacts/contracts/NFTMarketplace.sol/NFTMarketPlace.json"; +import NFTMarketPlace from "@/constant/NFTMarketPlace.json"; type ListModalProps = { tokenId: number; diff --git a/frontend/src/constant/NFT.json b/frontend/src/constant/NFT.json new file mode 100644 index 0000000..438c972 --- /dev/null +++ b/frontend/src/constant/NFT.json @@ -0,0 +1,403 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "NFT", + "sourceName": "contracts/NFT.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "marketplaceAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_fromTokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toTokenId", + "type": "uint256" + } + ], + "name": "BatchMetadataUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + } + ], + "name": "MetadataUpdate", + "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": "string", + "name": "tokenURI", + "type": "string" + } + ], + "name": "createToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "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": "0x60806040523480156200001157600080fd5b50604051620018023803806200180283398101604081905262000034916200016e565b604080518082018252601081526f4d657461766572736520546f6b656e7360801b6020808301918252835180850190945260048452631351551560e21b9084015281519192916200008891600091620000c8565b5080516200009e906001906020840190620000c8565b5050600880546001600160a01b0319166001600160a01b03939093169290921790915550620001db565b828054620000d6906200019e565b90600052602060002090601f016020900481019282620000fa576000855562000145565b82601f106200011557805160ff191683800117855562000145565b8280016001018555821562000145579182015b828111156200014557825182559160200191906001019062000128565b506200015392915062000157565b5090565b5b8082111562000153576000815560010162000158565b60006020828403121562000180578081fd5b81516001600160a01b038116811462000197578182fd5b9392505050565b600181811c90821680620001b357607f821691505b60208210811415620001d557634e487b7160e01b600052602260045260246000fd5b50919050565b61161780620001eb6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80636352211e1161008c578063a22cb46511610066578063a22cb465146101e1578063b88d4fde146101f4578063c87b56dd14610207578063e985e9c51461021a57600080fd5b80636352211e146101b357806370a08231146101c657806395d89b41146101d957600080fd5b8063095ea7b3116100c8578063095ea7b31461015757806323b872dd1461016c57806342842e0e1461017f57806345576f941461019257600080fd5b806301ffc9a7146100ef57806306fdde0314610117578063081812fc1461012c575b600080fd5b6101026100fd366004611329565b610256565b60405190151581526020015b60405180910390f35b61011f610281565b60405161010e9190611457565b61013f61013a3660046113a7565b610313565b6040516001600160a01b03909116815260200161010e565b61016a610165366004611300565b61033a565b005b61016a61017a366004611212565b610455565b61016a61018d366004611212565b610486565b6101a56101a0366004611361565b6104a1565b60405190815260200161010e565b61013f6101c13660046113a7565b6104e9565b6101a56101d43660046111c6565b610549565b61011f6105cf565b61016a6101ef3660046112c6565b6105de565b61016a61020236600461124d565b6105ed565b61011f6102153660046113a7565b610625565b6101026102283660046111e0565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b03198216632483248360e11b148061027b575061027b82610736565b92915050565b6060600080546102909061157a565b80601f01602080910402602001604051908101604052809291908181526020018280546102bc9061157a565b80156103095780601f106102de57610100808354040283529160200191610309565b820191906000526020600020905b8154815290600101906020018083116102ec57829003601f168201915b5050505050905090565b600061031e82610786565b506000908152600460205260409020546001600160a01b031690565b6000610345826104e9565b9050806001600160a01b0316836001600160a01b031614156103b85760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806103d457506103d48133610228565b6104465760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016103af565b61045083836107e8565b505050565b61045f3382610856565b61047b5760405162461bcd60e51b81526004016103af9061146a565b6104508383836108d4565b610450838383604051806020016040528060008152506105ed565b60006104b1600780546001019055565b60006104bc60075490565b90506104c83382610a38565b6104d28184610bc3565b60085461027b906001600160a01b031660016105de565b6000818152600260205260408120546001600160a01b03168061027b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103af565b60006001600160a01b0382166105b35760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103af565b506001600160a01b031660009081526003602052604090205490565b6060600180546102909061157a565b6105e9338383610c95565b5050565b6105f73383610856565b6106135760405162461bcd60e51b81526004016103af9061146a565b61061f84848484610d64565b50505050565b606061063082610786565b600082815260066020526040812080546106499061157a565b80601f01602080910402602001604051908101604052809291908181526020018280546106759061157a565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905060006106e060408051602081019091526000815290565b90508051600014156106f3575092915050565b81511561072557808260405160200161070d9291906113eb565b60405160208183030381529060405292505050919050565b61072e84610d97565b949350505050565b60006001600160e01b031982166380ac58cd60e01b148061076757506001600160e01b03198216635b5e139f60e01b145b8061027b57506301ffc9a760e01b6001600160e01b031983161461027b565b6000818152600260205260409020546001600160a01b03166107e55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103af565b50565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061081d826104e9565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080610862836104e9565b9050806001600160a01b0316846001600160a01b031614806108a957506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061072e5750836001600160a01b03166108c284610313565b6001600160a01b031614949350505050565b826001600160a01b03166108e7826104e9565b6001600160a01b03161461090d5760405162461bcd60e51b81526004016103af90611509565b6001600160a01b03821661096f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016103af565b826001600160a01b0316610982826104e9565b6001600160a01b0316146109a85760405162461bcd60e51b81526004016103af90611509565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216610a8e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103af565b6000818152600260205260409020546001600160a01b031615610af35760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016103af565b6000818152600260205260409020546001600160a01b031615610b585760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016103af565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000828152600260205260409020546001600160a01b0316610c3e5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016103af565b60008281526006602090815260409091208251610c5d9284019061109b565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b816001600160a01b0316836001600160a01b03161415610cf75760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016103af565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610d6f8484846108d4565b610d7b84848484610e0b565b61061f5760405162461bcd60e51b81526004016103af906114b7565b6060610da282610786565b6000610db960408051602081019091526000815290565b90506000815111610dd95760405180602001604052806000815250610e04565b80610de384610f18565b604051602001610df49291906113eb565b6040516020818303038152906040525b9392505050565b60006001600160a01b0384163b15610f0d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610e4f90339089908890889060040161141a565b602060405180830381600087803b158015610e6957600080fd5b505af1925050508015610e99575060408051601f3d908101601f19168201909252610e9691810190611345565b60015b610ef3573d808015610ec7576040519150601f19603f3d011682016040523d82523d6000602084013e610ecc565b606091505b508051610eeb5760405162461bcd60e51b81526004016103af906114b7565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061072e565b506001949350505050565b60606000610f2583610fc3565b600101905060008167ffffffffffffffff811115610f5357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610f7d576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610fb657610fbb565b610f87565b509392505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106110025772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061102e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061104c57662386f26fc10000830492506010015b6305f5e1008310611064576305f5e100830492506008015b612710831061107857612710830492506004015b6064831061108a576064830492506002015b600a831061027b5760010192915050565b8280546110a79061157a565b90600052602060002090601f0160209004810192826110c9576000855561110f565b82601f106110e257805160ff191683800117855561110f565b8280016001018555821561110f579182015b8281111561110f5782518255916020019190600101906110f4565b5061111b92915061111f565b5090565b5b8082111561111b5760008155600101611120565b600067ffffffffffffffff8084111561114f5761114f6115b5565b604051601f8501601f19908116603f01168101908282118183101715611177576111776115b5565b8160405280935085815286868601111561119057600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146111c157600080fd5b919050565b6000602082840312156111d7578081fd5b610e04826111aa565b600080604083850312156111f2578081fd5b6111fb836111aa565b9150611209602084016111aa565b90509250929050565b600080600060608486031215611226578081fd5b61122f846111aa565b925061123d602085016111aa565b9150604084013590509250925092565b60008060008060808587031215611262578081fd5b61126b856111aa565b9350611279602086016111aa565b925060408501359150606085013567ffffffffffffffff81111561129b578182fd5b8501601f810187136112ab578182fd5b6112ba87823560208401611134565b91505092959194509250565b600080604083850312156112d8578182fd5b6112e1836111aa565b9150602083013580151581146112f5578182fd5b809150509250929050565b60008060408385031215611312578182fd5b61131b836111aa565b946020939093013593505050565b60006020828403121561133a578081fd5b8135610e04816115cb565b600060208284031215611356578081fd5b8151610e04816115cb565b600060208284031215611372578081fd5b813567ffffffffffffffff811115611388578182fd5b8201601f81018413611398578182fd5b61072e84823560208401611134565b6000602082840312156113b8578081fd5b5035919050565b600081518084526113d781602086016020860161154e565b601f01601f19169290920160200192915050565b600083516113fd81846020880161154e565b83519083019061141181836020880161154e565b01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061144d908301846113bf565b9695505050505050565b602081526000610e0460208301846113bf565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60005b83811015611569578181015183820152602001611551565b8381111561061f5750506000910152565b600181811c9082168061158e57607f821691505b602082108114156115af57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160e01b0319811681146107e557600080fdfea264697066735822122031bd185f5f2f585434c631e6b485902bfe94ab9a5ac67ef2ddcd6aca980a215c64736f6c63430008040033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80636352211e1161008c578063a22cb46511610066578063a22cb465146101e1578063b88d4fde146101f4578063c87b56dd14610207578063e985e9c51461021a57600080fd5b80636352211e146101b357806370a08231146101c657806395d89b41146101d957600080fd5b8063095ea7b3116100c8578063095ea7b31461015757806323b872dd1461016c57806342842e0e1461017f57806345576f941461019257600080fd5b806301ffc9a7146100ef57806306fdde0314610117578063081812fc1461012c575b600080fd5b6101026100fd366004611329565b610256565b60405190151581526020015b60405180910390f35b61011f610281565b60405161010e9190611457565b61013f61013a3660046113a7565b610313565b6040516001600160a01b03909116815260200161010e565b61016a610165366004611300565b61033a565b005b61016a61017a366004611212565b610455565b61016a61018d366004611212565b610486565b6101a56101a0366004611361565b6104a1565b60405190815260200161010e565b61013f6101c13660046113a7565b6104e9565b6101a56101d43660046111c6565b610549565b61011f6105cf565b61016a6101ef3660046112c6565b6105de565b61016a61020236600461124d565b6105ed565b61011f6102153660046113a7565b610625565b6101026102283660046111e0565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b03198216632483248360e11b148061027b575061027b82610736565b92915050565b6060600080546102909061157a565b80601f01602080910402602001604051908101604052809291908181526020018280546102bc9061157a565b80156103095780601f106102de57610100808354040283529160200191610309565b820191906000526020600020905b8154815290600101906020018083116102ec57829003601f168201915b5050505050905090565b600061031e82610786565b506000908152600460205260409020546001600160a01b031690565b6000610345826104e9565b9050806001600160a01b0316836001600160a01b031614156103b85760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806103d457506103d48133610228565b6104465760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c00000060648201526084016103af565b61045083836107e8565b505050565b61045f3382610856565b61047b5760405162461bcd60e51b81526004016103af9061146a565b6104508383836108d4565b610450838383604051806020016040528060008152506105ed565b60006104b1600780546001019055565b60006104bc60075490565b90506104c83382610a38565b6104d28184610bc3565b60085461027b906001600160a01b031660016105de565b6000818152600260205260408120546001600160a01b03168061027b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103af565b60006001600160a01b0382166105b35760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103af565b506001600160a01b031660009081526003602052604090205490565b6060600180546102909061157a565b6105e9338383610c95565b5050565b6105f73383610856565b6106135760405162461bcd60e51b81526004016103af9061146a565b61061f84848484610d64565b50505050565b606061063082610786565b600082815260066020526040812080546106499061157a565b80601f01602080910402602001604051908101604052809291908181526020018280546106759061157a565b80156106c25780601f10610697576101008083540402835291602001916106c2565b820191906000526020600020905b8154815290600101906020018083116106a557829003601f168201915b5050505050905060006106e060408051602081019091526000815290565b90508051600014156106f3575092915050565b81511561072557808260405160200161070d9291906113eb565b60405160208183030381529060405292505050919050565b61072e84610d97565b949350505050565b60006001600160e01b031982166380ac58cd60e01b148061076757506001600160e01b03198216635b5e139f60e01b145b8061027b57506301ffc9a760e01b6001600160e01b031983161461027b565b6000818152600260205260409020546001600160a01b03166107e55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103af565b50565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061081d826104e9565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080610862836104e9565b9050806001600160a01b0316846001600160a01b031614806108a957506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061072e5750836001600160a01b03166108c284610313565b6001600160a01b031614949350505050565b826001600160a01b03166108e7826104e9565b6001600160a01b03161461090d5760405162461bcd60e51b81526004016103af90611509565b6001600160a01b03821661096f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016103af565b826001600160a01b0316610982826104e9565b6001600160a01b0316146109a85760405162461bcd60e51b81526004016103af90611509565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216610a8e5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103af565b6000818152600260205260409020546001600160a01b031615610af35760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016103af565b6000818152600260205260409020546001600160a01b031615610b585760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016103af565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000828152600260205260409020546001600160a01b0316610c3e5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b60648201526084016103af565b60008281526006602090815260409091208251610c5d9284019061109b565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b816001600160a01b0316836001600160a01b03161415610cf75760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016103af565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610d6f8484846108d4565b610d7b84848484610e0b565b61061f5760405162461bcd60e51b81526004016103af906114b7565b6060610da282610786565b6000610db960408051602081019091526000815290565b90506000815111610dd95760405180602001604052806000815250610e04565b80610de384610f18565b604051602001610df49291906113eb565b6040516020818303038152906040525b9392505050565b60006001600160a01b0384163b15610f0d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610e4f90339089908890889060040161141a565b602060405180830381600087803b158015610e6957600080fd5b505af1925050508015610e99575060408051601f3d908101601f19168201909252610e9691810190611345565b60015b610ef3573d808015610ec7576040519150601f19603f3d011682016040523d82523d6000602084013e610ecc565b606091505b508051610eeb5760405162461bcd60e51b81526004016103af906114b7565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061072e565b506001949350505050565b60606000610f2583610fc3565b600101905060008167ffffffffffffffff811115610f5357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610f7d576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084610fb657610fbb565b610f87565b509392505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106110025772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061102e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061104c57662386f26fc10000830492506010015b6305f5e1008310611064576305f5e100830492506008015b612710831061107857612710830492506004015b6064831061108a576064830492506002015b600a831061027b5760010192915050565b8280546110a79061157a565b90600052602060002090601f0160209004810192826110c9576000855561110f565b82601f106110e257805160ff191683800117855561110f565b8280016001018555821561110f579182015b8281111561110f5782518255916020019190600101906110f4565b5061111b92915061111f565b5090565b5b8082111561111b5760008155600101611120565b600067ffffffffffffffff8084111561114f5761114f6115b5565b604051601f8501601f19908116603f01168101908282118183101715611177576111776115b5565b8160405280935085815286868601111561119057600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b03811681146111c157600080fd5b919050565b6000602082840312156111d7578081fd5b610e04826111aa565b600080604083850312156111f2578081fd5b6111fb836111aa565b9150611209602084016111aa565b90509250929050565b600080600060608486031215611226578081fd5b61122f846111aa565b925061123d602085016111aa565b9150604084013590509250925092565b60008060008060808587031215611262578081fd5b61126b856111aa565b9350611279602086016111aa565b925060408501359150606085013567ffffffffffffffff81111561129b578182fd5b8501601f810187136112ab578182fd5b6112ba87823560208401611134565b91505092959194509250565b600080604083850312156112d8578182fd5b6112e1836111aa565b9150602083013580151581146112f5578182fd5b809150509250929050565b60008060408385031215611312578182fd5b61131b836111aa565b946020939093013593505050565b60006020828403121561133a578081fd5b8135610e04816115cb565b600060208284031215611356578081fd5b8151610e04816115cb565b600060208284031215611372578081fd5b813567ffffffffffffffff811115611388578182fd5b8201601f81018413611398578182fd5b61072e84823560208401611134565b6000602082840312156113b8578081fd5b5035919050565b600081518084526113d781602086016020860161154e565b601f01601f19169290920160200192915050565b600083516113fd81846020880161154e565b83519083019061141181836020880161154e565b01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061144d908301846113bf565b9695505050505050565b602081526000610e0460208301846113bf565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60005b83811015611569578181015183820152602001611551565b8381111561061f5750506000910152565b600181811c9082168061158e57607f821691505b602082108114156115af57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160e01b0319811681146107e557600080fdfea264697066735822122031bd185f5f2f585434c631e6b485902bfe94ab9a5ac67ef2ddcd6aca980a215c64736f6c63430008040033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/frontend/src/constant/NFTMarketPlace.json b/frontend/src/constant/NFTMarketPlace.json new file mode 100644 index 0000000..80a3860 --- /dev/null +++ b/frontend/src/constant/NFTMarketPlace.json @@ -0,0 +1,231 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "NFTMarketPlace", + "sourceName": "contracts/NFTMarketplace.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "itemId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "nftContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "listed", + "type": "bool" + } + ], + "name": "MarketItemCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "cancelListing", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "changePrice", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nftContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "createMarketItem", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nftContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "createMarketListing", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nftContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "createMarketSale", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "fetchMarketItems", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "itemId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "nftContract", + "type": "address" + }, + { + "internalType": "address payable", + "name": "creator", + "type": "address" + }, + { + "internalType": "address payable", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "listed", + "type": "bool" + } + ], + "internalType": "struct NFTMarketPlace.MarketItem[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getListingPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_listingPrice", + "type": "uint256" + } + ], + "name": "updateListingPrice", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405264e8d4a5100060035534801561001957600080fd5b506001600055600280546001600160a01b03191633179055610cd3806100406000396000f3fe60806040526004361061007b5760003560e01c8063b3de019c1161004e578063b3de019c146100f1578063c23b139e14610104578063c30ad5e714610117578063dd5f85181461012a57600080fd5b80630f08efe01461008057806312e85585146100ab578063305a67a8146100c9578063ae677aa3146100de575b600080fd5b34801561008c57600080fd5b5061009561013d565b6040516100a29190610b76565b60405180910390f35b3480156100b757600080fd5b506003546040519081526020016100a2565b6100dc6100d7366004610b3d565b6102b9565b005b6100dc6100ec366004610b3d565b6103da565b6100dc6100ff366004610b55565b610452565b6100dc610112366004610ae2565b610566565b6100dc610125366004610b0b565b610749565b6100dc610138366004610ae2565b6108d0565b6060600061014a60015490565b905060008167ffffffffffffffff81111561017557634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156101dc57816020015b6040805160e08101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c082015282526000199092019101816101935790505b50905060005b828110156102b25760006004816101fa846001610c54565b81526020808201929092526040908101600020815160e0810183528154815260018201549381019390935260028101546001600160a01b039081169284019290925260038101548216606084015260048101549091166080830152600581015460a0830152600681015460ff16151560c0830152845190925084908490811061029357634e487b7160e01b600052603260045260246000fd5b60200260200101819052505080806102aa90610c6c565b9150506101e2565b5092915050565b60006102c460015490565b90506000805b8281101561031a5783600460006102e2846001610c54565b815260200190815260200160002060010154141561030857610305816001610c54565b91505b8061031281610c6c565b9150506102ca565b50600081815260046020819052604090912001546001600160a01b03161561038457600081815260046020819052604090912001546001600160a01b0316331461037f5760405162461bcd60e51b815260040161037690610c0a565b60405180910390fd5b6103bd565b6000818152600460205260409020600301546001600160a01b031633146103bd5760405162461bcd60e51b815260040161037690610c0a565b6000908152600460205260409020600601805460ff191690555050565b6002546001600160a01b0316331461044d5760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79206d61726b6574706c616365206f776e65722063616e20757064617460448201526f32903634b9ba34b73390383934b1b29760811b6064820152608401610376565b600355565b600061045d60015490565b90506000805b828110156104b357846004600061047b846001610c54565b81526020019081526020016000206001015414156104a15761049e816001610c54565b91505b806104ab81610c6c565b915050610463565b50600081815260046020819052604090912001546001600160a01b03161561051457600081815260046020819052604090912001546001600160a01b0316331461050f5760405162461bcd60e51b815260040161037690610c0a565b61054d565b6000818152600460205260409020600301546001600160a01b0316331461054d5760405162461bcd60e51b815260040161037690610c0a565b6000908152600460205260409020600501919091555050565b61056e610a6c565b600061057960015490565b90506000805b828110156105cf578360046000610597846001610c54565b81526020019081526020016000206001015414156105bd576105ba816001610c54565b91505b806105c781610c6c565b91505061057f565b50600081815260046020526040902060050154348114610659576040805162461bcd60e51b81526020600482015260248101919091527f506c65617365207375626d6974207468652061736b696e67207072696365206960448201527f6e206f7264657220746f20636f6d706c657465207468652070757263686173656064820152608401610376565b60008281526004602081905260408083209091015490516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156106a3573d6000803e3d6000fd5b506040516323b872dd60e01b8152306004820152336024820152604481018590526001600160a01b038616906323b872dd90606401600060405180830381600087803b1580156106f257600080fd5b505af1158015610706573d6000803e3d6000fd5b5050506000928352505060046020819052604090912090810180546001600160a01b03191633179055600601805460ff19169055506107456001600055565b5050565b610751610a6c565b600081116107a15760405162461bcd60e51b815260206004820152601c60248201527f5072696365206d757374206265206174206c65617374203120776569000000006044820152606401610376565b60035434146107fe5760405162461bcd60e51b8152602060048201526024808201527f5072696365206d75737420626520657175616c20746f206c697374696e6720706044820152637269636560e01b6064820152608401610376565b600061080960015490565b90506000805b8281101561085f578460046000610827846001610c54565b815260200190815260200160002060010154141561084d5761084a816001610c54565b91505b8061085781610c6c565b91505061080f565b5060008181526004602052604080822060068101805460ff1916600117905560050185905560025460035491516001600160a01b039091169282156108fc02929190818181858888f193505050501580156108be573d6000803e3d6000fd5b5050506108cb6001600055565b505050565b6108d8610a6c565b6108e6600180546001019055565b60006108f160015490565b6040805160e08101825282815260208082018681526001600160a01b03888116848601818152336060870181815260006080890181815260a08a0182815260c08b018381528d845260049a8b90528c84209b518c55985160018c0155945160028b0180546001600160a01b0319908116928a16929092179055925160038b018054851691891691909117905551898901805490931696169590951790559051600587015592516006909501805460ff19169515159590951790945593516323b872dd60e01b8152918201523060248201526044810186905292935090916323b872dd90606401600060405180830381600087803b1580156109f157600080fd5b505af1158015610a05573d6000803e3d6000fd5b505060408051338152600060208201819052818301869052606082015290516001600160a01b038816935086925085917f559a3a6d05e6c668564a802e14c9315ffcce4efdb13bf30a43c6790b957c36be919081900360800190a450506107456001600055565b60026000541415610abf5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610376565b6002600055565b80356001600160a01b0381168114610add57600080fd5b919050565b60008060408385031215610af4578182fd5b610afd83610ac6565b946020939093013593505050565b600080600060608486031215610b1f578081fd5b610b2884610ac6565b95602085013595506040909401359392505050565b600060208284031215610b4e578081fd5b5035919050565b60008060408385031215610b67578182fd5b50508035926020909101359150565b602080825282518282018190526000919060409081850190868401855b82811015610bfd578151805185528681015187860152858101516001600160a01b03908116878701526060808301518216908701526080808301519091169086015260a0808201519086015260c09081015115159085015260e09093019290850190600101610b93565b5091979650505050505050565b6020808252602a908201527f4f6e6c79206974656d206f776e65722063616e20706572666f726d20746869736040820152691037b832b930ba34b7b760b11b606082015260800190565b60008219821115610c6757610c67610c87565b500190565b6000600019821415610c8057610c80610c87565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220879d7ed84a72741864e9c9ec7323d520ae7092613e4a84201778449224bf1b7164736f6c63430008040033", + "deployedBytecode": "0x60806040526004361061007b5760003560e01c8063b3de019c1161004e578063b3de019c146100f1578063c23b139e14610104578063c30ad5e714610117578063dd5f85181461012a57600080fd5b80630f08efe01461008057806312e85585146100ab578063305a67a8146100c9578063ae677aa3146100de575b600080fd5b34801561008c57600080fd5b5061009561013d565b6040516100a29190610b76565b60405180910390f35b3480156100b757600080fd5b506003546040519081526020016100a2565b6100dc6100d7366004610b3d565b6102b9565b005b6100dc6100ec366004610b3d565b6103da565b6100dc6100ff366004610b55565b610452565b6100dc610112366004610ae2565b610566565b6100dc610125366004610b0b565b610749565b6100dc610138366004610ae2565b6108d0565b6060600061014a60015490565b905060008167ffffffffffffffff81111561017557634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156101dc57816020015b6040805160e08101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c082015282526000199092019101816101935790505b50905060005b828110156102b25760006004816101fa846001610c54565b81526020808201929092526040908101600020815160e0810183528154815260018201549381019390935260028101546001600160a01b039081169284019290925260038101548216606084015260048101549091166080830152600581015460a0830152600681015460ff16151560c0830152845190925084908490811061029357634e487b7160e01b600052603260045260246000fd5b60200260200101819052505080806102aa90610c6c565b9150506101e2565b5092915050565b60006102c460015490565b90506000805b8281101561031a5783600460006102e2846001610c54565b815260200190815260200160002060010154141561030857610305816001610c54565b91505b8061031281610c6c565b9150506102ca565b50600081815260046020819052604090912001546001600160a01b03161561038457600081815260046020819052604090912001546001600160a01b0316331461037f5760405162461bcd60e51b815260040161037690610c0a565b60405180910390fd5b6103bd565b6000818152600460205260409020600301546001600160a01b031633146103bd5760405162461bcd60e51b815260040161037690610c0a565b6000908152600460205260409020600601805460ff191690555050565b6002546001600160a01b0316331461044d5760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79206d61726b6574706c616365206f776e65722063616e20757064617460448201526f32903634b9ba34b73390383934b1b29760811b6064820152608401610376565b600355565b600061045d60015490565b90506000805b828110156104b357846004600061047b846001610c54565b81526020019081526020016000206001015414156104a15761049e816001610c54565b91505b806104ab81610c6c565b915050610463565b50600081815260046020819052604090912001546001600160a01b03161561051457600081815260046020819052604090912001546001600160a01b0316331461050f5760405162461bcd60e51b815260040161037690610c0a565b61054d565b6000818152600460205260409020600301546001600160a01b0316331461054d5760405162461bcd60e51b815260040161037690610c0a565b6000908152600460205260409020600501919091555050565b61056e610a6c565b600061057960015490565b90506000805b828110156105cf578360046000610597846001610c54565b81526020019081526020016000206001015414156105bd576105ba816001610c54565b91505b806105c781610c6c565b91505061057f565b50600081815260046020526040902060050154348114610659576040805162461bcd60e51b81526020600482015260248101919091527f506c65617365207375626d6974207468652061736b696e67207072696365206960448201527f6e206f7264657220746f20636f6d706c657465207468652070757263686173656064820152608401610376565b60008281526004602081905260408083209091015490516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156106a3573d6000803e3d6000fd5b506040516323b872dd60e01b8152306004820152336024820152604481018590526001600160a01b038616906323b872dd90606401600060405180830381600087803b1580156106f257600080fd5b505af1158015610706573d6000803e3d6000fd5b5050506000928352505060046020819052604090912090810180546001600160a01b03191633179055600601805460ff19169055506107456001600055565b5050565b610751610a6c565b600081116107a15760405162461bcd60e51b815260206004820152601c60248201527f5072696365206d757374206265206174206c65617374203120776569000000006044820152606401610376565b60035434146107fe5760405162461bcd60e51b8152602060048201526024808201527f5072696365206d75737420626520657175616c20746f206c697374696e6720706044820152637269636560e01b6064820152608401610376565b600061080960015490565b90506000805b8281101561085f578460046000610827846001610c54565b815260200190815260200160002060010154141561084d5761084a816001610c54565b91505b8061085781610c6c565b91505061080f565b5060008181526004602052604080822060068101805460ff1916600117905560050185905560025460035491516001600160a01b039091169282156108fc02929190818181858888f193505050501580156108be573d6000803e3d6000fd5b5050506108cb6001600055565b505050565b6108d8610a6c565b6108e6600180546001019055565b60006108f160015490565b6040805160e08101825282815260208082018681526001600160a01b03888116848601818152336060870181815260006080890181815260a08a0182815260c08b018381528d845260049a8b90528c84209b518c55985160018c0155945160028b0180546001600160a01b0319908116928a16929092179055925160038b018054851691891691909117905551898901805490931696169590951790559051600587015592516006909501805460ff19169515159590951790945593516323b872dd60e01b8152918201523060248201526044810186905292935090916323b872dd90606401600060405180830381600087803b1580156109f157600080fd5b505af1158015610a05573d6000803e3d6000fd5b505060408051338152600060208201819052818301869052606082015290516001600160a01b038816935086925085917f559a3a6d05e6c668564a802e14c9315ffcce4efdb13bf30a43c6790b957c36be919081900360800190a450506107456001600055565b60026000541415610abf5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610376565b6002600055565b80356001600160a01b0381168114610add57600080fd5b919050565b60008060408385031215610af4578182fd5b610afd83610ac6565b946020939093013593505050565b600080600060608486031215610b1f578081fd5b610b2884610ac6565b95602085013595506040909401359392505050565b600060208284031215610b4e578081fd5b5035919050565b60008060408385031215610b67578182fd5b50508035926020909101359150565b602080825282518282018190526000919060409081850190868401855b82811015610bfd578151805185528681015187860152858101516001600160a01b03908116878701526060808301518216908701526080808301519091169086015260a0808201519086015260c09081015115159085015260e09093019290850190600101610b93565b5091979650505050505050565b6020808252602a908201527f4f6e6c79206974656d206f776e65722063616e20706572666f726d20746869736040820152691037b832b930ba34b7b760b11b606082015260800190565b60008219821115610c6757610c67610c87565b500190565b6000600019821415610c8057610c80610c87565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220879d7ed84a72741864e9c9ec7323d520ae7092613e4a84201778449224bf1b7164736f6c63430008040033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/frontend/src/pages/Create/ProgressModal.tsx b/frontend/src/pages/Create/ProgressModal.tsx index b4b05e5..fc9aeb7 100644 --- a/frontend/src/pages/Create/ProgressModal.tsx +++ b/frontend/src/pages/Create/ProgressModal.tsx @@ -19,8 +19,8 @@ import { useWallet } from "@/context/walletProvider"; import { CheckCircle2, CircleDotDashed } from "lucide-react"; import { useState } from "react"; import { formInputType } from "."; -import NFT from "../../../../smart_contract/artifacts/contracts/NFT.sol/NFT.json"; -import NFTMarketPlace from "../../../../smart_contract/artifacts/contracts/NFTMarketplace.sol/NFTMarketPlace.json"; +import NFT from "@/constant/NFT.json"; +import NFTMarketPlace from "@/constant/NFTMarketPlace.json"; const JWT = import.meta.env.VITE_JWT; const nftmarketaddress = import.meta.env.VITE_MKP_ADDRESS; diff --git a/frontend/src/pages/Item/BuyModal.tsx b/frontend/src/pages/Item/BuyModal.tsx index eba3b73..f54da83 100644 --- a/frontend/src/pages/Item/BuyModal.tsx +++ b/frontend/src/pages/Item/BuyModal.tsx @@ -20,7 +20,7 @@ import { ethers } from "ethers"; import { ReactNode } from "react"; import { useWallet } from "@/context/walletProvider"; -import NFTMarketPlace from "../../../../smart_contract/artifacts/contracts/NFTMarketplace.sol/NFTMarketPlace.json"; +import NFTMarketPlace from "@/constant/NFTMarketPlace.json"; import { useToast } from "@/components/ui/use-toast"; import { CheckCircle2 } from "lucide-react"; diff --git a/frontend/src/pages/test.tsx b/frontend/src/pages/test.tsx index 1566884..43ec981 100644 --- a/frontend/src/pages/test.tsx +++ b/frontend/src/pages/test.tsx @@ -2,8 +2,8 @@ import { useWallet } from "@/context/walletProvider"; import { NFT as NFTType } from "@/types/types"; import { ethers } from "ethers"; import { useState } from "react"; -import NFTMarketPlace from "../../../smart_contract/artifacts/contracts/NFTMarketplace.sol/NFTMarketPlace.json"; -import NFT from "../../../smart_contract/artifacts/contracts/NFT.sol/NFT.json"; +import NFTMarketPlace from "@/constant/NFTMarketPlace.json"; +import NFT from "@/constant/NFT.json"; import axios from "axios"; const nftmarketaddress = import.meta.env.VITE_MKP_ADDRESS; @@ -17,18 +17,18 @@ export const TestButton = () => { const marketContract = new ethers.Contract( nftmarketaddress, NFTMarketPlace.abi, - provider?.getSigner() + provider?.getSigner(), ); const tokenContract = new ethers.Contract(nftaddress, NFT.abi, provider); const data = await marketContract.fetchMarketItems(); const items: NFTType[] = await Promise.all( - data.map(async (i) => { + data.map(async (i: NFTType) => { const price = ethers.utils.formatUnits(i.price.toString(), "ether"); const tokenUri = await tokenContract.tokenURI(i.tokenId); const meta = await axios.get(tokenUri); const item = { - tokenId: i.tokenId.toNumber(), + tokenId: i.tokenId, price: price, listed: i.listed, creator: i.creator, @@ -36,7 +36,7 @@ export const TestButton = () => { imgURL: meta.data.image, }; return item; - }) + }), ); console.log(items); setItems(items);