+ {tokenURI.attributes.map((attr, index) => (
+
{capitalizeFirstLetter(attr.trait_type)}
diff --git a/frontend/components/web3/NFT.js b/frontend/components/web3/NFT.js
index d88c040..c30d5d5 100644
--- a/frontend/components/web3/NFT.js
+++ b/frontend/components/web3/NFT.js
@@ -114,6 +114,7 @@ export default function NFT({
nftAddress
}
target="_blank"
+ rel="noreferrer"
>
{truncateStr(nftAddress, 15)}
diff --git a/frontend/components/web3/OldListing.js b/frontend/components/web3/OldListing.js
deleted file mode 100644
index 553b3e5..0000000
--- a/frontend/components/web3/OldListing.js
+++ /dev/null
@@ -1,920 +0,0 @@
-import { useEffect, useState } from "react"
-import { Modal, useNotification, Select, Input } from "@web3uikit/core"
-import Moralis from "moralis"
-import { useMoralis } from "react-moralis"
-import { useCookies } from "react-cookie"
-import { ethers } from "ethers"
-
-import { getChainName } from "../../helpers/getChainName"
-import nftTypes from "../../helpers/nftTypes"
-import truncateStr from "../../helpers/truncateStr"
-
-import Image from "next/image"
-import { FaEthereum } from "react-icons/fa"
-
-import retrieveTokenSymbol from "../../hooks/retrieveTokenSymbol"
-import retrieveTokenAmount from "../../hooks/retrieveTokenAmount"
-import retrieveTokenBalance from "../../hooks/retrieveTokenBalance"
-import delistNft from "../../hooks/nftMarketplace/deListNft"
-import approveNft from "../../hooks/nftMarketplace/approveNft"
-import listNft from "../../hooks/nftMarketplace/listNft"
-import updatePrice from "../../hooks/nftMarketplace/updatePrice"
-import addPaymentToken from "../../hooks/nftMarketplace/addPaymentToken"
-import removePaymentToken from "../../hooks/nftMarketplace/removePaymentToken"
-import buyNftEth from "../../hooks/nftMarketplace/buyNftEth"
-import buyNftErc20 from "../../hooks/nftMarketplace/buyNftErc20"
-import approveErc20 from "../../hooks/nftMarketplace/approveErc20"
-
-function capitalizeFirstLetter(string) {
- return string.charAt(0).toUpperCase() + string.slice(1)
-}
-
-export default function Listing({
- nftAddress,
- tokenId,
- price,
- paymentTokens,
- activePaymentTokens,
- ownerAddress,
- tokenURI,
- isVisible,
- onClose,
- type,
-}) {
- const dispatch = useNotification()
- const [currentNftType, setNftType] = useState(0)
- const [formattedPrice, setFormattedPrice] = useState(price || 0)
- const [paymentMethod, setPaymentMethod] = useState(0)
- const [currentAddPaymentTokenIndex, setCurrentAddPaymentTokenIndex] = useState(0)
- const [currentRemovePaymentTokenIndex, setCurrentRemovePaymentTokenIndex] = useState(0)
- const [paymentTokensToBeAdded, setPaymentTokensToBeAdded] = useState([])
- const [priceInput, setPriceInput] = useState("0")
- const [sendingTx, setSendingTx] = useState(false)
- const [accountBalance, setAccountBalance] = useState("0")
- const { account, chainId } = useMoralis()
- const [cookies, setCookie] = useCookies(["currentSite", "latestMessage"])
- const chainName = getChainName(chainId)
-
- const getAccountBalance = async () => {
- const MORALIS_API_KEY = process.env.NEXT_PUBLIC_MORALIS_API_KEY
- await Moralis.start({ apiKey: MORALIS_API_KEY })
-
- const response = await Moralis.EvmApi.account.getNativeBalance({
- address: account,
- chain: chainId,
- })
-
- return response._data.balance
- }
-
- let formattedOptions = [
- {
- id: 0,
- label: "ETH",
- prefix:
,
- amount: price,
- address: ethers.constants.AddressZero,
- },
- ]
- let tokens = []
- if (paymentTokens !== undefined) {
- for (let i = 0; i < paymentTokens.length; i++) {
- const symbol = retrieveTokenSymbol(paymentTokens[i])
- const tokenAmount = retrieveTokenAmount(price, paymentTokens[i])
- const tokenBalance = retrieveTokenBalance(account, paymentTokens[i])
-
- const token = {
- id: i + 1,
- label: symbol,
- prefix:
,
- amount: tokenAmount,
- address: paymentTokens[i],
- balance: tokenBalance,
- }
-
- formattedOptions.push(token)
- tokens.push(token)
- }
- }
-
- let activePaymentTokenOptions = []
- for (let i = 0; i < activePaymentTokens.length; i++) {
- let isInListing = false
- for (let i = 0; i < tokens.length; i++) {
- if (activePaymentTokens[i].tokenAddress == tokens[i].address) {
- isInListing = true
- break
- }
- }
-
- if (isInListing) {
- continue
- }
-
- const symbol = retrieveTokenSymbol(activePaymentTokens[i].tokenAddress)
- const token = {
- id: i,
- label: symbol,
- prefix:
,
- address: activePaymentTokens[i].tokenAddress,
- }
-
- activePaymentTokenOptions.push(token)
- }
-
- const paymentTokenAlreadyAdded = () => {
- let alreadyAdded = false
- if (activePaymentTokenOptions[currentAddPaymentTokenIndex] == undefined) {
- return false
- }
- const currentAddress = activePaymentTokenOptions[currentAddPaymentTokenIndex].address
- for (let i = 0; i < paymentTokensToBeAdded.length; i++) {
- if (paymentTokensToBeAdded[i] == currentAddress) {
- alreadyAdded = true
- }
- }
- return alreadyAdded
- }
-
- const getFormattedPriceInput = () => {
- return priceInput != 0 ? ethers.utils.parseUnits(priceInput, "ether").toString() : ""
- }
-
- const sendApproveNft = approveNft(nftAddress, tokenId)
- const sendListNft = listNft(
- nftAddress,
- tokenId,
- getFormattedPriceInput(),
- paymentTokensToBeAdded
- )
- const sendDelistNft = delistNft(nftAddress, tokenId)
- const sendUpdatePrice = updatePrice(nftAddress, tokenId, getFormattedPriceInput())
- const sendAddPaymentToken = addPaymentToken(
- nftAddress,
- tokenId,
- activePaymentTokenOptions[currentAddPaymentTokenIndex]
- ? activePaymentTokenOptions[currentAddPaymentTokenIndex].address
- : ""
- )
- const sendRemovePaymentToken = removePaymentToken(
- nftAddress,
- tokenId,
- currentRemovePaymentTokenIndex
- )
- const sendBuyNftEth = buyNftEth(nftAddress, tokenId, price)
- const sendApproveErc20 = approveErc20(formattedOptions[paymentMethod].address, formattedPrice)
- const sendBuyNftErc20 = buyNftErc20(nftAddress, tokenId, paymentMethod - 1)
-
- const handleNewNotification = (message, title, type) => {
- dispatch({
- type: type,
- message: message,
- title: title,
- icon: undefined,
- position: "topR",
- })
- }
-
- const handleTxPosted = () => {
- handleNewNotification("Transaction has been posted", "Tx Notification", "info")
- }
-
- const handleTxSuccess = async (tx) => {
- await tx.wait(4)
- handleNewNotification(`Transaction (${tx.hash}) complete!`, "Tx Notification", "success")
- }
-
- const handleTxError = () => {
- handleNewNotification("Transaction failed", "Tx Notification", "error")
- }
-
- useEffect(() => {
- setNftType(type)
- if (account == ownerAddress) {
- setPriceInput(ethers.utils.formatUnits(formattedPrice, "ether").toString())
- }
- const setBalance = async () => {
- setAccountBalance(await getAccountBalance())
- }
- setBalance()
- }, [])
-
- return (
-
-
-
-
-
-
tokenURI.image}
- src={tokenURI.image}
- layout="intrinsic"
- height="500"
- width="500"
- />
-
-
- {tokenURI.name}
-
-
-
-
- #{tokenId}
-
- {ownerAddress == account ? (
-
-
- Price
-
-
-
- {priceInput}
-
- {currentNftType == nftTypes.notListed ? (
- paymentTokensToBeAdded.length > 0 ? (
-
-
- Payment Tokens (
- {paymentTokensToBeAdded.length})
-
-
- {paymentTokensToBeAdded.map((token) => (
-
- ))}
-
- ) : (
-
-
- No Payment Tokens
-
-
- )
- ) : currentNftType == nftTypes.listed ? (
- tokens.length > 0 ? (
-
-
- Payment Tokens ({tokens.length})
-
-
- {tokens.map((token) => (
-
- ))}
-
- ) : (
- ""
- )
- ) : (
- ""
- )}
-
- ) : (
- ""
- )}
-
-
- {currentNftType == nftTypes.listed && ownerAddress == account ? (
-
- ) : currentNftType != nftTypes.listed && ownerAddress == account ? (
-
- ) : (
- ""
- )}
-
-
-
-
-
-
- {ownerAddress == account ? "Settings" : "Menu"}
-
-
-
-
-
- {ownerAddress == account && currentNftType == nftTypes.listed
- ? "Update Price"
- : ownerAddress == account &&
- currentNftType == nftTypes.notListed
- ? "Set Price"
- : "Current Price"}
-
-
- {ownerAddress == account ? (
- ""
- ) : (
-
-
- )}
-
- {ownerAddress == account ? (
-
-
- }
- value={
- currentNftType == nftTypes.listed
- ? priceInput
- : "0"
- }
- type="number"
- onChange={(event) => {
- setPriceInput(event.nativeEvent.target.value)
- }}
- validation={{
- numberMin: 0.000000000000000001,
- numberMax: 100000000000000000,
- }}
- />
-
- ) : (
-
- {ethers.utils
- .formatUnits(formattedPrice, "ether")
- .split(".")[1].length > 5
- ? Number(
- ethers.utils.formatUnits(
- formattedPrice,
- "ether"
- )
- ).toFixed(5)
- : ethers.utils.formatUnits(formattedPrice, "ether")}
-
- )}
-
-
-
-
- {currentNftType == nftTypes.listed ? (
-
- ) : (
- ""
- )}
-
-
- {ownerAddress == account && tokens.length > 0 ? (
-
-
- Remove Payment Token
-
-
-
-
-
-
-
- ) : (
- ""
- )}
- {ownerAddress == account && activePaymentTokenOptions.length > 0 ? (
-
-
- Add Payment Token
- {currentNftType != nftTypes.listed && ownerAddress == account
- ? "s"
- : ""}
- {""}
-
- (optional)
-
-
-
- {
-
-
- }
-
-
- {type == nftTypes.listed ? (
-
- ) : (
- ""
- )}
-
-
- ) : (
- ""
- )}
-
-
-
-
-
- About this NFT
-
-
-
-
- Description
-
-
- {tokenURI.description}
-
-
-
-
- Attributes
-
-
-
- {tokenURI.attributes.map((attr) => (
-
-
- {capitalizeFirstLetter(attr.trait_type)}
-
-
- {capitalizeFirstLetter(attr.value)}
-
-
- ))}
-
-
-
-
-
-
- )
-}
diff --git a/frontend/constants/FrontendNft/addresses.json b/frontend/constants/FrontendNft/addresses.json
index 1c548f6..0252960 100644
--- a/frontend/constants/FrontendNft/addresses.json
+++ b/frontend/constants/FrontendNft/addresses.json
@@ -1 +1 @@
-{"5":["0xF8611F3C2C2F88A396F7943A55F5FAa63aE95446"],"31337":["0xc6e7DF5E7b4f2A278906862b61205850344D4e7d"]}
\ No newline at end of file
+{"1":["0x8BF648A04a7f0580eaC260c4C34431a828d10d44"],"5":["0x048578E39D27d437Ba4dec154451C77CBEC577E0"],"31337":["0xc6e7DF5E7b4f2A278906862b61205850344D4e7d"]}
\ No newline at end of file
diff --git a/frontend/constants/FrontendToken/abi.json b/frontend/constants/FrontendToken/abi.json
index 743f56d..43ec7f5 100644
--- a/frontend/constants/FrontendToken/abi.json
+++ b/frontend/constants/FrontendToken/abi.json
@@ -1 +1 @@
-[{"type":"constructor","payable":false,"inputs":[]},{"type":"event","anonymous":false,"name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"spender","indexed":true},{"type":"uint256","name":"value","indexed":false}]},{"type":"event","anonymous":false,"name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"value","indexed":false}]},{"type":"function","name":"allowance","constant":true,"stateMutability":"view","payable":false,"gas":29000000,"inputs":[{"type":"address","name":"owner"},{"type":"address","name":"spender"}],"outputs":[{"type":"uint256"}]},{"type":"function","name":"approve","constant":false,"payable":false,"gas":29000000,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"balanceOf","constant":true,"stateMutability":"view","payable":false,"gas":29000000,"inputs":[{"type":"address","name":"account"}],"outputs":[{"type":"uint256"}]},{"type":"function","name":"decimals","constant":true,"stateMutability":"view","payable":false,"gas":29000000,"inputs":[],"outputs":[{"type":"uint8"}]},{"type":"function","name":"decreaseAllowance","constant":false,"payable":false,"gas":29000000,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"subtractedValue"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"increaseAllowance","constant":false,"payable":false,"gas":29000000,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"addedValue"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"name","constant":true,"stateMutability":"view","payable":false,"gas":29000000,"inputs":[],"outputs":[{"type":"string"}]},{"type":"function","name":"symbol","constant":true,"stateMutability":"view","payable":false,"gas":29000000,"inputs":[],"outputs":[{"type":"string"}]},{"type":"function","name":"totalSupply","constant":true,"stateMutability":"view","payable":false,"gas":29000000,"inputs":[],"outputs":[{"type":"uint256"}]},{"type":"function","name":"transfer","constant":false,"payable":false,"gas":29000000,"inputs":[{"type":"address","name":"to"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"transferFrom","constant":false,"payable":false,"gas":29000000,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool"}]}]
\ No newline at end of file
+[{"type":"constructor","payable":false,"inputs":[]},{"type":"event","anonymous":false,"name":"Approval","inputs":[{"type":"address","name":"owner","indexed":true},{"type":"address","name":"spender","indexed":true},{"type":"uint256","name":"value","indexed":false}]},{"type":"event","anonymous":false,"name":"Transfer","inputs":[{"type":"address","name":"from","indexed":true},{"type":"address","name":"to","indexed":true},{"type":"uint256","name":"value","indexed":false}]},{"type":"function","name":"allowance","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"owner"},{"type":"address","name":"spender"}],"outputs":[{"type":"uint256"}]},{"type":"function","name":"approve","constant":false,"payable":false,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"balanceOf","constant":true,"stateMutability":"view","payable":false,"inputs":[{"type":"address","name":"account"}],"outputs":[{"type":"uint256"}]},{"type":"function","name":"decimals","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint8"}]},{"type":"function","name":"decreaseAllowance","constant":false,"payable":false,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"subtractedValue"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"increaseAllowance","constant":false,"payable":false,"inputs":[{"type":"address","name":"spender"},{"type":"uint256","name":"addedValue"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"name","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string"}]},{"type":"function","name":"symbol","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"string"}]},{"type":"function","name":"totalSupply","constant":true,"stateMutability":"view","payable":false,"inputs":[],"outputs":[{"type":"uint256"}]},{"type":"function","name":"transfer","constant":false,"payable":false,"inputs":[{"type":"address","name":"to"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool"}]},{"type":"function","name":"transferFrom","constant":false,"payable":false,"inputs":[{"type":"address","name":"from"},{"type":"address","name":"to"},{"type":"uint256","name":"amount"}],"outputs":[{"type":"bool"}]}]
\ No newline at end of file
diff --git a/frontend/constants/FrontendToken/addresses.json b/frontend/constants/FrontendToken/addresses.json
index 20f8194..2f4f995 100644
--- a/frontend/constants/FrontendToken/addresses.json
+++ b/frontend/constants/FrontendToken/addresses.json
@@ -1 +1 @@
-{"5":["0x2c79F5d36a6d63a3C5a967A35C6cE122F89ECAA5"],"31337":["0x59b670e9fA9D0A427751Af201D676719a970857b"]}
\ No newline at end of file
+{"5":["0x710aed8d7FeA9768e95B1bD3E6D459aD46ec7474"],"31337":["0x59b670e9fA9D0A427751Af201D676719a970857b"]}
\ No newline at end of file
diff --git a/frontend/constants/NftMarketplace/addresses.json b/frontend/constants/NftMarketplace/addresses.json
index 472dc4a..8c07574 100644
--- a/frontend/constants/NftMarketplace/addresses.json
+++ b/frontend/constants/NftMarketplace/addresses.json
@@ -1 +1 @@
-{"5":["0x7b1ae2832794f804c4fecdb821d47b0e17199947"],"31337":["0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"]}
\ No newline at end of file
+{"1":["0x6a3420aadffCC20283293b58918DBEf886E13Edf"],"5":["0x40D23Cdd00B1eBA05F43A823c7b710162045A467"],"31337":["0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"]}
\ No newline at end of file
diff --git a/frontend/hooks/useDarkSide.js b/frontend/hooks/useDarkSide.js
deleted file mode 100644
index d059e89..0000000
--- a/frontend/hooks/useDarkSide.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import { useEffect, useState } from "react"
-
-export default function useDarkSide() {
- let theme, setTheme
- if (typeof window !== "undefined") {
- if (
- localStorage.theme === "dark" ||
- (!("theme" in localStorage) &&
- window.matchMedia("(prefers-color-scheme: dark)").matches)
- ) {
- const [currentTheme, setThemeFunc] = useState("dark")
- theme = currentTheme
- setTheme = setThemeFunc
- } else {
- const [currentTheme, setThemeFunc] = useState("light")
- theme = currentTheme
- setTheme = setThemeFunc
- }
- }
- const colorTheme = theme === "dark" ? "light" : "dark"
-
- useEffect(() => {
- if (typeof window !== "undefined") {
- document.documentElement.classList.remove(colorTheme)
- document.documentElement.classList.add(theme)
-
- localStorage.setItem("theme", theme)
- }
- }, [theme, colorTheme])
-
- return [colorTheme, setTheme]
-}
diff --git a/frontend/package.json b/frontend/package.json
index 922b97a..296a471 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -30,7 +30,6 @@
"react-dom": "18.2.0",
"react-icons": "^4.4.0",
"react-moralis": "^1.4.1",
- "react-toggle-dark-mode": "^1.1.0",
"tailwindcss": "^3.1.8"
},
"devDependencies": {
diff --git a/frontend/pages/_app.js b/frontend/pages/_app.js
index 0ae9c5a..60b1d4d 100644
--- a/frontend/pages/_app.js
+++ b/frontend/pages/_app.js
@@ -6,7 +6,9 @@ import { CookiesProvider } from "react-cookie"
const client = new ApolloClient({
cache: new InMemoryCache(),
- uri: "https://api.thegraph.com/subgraphs/name/keinberger/nft-marketplace-goerli",
+ uri:
+ "https://api.thegraph.com/subgraphs/name/keinberger/" +
+ process.env.NEXT_PUBLIC_SUBGRAPH_NAME,
})
function MyApp({ Component, pageProps }) {
diff --git a/frontend/pages/api/hello.js b/frontend/pages/api/hello.js
deleted file mode 100644
index df63de8..0000000
--- a/frontend/pages/api/hello.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
-
-export default function handler(req, res) {
- res.status(200).json({ name: 'John Doe' })
-}
diff --git a/hardhat/deploy/99-update-frontend.js b/hardhat/deploy/99-update-frontend.js
index 8287fec..4ceb253 100644
--- a/hardhat/deploy/99-update-frontend.js
+++ b/hardhat/deploy/99-update-frontend.js
@@ -9,14 +9,15 @@ module.exports = async () => {
const chainId = network.config.chainId.toString()
const nftMarketplaceName = networkConfig[chainId].contracts.NftMarketplace.name
const frontendNftName = "FrontendNft"
- const frontendTokenName = "FrontendToken"
+ // const frontendTokenName = "FrontendToken"
- const names = [nftMarketplaceName, frontendNftName, frontendTokenName]
+ const names = [nftMarketplaceName, frontendNftName]
for (let i = 0; i < names.length; i++) {
await createFilesIfNecessary(names[i])
await updateAbi(names[i])
await updateContractAddresses(chainId.toString(), names[i])
}
+ console.log("Frontend Application has been fed with the newest data")
}
}
@@ -73,4 +74,4 @@ const updateContractAddresses = async (chainIdString, contractName) => {
fs.writeFileSync(filePath, JSON.stringify(currentAddresses))
}
-module.exports.tags = ["all", "frontend"]
+module.exports.tags = ["all", "UpdateFrontend"]
diff --git a/hardhat/hardhat.config.js b/hardhat/hardhat.config.js
index 981d0d2..d520160 100644
--- a/hardhat/hardhat.config.js
+++ b/hardhat/hardhat.config.js
@@ -12,6 +12,10 @@ const GOERLI_RPC_URL =
process.env.RPC_URL !== undefined ? process.env.RPC_URL.replace("network", "goerli") : ""
const GOERLI_PRIVATE_KEY =
process.env.GOERLI_PRIVATE_KEY !== undefined ? process.env.GOERLI_PRIVATE_KEY : ""
+const MAINNET_RPC_URL =
+ process.env.RPC_URL !== undefined ? process.env.RPC_URL.replace("network", "mainnet") : ""
+const MAINNET_PRIVATE_KEY =
+ process.env.MAINNET_PRIVATE_KEY !== undefined ? process.env.MAINNET_PRIVATE_KEY : ""
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY
const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY
const REPORT_GAS = process.env.REPORT_GAS
@@ -51,6 +55,12 @@ module.exports = {
url: GOERLI_RPC_URL,
accounts: [GOERLI_PRIVATE_KEY],
},
+ mainnet: {
+ chainId: 1,
+ blockConfirmations: 6,
+ url: MAINNET_RPC_URL,
+ accounts: [MAINNET_PRIVATE_KEY],
+ },
},
namedAccounts: {
deployer: {
diff --git a/hardhat/helper-hardhat-config.js b/hardhat/helper-hardhat-config.js
index 33e07f4..51c247e 100644
--- a/hardhat/helper-hardhat-config.js
+++ b/hardhat/helper-hardhat-config.js
@@ -4,6 +4,7 @@ const constants = {
FRONTEND_FILE_PATH: "../frontend/constants/",
ZERO_ADDRESS: ethers.constants.AddressZero,
developmentChains: ["hardhat", "localhost"],
+ testNetChains: ["goerli"],
MIN_DELAY: 1, // in seconds / TODO: change to fit needs
VOTING_DELAY: 1, // in blocks / TODO: change to fit needs
VOTING_PERIOD: 13, // in blocks / TODO: change to fit needs
@@ -13,13 +14,9 @@ const constants = {
governance: {
proposalsFile: "./scripts/governance/proposals.json",
proposalIndex: 0,
- functionToCall: "addPaymentToken",
- args: [
- "0x055e15708054c38fA9cd23c5d5c84819Ca15A1fE",
- "0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e",
- 8,
- ],
- description: "Add new FrontendToken as payment token",
+ functionToCall: "",
+ args: [],
+ description: "",
voteWay: 1,
},
nftMarketplace: {
@@ -97,6 +94,10 @@ const contractsConfigs = {
}
const networkConfig = {
+ 1: {
+ name: "mainnet",
+ contracts: contractsConfigs,
+ },
5: {
name: "goerli",
contracts: contractsConfigs,
diff --git a/hardhat/scripts/governance/proposals.json b/hardhat/scripts/governance/proposals.json
index edd6ec6..2835507 100644
--- a/hardhat/scripts/governance/proposals.json
+++ b/hardhat/scripts/governance/proposals.json
@@ -1 +1 @@
-{"5":[],"31337":[]}
\ No newline at end of file
+{"1":[],"5":[],"31337":[]}
\ No newline at end of file
diff --git a/thegraph/networks.json b/thegraph/networks.json
index e89279e..0bf1d19 100644
--- a/thegraph/networks.json
+++ b/thegraph/networks.json
@@ -1,7 +1,7 @@
{
- "goerli": {
+ "mainnet": {
"NftMarketplace": {
- "address": "0x7B1Ae2832794f804c4fecdB821D47B0e17199947"
+ "address": "0x6a3420aadffCC20283293b58918DBEf886E13Edf"
}
}
}
diff --git a/thegraph/package.json b/thegraph/package.json
index bae2a90..4419b50 100644
--- a/thegraph/package.json
+++ b/thegraph/package.json
@@ -1,20 +1,18 @@
{
- "name": "marketplace-graph",
- "license": "GLP-3.0",
- "scripts": {
- "codegen": "graph codegen",
- "build": "graph build",
- "deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ ",
- "create-local": "graph create --node http://localhost:8020/ ",
- "remove-local": "graph remove --node http://localhost:8020/ ",
- "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 ",
- "test": "graph test"
- },
- "dependencies": {
- "@graphprotocol/graph-cli": "0.33.0",
- "@graphprotocol/graph-ts": "0.27.0"
- },
- "devDependencies": {
- "matchstick-as": "0.5.0"
- }
+ "name": "nft-marketplace",
+ "license": "UNLICENSED",
+ "scripts": {
+ "codegen": "graph codegen",
+ "build": "graph build",
+ "deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ nft-marketplace",
+ "create-local": "graph create --node http://localhost:8020/ nft-marketplace",
+ "remove-local": "graph remove --node http://localhost:8020/ nft-marketplace",
+ "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 nft-marketplace",
+ "test": "graph test"
+ },
+ "dependencies": {
+ "@graphprotocol/graph-cli": "0.33.0",
+ "@graphprotocol/graph-ts": "0.27.0"
+ },
+ "devDependencies": { "matchstick-as": "0.5.0" }
}
diff --git a/thegraph/subgraph.yaml b/thegraph/subgraph.yaml
index 0f54bbf..44e4249 100644
--- a/thegraph/subgraph.yaml
+++ b/thegraph/subgraph.yaml
@@ -4,11 +4,11 @@ schema:
dataSources:
- kind: ethereum
name: NftMarketplace
- network: goerli
+ network: mainnet
source:
- address: "0x7B1Ae2832794f804c4fecdB821D47B0e17199947"
+ address: "0x6a3420aadffCC20283293b58918DBEf886E13Edf"
abi: NftMarketplace
- startBlock: 7487161
+ startBlock: 15526222
mapping:
kind: ethereum/events
apiVersion: 0.0.6
diff --git a/thegraph/yarn.lock b/thegraph/yarn.lock
index dae69fa..8b4dbfc 100644
--- a/thegraph/yarn.lock
+++ b/thegraph/yarn.lock
@@ -24,9 +24,9 @@
js-tokens "^4.0.0"
"@babel/runtime@^7.9.2":
- version "7.18.9"
- resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a"
- integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==
+ version "7.19.0"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.0.tgz#22b11c037b094d27a8a2504ea4dcff00f50e2259"
+ integrity sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA==
dependencies:
regenerator-runtime "^0.13.4"
@@ -139,9 +139,9 @@
integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==
"@ethersproject/networks@^5.7.0":
- version "5.7.0"
- resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.0.tgz#df72a392f1a63a57f87210515695a31a245845ad"
- integrity sha512-MG6oHSQHd4ebvJrleEQQ4HhVu8Ichr0RDYEfHzsVAVjHNM+w36x9wp9r+hf1JstMXtseXDtkiVoARAG6M959AA==
+ version "5.7.1"
+ resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6"
+ integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==
dependencies:
"@ethersproject/logger" "^5.7.0"
@@ -197,9 +197,9 @@
"@ethersproject/signing-key" "^5.7.0"
"@ethersproject/web@^5.7.0":
- version "5.7.0"
- resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.0.tgz#40850c05260edad8b54827923bbad23d96aac0bc"
- integrity sha512-ApHcbbj+muRASVDSCl/tgxaH2LBkRMEYfLOLVa0COipx0+nlu0QKet7U2lEg0vdkh8XRSLf2nd1f1Uk9SrVSGA==
+ version "5.7.1"
+ resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae"
+ integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==
dependencies:
"@ethersproject/base64" "^5.7.0"
"@ethersproject/bytes" "^5.7.0"
@@ -267,9 +267,9 @@
"@types/node" "*"
"@types/express-serve-static-core@^4.17.9":
- version "4.17.30"
- resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz#0f2f99617fa8f9696170c46152ccf7500b34ac04"
- integrity sha512-gstzbTWro2/nFed1WXtf+TtrpwxH7Ggs4RLYTLbeVgIkUQOI3WG/JKjgeOU1zXDvezllupjrf8OPIdvTbIaVOQ==
+ version "4.17.31"
+ resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz#a1139efeab4e7323834bb0226e62ac019f474b2f"
+ integrity sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==
dependencies:
"@types/node" "*"
"@types/qs" "*"
@@ -283,14 +283,14 @@
"@types/node" "*"
"@types/lodash@^4.14.159":
- version "4.14.184"
- resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.184.tgz#23f96cd2a21a28e106dc24d825d4aa966de7a9fe"
- integrity sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q==
+ version "4.14.185"
+ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.185.tgz#c9843f5a40703a8f5edfd53358a58ae729816908"
+ integrity sha512-evMDG1bC4rgQg4ku9tKpuMh5iBNEwNa3tf9zRHdP1qlv+1WUg44xat4IxCE14gIpZRGUUWAx2VhItCZc25NfMA==
"@types/node@*":
- version "18.7.15"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.15.tgz#20ae1ec80c57ee844b469f968a1cd511d4088b29"
- integrity sha512-XnjpaI8Bgc3eBag2Aw4t2Uj/49lLBSStHWfqKvIuXD7FIrZyMLWp8KuAFHAqxMZYTF9l08N1ctUn9YNybZJVmQ==
+ version "18.7.18"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.18.tgz#633184f55c322e4fb08612307c274ee6d5ed3154"
+ integrity sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==
"@types/node@^10.0.3":
version "10.17.60"
@@ -1286,9 +1286,9 @@ flatmap@0.0.3:
integrity sha512-OuR+o7kHVe+x9RtIujPay7Uw3bvDZBZFSBXClEphZuSDLmZTqMdclasf4vFSsogC8baDz0eaC2NdO/2dlXHBKQ==
follow-redirects@^1.14.0:
- version "1.15.1"
- resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5"
- integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==
+ version "1.15.2"
+ resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13"
+ integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
forever-agent@~0.6.1:
version "0.6.1"
@@ -1359,9 +1359,9 @@ function-bind@^1.1.1:
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
get-intrinsic@^1.0.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598"
- integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385"
+ integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==
dependencies:
function-bind "^1.1.1"
has "^1.0.3"