This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './App.css'; | |
import { useState } from 'react' | |
import CeramicClient from '@ceramicnetwork/http-client' | |
import ThreeIdResolver from '@ceramicnetwork/3id-did-resolver' | |
import { EthereumAuthProvider, ThreeIdConnect } from '@3id/connect' | |
import { DID } from 'dids' | |
import { IDX } from '@ceramicstudio/idx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './App.css'; | |
import { createClient } from 'urql' | |
import { useEffect, useState } from 'react' | |
const APIURL = "" | |
const query = ` | |
query { | |
tokens( | |
first: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* pages/creator-dashboard.js */ | |
import { ethers } from 'ethers' | |
import { useEffect, useState } from 'react' | |
import axios from 'axios' | |
import Web3Modal from "web3modal" | |
import { | |
nftmarketaddress, nftaddress | |
} from '../config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*/ pages/my-assets.js */ | |
import { ethers } from 'ethers' | |
import { useEffect, useState } from 'react' | |
import axios from 'axios' | |
import Web3Modal from "web3modal" | |
import { | |
nftmarketaddress, nftaddress | |
} from '../config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* pages/create-item.js */ | |
import { useState } from 'react' | |
import { ethers } from 'ethers' | |
import { create as ipfsHttpClient } from 'ipfs-http-client' | |
import { useRouter } from 'next/router' | |
import Web3Modal from 'web3modal' | |
const client = ipfsHttpClient('https://ipfs.infura.io:5001/api/v0') | |
import { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* pages/index.js */ | |
import { ethers } from 'ethers' | |
import { useEffect, useState } from 'react' | |
import axios from 'axios' | |
import Web3Modal from "web3modal" | |
import { | |
nftaddress, nftmarketaddress | |
} from '../config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* pages/_app.js */ | |
import '../styles/globals.css' | |
import Link from 'next/link' | |
function Marketplace({ Component, pageProps }) { | |
return ( | |
<div> | |
<nav className="border-b p-6"> | |
<p className="text-4xl font-bold">Metaverse Marketplace</p> | |
<div className="flex mt-4"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* test/sample-test.js */ | |
describe("NFTMarket", function() { | |
it("Should create and execute market sales", async function() { | |
/* deploy the marketplace */ | |
const Market = await ethers.getContractFactory("NFTMarket") | |
const market = await Market.deploy() | |
await market.deployed() | |
const marketAddress = market.address | |
/* deploy the NFT contract */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* hardhat.config.js */ | |
require("@nomiclabs/hardhat-waffle") | |
module.exports = { | |
defaultNetwork: "hardhat", | |
networks: { | |
hardhat: { | |
chainId: 1337 | |
}, | |
// mumbai: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// contracts/Market.sol | |
// SPDX-License-Identifier: MIT OR Apache-2.0 | |
pragma solidity ^0.8.3; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "hardhat/console.sol"; |