diff --git a/README.md b/README.md index ec669ed..175d4f4 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,19 @@ _The ERC404 token is a unique token that combines both ERC20 and ERC721 token fe ### Getting started +This project demonstrates a basic Hardhat use case to implement the full business logic of an ERC404 token standard. + +Try running some of the following tasks: + +```shell +npm install --force +npx hardhat help +npx hardhat test +REPORT_GAS=true npx hardhat test +npx hardhat node +npx hardhat run scripts/deploy.js +``` + ----------------------- @0xJonaseb11 diff --git a/smart_contract/README.md b/smart_contract/README.md index ea907a1..bcee0e3 100644 --- a/smart_contract/README.md +++ b/smart_contract/README.md @@ -1,27 +1,4 @@ -<<<<<<< HEAD -# DN404_marketplace.3.0 -## About - -An ERC404 based market place inspired by the pandora coin that includs the combination of -ERC20 and ERC721 token standards to ensure the increment of NFT liquidity. - -`Again,` -_The ERC404 token is a unique token that combines both ERC20 and ERC721 token features. It aims to blend the best features of both token standards and propose innovation to the NFTs. With this innovation, multiple wallets can own shares of a single NFT piece from a collection._ - -`About tasks to cover` - -- Deep dive into the ERC404 token standard -- Deep dive into the DN404 token standard -- Implementation of my unique token using the DN404 token standard -- Building the NFT marketplace for DN404 token - -### Getting started - ------------------------ - -@0xJonaseb11 -======= # Sample Hardhat Project This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract. @@ -36,4 +13,4 @@ REPORT_GAS=true npx hardhat test npx hardhat node npx hardhat run scripts/deploy.js ``` ->>>>>>> d7e0be7 (Update Code) + diff --git a/smart_contract/contracts/NFTMarketplace.sol b/smart_contract/contracts/NFTMarketplace.sol new file mode 100644 index 0000000..1452e72 --- /dev/null +++ b/smart_contract/contracts/NFTMarketplace.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import { IDN404 } from "./Interface/IDN404.sol"; +import { Context } from "@openzeppelin/contracts/utils/Context.sol"; + + +error PriceNotMet(address nftAddress, uint256 price); +error ItemNotForSale(address nftAddress); +error NotListed(address nftAddres); +error AlreadyListed(address nftAddress); +error NoProceeds(); +error NotOwner(); +error NotApprovedForMarketplace(); +error PriceMustBeAboveZero(); +error NotApproved(); + + + +contract NFTMarketplace is Context { + + // state variables + uint256 public counter; + mapping(address => Listing) private s_listings; + mapping(address => uint256) private s_proceeds; // s_proceeds => amount of ether earned by the seller + + + + struct Listing { + uint256 price; + address seller; + } + + // some events + event LogItemListed( + address indexed seller, + address indexed nftAddress, + uint256 price + ); + + event LogItemCanceled( + address indexed seller, + address indexed nftAddress + ); + + event LogItemBought( + address indexed buyer, + address indexed nftAddress, + uint256 price, + int256 fraction + ); + + // funtion modifiers + modifier isListed(address nftAddress) { + Listing memory listing = s_listings(nftAddress); + require(listing.price > 0, "Not listed"); + _; + } + + +} \ No newline at end of file diff --git a/smart_contract/contracts/Token.sol b/smart_contract/contracts/Token.sol index cff42eb..0011f44 100644 --- a/smart_contract/contracts/Token.sol +++ b/smart_contract/contracts/Token.sol @@ -156,12 +156,4 @@ contract NFTMintDN404 is DN404, ERC20Permit, Ownable { function getURI() public view returns(string memory) { return _baseURI; } - - - - - - - - } \ No newline at end of file diff --git a/smart_contract/hardhat.config.js b/smart_contract/hardhat.config.js index 8ba99bc..87c52f5 100644 --- a/smart_contract/hardhat.config.js +++ b/smart_contract/hardhat.config.js @@ -2,5 +2,5 @@ require("@nomicfoundation/hardhat-toolbox"); /** @type import('hardhat/config').HardhatUserConfig */ module.exports = { - solidity: "0.8.24", + solidity: "0.8.19", };