Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mehdikhosa50/nft-marketplace-smart-contracts
https://github.com/mehdikhosa50/nft-marketplace-smart-contracts
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mehdikhosa50/nft-marketplace-smart-contracts
- Owner: MehdiKhosa50
- Created: 2024-12-16T07:03:39.000Z (7 days ago)
- Default Branch: main
- Last Pushed: 2024-12-16T07:09:09.000Z (7 days ago)
- Last Synced: 2024-12-16T08:20:58.883Z (7 days ago)
- Language: Solidity
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NFT Marketplace with Lazy Minting
A decentralized NFT marketplace built on Ethereum that implements lazy minting functionality, allowing creators to mint NFTs without paying upfront gas fees until the first purchase occurs.
## Features
- **Traditional NFT Minting**: Standard ERC721 token minting functionality
- **Lazy Minting**: Gas-less NFT creation using signed vouchers
- **Signature Verification**: EIP-712 compliant signature verification for secure lazy minting
- **Enumerable NFTs**: Keep track of all tokens and their owners
- **Token URI Storage**: Store and retrieve metadata URIs for NFTs
- **Owner Controls**: Special functions restricted to contract owner## Smart Contracts
The project consists of two main contracts:
1. **PDT_NFT.sol**: A basic NFT contract with signature-based minting
2. **NFTContract.sol**: The main marketplace contract with lazy minting functionality## Technical Details
### Prerequisites
- Node.js v14+ and npm
- Hardhat or Truffle
- OpenZeppelin Contracts v4.8+
- MetaMask or similar Web3 wallet### Contract Dependencies
```solidity
@openzeppelin/contracts/token/ERC721/ERC721.sol
@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol
@openzeppelin/contracts/utils/cryptography/ECDSA.sol
@openzeppelin/contracts/utils/cryptography/EIP712.solHow It Works
Creator Flow:
Creator prepares NFT metadata
Creates a signed voucher containing NFT details
Shares the voucher off-chain
Buyer Flow:
Receives the signed voucher
Calls lazyMintNFT with the voucher
Pays the specified price
NFT is minted directly to their address
Verification:
Contract verifies the signature
Checks expiration time
Validates payment amount
Processes the minting and payment
Security Features
Signature verification using EIP-712
Reentrancy protection
Expiration timestamps for vouchers
Owner-only administrative functions
Secure payment handlingContributing
Contributions are welcome! Please feel free to submit a Pull Request.License
This project is licensed under the MIT License - see the LICENSE file for details.Acknowledgments
OpenZeppelin for their secure contract implementations
The Ethereum community for EIP-712 standards
Contact
For questions and support, please open an issue in the repository.Made with ❤️ for the NFT community