Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC: Sustainable NFT Collections #752

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

gfLobo
Copy link

@gfLobo gfLobo commented Dec 4, 2024


eip: xxxx
title: Sustainable NFT Collections
description: A standard for managing NFTs with dynamic fees and donation-based engagement.
author: Gustavo Lobo (@gfLobo)
discussions-to:
status: Draft
type: Standards Track
category: ERC
created: 2024-12-04
requires: 721

Abstract

This EIP defines a standard for economically sustainable NFTs using features derived from the ERC721 standard. It integrates dynamic minting fees, role-based access control, and donation-based engagement. These mechanisms align tokenomics with principles of scarcity and value attribution while enabling creators to foster community engagement through contributions. Additionally, the standard supports optional features like token raffles to further incentivize community participation.


Motivation

NFT systems often face issues like inflationary supply and lack of mechanisms to incentivize meaningful engagement between creators and contributors. This EIP addresses these gaps by introducing:

  • Dynamic Minting Fees: To align token costs with user activity and ownership.
  • Donation-Based Engagement: Encouraging contributions to creators.
  • Role-Based Access: Empowering creators while ensuring transparent governance.
  • Optional Raffles: Providing a mechanism for creators to reward contributors in a gamified manner.

Specification

Core Functionalities

  1. Dynamic Minting Fees:
    Minting fees increase dynamically based on the number of tokens owned by the user. This discourages hoarding and promotes equitable token distribution.

    • Formula:
      function mintFee() public view returns (uint256) {
         if (hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) return 0;
         uint256 baseFee = mintBaseFee;
         uint256 incrementPercentage = mintRateIncrementPercentage;
         uint256 userTokenCount = balanceOf(msg.sender);
         return baseFee * (1 + incrementPercentage / 100) ** userTokenCount;
       }
  2. Donation System:
    Contributors can support creators by donating ETH. Upon donation, users may receive the Contributor Role, granting them special access to features like raffles or exclusive minting rights.

    • Function:
      function donate(address creator) external payable;
  3. Role-Based Access:

    • Creator Role: Enables minting and managing collections. Users can acquire this role by paying a creator signature fee.
    • Contributor Role: Granted to users who donate ETH to creators, enabling participation in additional features.
    • Administrator: Grants roles, updates contract parameters, and manages withdrawals.
  4. Administrative Controls:

    • Pause/Unpause: Allows administrators to halt or resume contract operations during emergencies.
    • Withdraw: Administrators can withdraw ETH from the contract with complete transparency.

Optional Raffle Mechanism (Extra Feature)

Creators can optionally organize raffles to reward contributors. Raffles encourage engagement by allowing contributors to compete for ownership of specific tokens.

  • Creating a Raffle:

    • Creators specify the token ID, expected donation amount, and participant limits.
    • Example function:
      function createRaffle(uint256 tokenId, uint256 expectedAmount) external;
  • Joining a Raffle:

    • Contributors can join active raffles by donating ETH to the creator. If the donation pool reaches the expected amount, a winner is randomly selected.
    • Example function:
      function joinRaffle(uint256 tokenId) external payable;
  • Random Winner Selection:

    • Winners are selected using a random mechanism based on on-chain factors like block timestamp and randomness (block.prevrandao).

Security Considerations

  • Reentrancy Protection:
    Implements ReentrancyGuard to prevent recursive call vulnerabilities in donation and raffle functions.
  • Access Management:
    Utilizes OpenZeppelin's AccessControl to enforce role-based restrictions.
  • Raffle Transparency:
    Raffle mechanics use auditable and on-chain randomness for fairness.
  • Paused State:
    Allows administrators to pause the contract in emergencies, ensuring safety during unexpected events.

Rationale

Below are the key considerations and justifications for the design choices:

  1. Dynamic Minting Fees

    • Problem: Fixed minting fees often lead to hoarding and disproportionate ownership, limiting equitable access to NFTs.
    • Solution: Introducing a dynamic fee structure discourages hoarding by progressively increasing costs based on ownership. This mechanism incentivizes broader token distribution and aligns with principles of scarcity and value attribution.
  2. Donation-Based Engagement

    • Problem: Creators often lack sustainable models for fostering community engagement and receiving contributions.
    • Solution: A donation system provides creators with a direct channel to receive support while offering contributors tangible benefits (e.g., roles or access to raffles). This fosters a mutually beneficial relationship.
  3. Optional Raffle Mechanism

    • Problem: Traditional giveaways and rewards lack transparency and often exclude smaller contributors.
    • Solution: The optional raffle system introduces fairness by leveraging on-chain randomness, encouraging smaller contributors to participate without feeling excluded.
    • Alternative Considered: Replacing raffles with auctions. However, auctions tend to favor wealthier participants and do not align with the goal of equitable community engagement.

Backwards Compatibility

This EIP is fully compatible with ERC721. Extensions like dynamic minting fees, donation systems, and optional raffles are modular and do not impact existing ERC721 token functionalities.


Test Cases

  • Validate dynamic minting fees with varying ownership levels.
  • Verify role-based access control for minting and donations.
  • Ensure proper donation flow and ETH transfer to creators.
  • Test contract pause and unpause functionalities.
  • Simulate raffle creation, participation, and winner selection scenarios.
  • Simulate unauthorized access attempts and validate security safeguards.

Reference Implementation

The reference implementation is provided at Collectible. It includes all specified functionalities, including dynamic fees, donation systems, role-based access, and optional raffle mechanisms.


Backwards Compatibility

This EIP is fully compatible with ERC721. Extensions like dynamic minting fees, donation systems, and optional raffles are modular and do not impact existing ERC721 token functionalities.


Copyright

Copyright and related rights waived via CC0.

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Dec 4, 2024

File ERCS/erc-7832.md

Requires 1 more reviewers from @axic, @g11tech, @SamWilsn, @xinbenlv

ERCS/erc-xxxx.md Outdated Show resolved Hide resolved
ERCS/erc-xxxx.md Outdated Show resolved Hide resolved
ERCS/erc-xxxx.md Outdated Show resolved Hide resolved
ERCS/erc-xxxx.md Outdated
title: Sustainable Collections
description: A standard for managing NFTs with dynamic fees and donation-based engagement.
author: Gustavo Lobo (@gflobo)
discussions-to: <URL>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a discussions topic on Eth Magicians: https://ethereum-magicians.org/c/ercs/57
It just needs to be a link to this PR.

ERCS/erc-xxxx.md Outdated
if (hasRole(DEFAULT_ADMIN_ROLE, msg.sender)) return 0;
uint256 baseFee = mintBaseFee;
uint256 incrementPercentage = mintRateIncrementPercentage;
uint256 userTokenCount = balanceOf(msg.sender);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If NFTs are transferrable, then a holder can just transfer to another account they control prior to minting.

@github-actions github-actions bot added w-ci and removed w-ci labels Dec 5, 2024
@eip-review-bot eip-review-bot changed the title Add ERC: Sustainable Collections Add ERC: Sustainable NFT Collections Dec 5, 2024
@github-actions github-actions bot added w-ci and removed w-ci labels Dec 5, 2024
Copy link

github-actions bot commented Dec 5, 2024

The commit e265b83 (as a parent of 8c3b27f) contains errors.
Please inspect the Run Summary for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants