Skip to content

Add NFT Factory Implementation with ERC721 Support#35

Merged
codeZe-us merged 9 commits intoStarkBid:mainfrom
codebestia:feat/erc721-base-contract
Jul 30, 2025
Merged

Add NFT Factory Implementation with ERC721 Support#35
codeZe-us merged 9 commits intoStarkBid:mainfrom
codebestia:feat/erc721-base-contract

Conversation

@codebestia
Copy link
Contributor

@codebestia codebestia commented Jul 30, 2025

PR Description

This PR introduces a complete NFT factory implementation with full ERC721 functionality, including minting, burning, and transfer capabilities.

✍️ Changes Made

src/Nft.cairo - New NFT Factory Contract

  • Added: Complete NftFactory contract implementation using OpenZeppelin components
  • Features:
    • ERC721 standard compliance with SRC5 metadata support
    • Minting functionality for creating new NFTs
    • Burning functionality with owner-only access control
    • Full ERC721 transfer and approval mechanisms
    • Configurable name, symbol, and base URI
  • Security: Owner-based access control for minting and burning operations

src/interfaces/ierc721.cairo - ERC721 Interface Definitions

  • Added: Complete ERC721 interface definitions
  • Interfaces:
    • IERC721: Core ERC721 functionality (transfer, approve, balance_of, etc.)
    • IERC721Metadata: Metadata functions (name, symbol, token_uri)
    • IERC721Mintable: Minting and burning capabilities
  • Standards: Implements ERC721 standard with additional mintable functionality

tests/test_nft_factory.cairo - Comprehensive Test Suite

  • Added: Complete test coverage for NFT factory functionality
  • Test Cases:
    • ✅ Basic contract deployment and metadata verification
    • ✅ NFT minting with proper ownership assignment
    • ✅ NFT burning with owner validation
    • ✅ Transfer functionality between addresses
    • ✅ Approval system for third-party transfers
    • ✅ Error handling for unauthorized operations
  • Coverage: Tests both happy path and edge cases with proper access control validation

🚀 Benefits

  1. Standards Compliance: Full ERC721 standard implementation
  2. Extensibility: Modular design using OpenZeppelin components
  3. Security: Robust access control and validation
  4. Testability: Complete test coverage for all functionality
  5. Integration Ready: Interfaces designed for easy integration with marketplace

🧑🏾‍💻 Testing

All tests covering:

  • Contract deployment and initialization
  • NFT minting and burning operations
  • Transfer and approval mechanisms
  • Error handling for unauthorized access
  • Metadata functionality

Related Issue

Closes #33

@codeZe-us codeZe-us self-requested a review July 30, 2025 13:37
@codeZe-us codeZe-us merged commit dfb0f36 into StarkBid:main Jul 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

003: Implement ERC721 Base Contract

2 participants