Skip to content

Commit

Permalink
update init NFT events && errors
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJonaseb11 committed Jun 3, 2024
1 parent 2f63c02 commit 7b10190
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 33 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 1 addition & 24 deletions smart_contract/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -36,4 +13,4 @@ REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js
```
>>>>>>> d7e0be7 (Update Code)

61 changes: 61 additions & 0 deletions smart_contract/contracts/NFTMarketplace.sol
Original file line number Diff line number Diff line change
@@ -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");
_;
}


}
8 changes: 0 additions & 8 deletions smart_contract/contracts/Token.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,4 @@ contract NFTMintDN404 is DN404, ERC20Permit, Ownable {
function getURI() public view returns(string memory) {
return _baseURI;
}








}
2 changes: 1 addition & 1 deletion smart_contract/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.24",
solidity: "0.8.19",
};

0 comments on commit 7b10190

Please sign in to comment.