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 23 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cde69ff
Add ERC: Sustainable Collections
gfLobo Dec 4, 2024
e3e128f
Update ERCS/erc-xxxx.md
gfLobo Dec 5, 2024
d9c2acc
Update ERC-7832: updates filename
gfLobo Dec 5, 2024
e265b83
Update ERC-7832: updates title and description
gfLobo Dec 5, 2024
53205c1
Update ERC-7832: Refactor for logarithmic reduction based on user min…
gfLobo Dec 11, 2024
d5ced67
Merge branch 'master' into master
gfLobo Dec 11, 2024
dbb12bc
Merge branch 'master' into master
gfLobo Dec 13, 2024
211bb05
Merge branch 'master' into master
gfLobo Dec 13, 2024
d73c84e
Update ERC-7832: Adds discussions URI
gfLobo Dec 13, 2024
acff172
Update ERC-7832: Fix markdown-re-erc-dash
gfLobo Dec 13, 2024
9f42f69
Update ERC-7832: Fix markdown-link-first
gfLobo Dec 13, 2024
2daf0ac
Update ERC-7832: Fix markdown-rel-links
gfLobo Dec 13, 2024
72208c3
Update ERC-7832: Fix markdown-rel-links at Collectible ref
gfLobo Dec 13, 2024
b5cd15d
Update ERC-7832: Fix HTML-Proofer links
gfLobo Dec 14, 2024
9d1a729
Update ERC-7832: Add detailed specification and references
gfLobo Dec 15, 2024
6d818df
Merge branch 'master' of https://github.com/gfLobo/ERCs
gfLobo Dec 15, 2024
a7488ff
Update ERC-7832: Fix HTML-Proofer
gfLobo Dec 15, 2024
fd968be
Update ERC-7832: Fix HTML-Proofer
gfLobo Dec 15, 2024
c564161
Merge branch 'master' into master
gfLobo Dec 16, 2024
f0d91a5
Update ERC-7832: Update interface and constructor requirements
Dec 20, 2024
557841f
Merge branch 'master' into master
gfLobo Dec 20, 2024
3325c77
Merge branch 'master' into master
gfLobo Dec 23, 2024
6ca9746
Merge branch 'master' into master
gfLobo Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions ERCS/erc-xxxx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
---
eip: xxxx
gfLobo marked this conversation as resolved.
Show resolved Hide resolved
title: Sustainable Collections
gfLobo marked this conversation as resolved.
Show resolved Hide resolved
description: A standard for managing NFTs with dynamic fees and donation-based engagement.
gfLobo marked this conversation as resolved.
Show resolved Hide resolved
author: Gustavo Lobo (@gflobo)
discussions-to: <URL>
gfLobo marked this conversation as resolved.
Show resolved Hide resolved
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:
```solidity
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);
gfLobo marked this conversation as resolved.
Show resolved Hide resolved
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:
```solidity
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:
```solidity
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:
```solidity
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](https://github.com/gfLobo/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](../LICENSE.md).
Loading