Skip to content

Update ERC-7743: Complete Architecture Overhaul - Direct Author Minting + Platform Fee System + Payment Fixes #1083

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

Closed
wants to merge 19 commits into from

Conversation

jamesavechives
Copy link
Contributor

@jamesavechives jamesavechives commented Jun 12, 2025

Summary

Major architectural overhaul of ERC-7743 that transforms it from admin-controlled minting to fully decentralized direct author minting, adds a comprehensive platform fee system for sustainable monetization, and fixes the fundamentally broken payment system that required contracts to pay from empty balances.

🚀 Major Architecture Changes

🔧 Direct Author Minting (Security & Decentralization)

  • Before: Admin-controlled minting with server-stored private keys
  • After: Authors mint directly using their own wallets
  • Security: Eliminates admin private key storage on servers
  • Decentralization: No central authority required for token creation
  • UX: Authors control their own minting process

💰 Platform Fee System (Monetization)

  • Dual Revenue Model: Provider royalties + Platform fees
  • Configurable Platform Fees: 0-10% range (basis points)
  • Automatic Fee Distribution: Smart contract handles all payments
  • Admin Controls: Platform fee ratio and recipient management
  • Transparent Costs: Users can query exact fees before transactions

🔧 Core Payment System Fix

  • Before: Contract pays from address(this).balance (always fails)
  • After: Users send ETH with msg.value to cover all fees
  • Enhanced: Now handles both provider fees AND platform fees

🆕 New Features Added

Minting Functions

  • Direct Minting: provide() now allows authors to mint directly to themselves
  • Removed: mintTokenTo() - simplified to direct author minting only
  • Security: No more admin-only minting restrictions

Platform Fee Management

function setPlatformFeeRatio(uint256 newRatio) external onlyOwner;
function setPlatformFeeRecipient(address newRecipient) external onlyOwner;
function calculatePlatformFee(uint256 transferValue) public view returns (uint256);
function getTransferCostBreakdown(uint256 assetId, address caller) 
    external view returns (uint256 providerFee, uint256 platformFee, uint256 totalCost);

Enhanced Transfer System

  • Dual Transfer System:
    • transferFrom(): Free transfers (ERC-721 compatibility)
    • transferFromWithPayment(): Paid transfers with provider royalties + platform fees
  • Provider Fee ExemptionMaintained:
    • Original authors/providers can transfer their own tokens without paying fees
    • Eliminates awkward "pay yourself" scenario for creators
  • Smart Transfer FunctionEnhanced:
    • smartTransfer(): Now handles both provider and platform fees automatically
    • Optimal UX - providers get free transfers, others pay total fees
  • Enhanced Cost Calculation:
    • getTransferCost(): Returns total cost (provider fee + platform fee)
    • getTransferCostBreakdown(): Detailed fee breakdown for transparency

New Events

event PlatformFeeUpdated(uint256 oldRatio, uint256 newRatio);
event PlatformFeeRecipientUpdated(address oldRecipient, address newRecipient);
event PlatformFeePaid(uint256 indexed assetId, address indexed payer, uint256 feeAmount);

💡 Enhanced Fee Logic Matrix

Caller Provider Fee Platform Fee Total Cost Implementation
Provider (Original Author) ❌ $0 ❌ $0 FREE Free transfer + ETH refund
Anyone (Transfer Value = 0) ❌ $0 ❌ $0 FREE Free for zero-fee assets
Other Token Owner ✅ Set by provider ✅ % of provider fee Provider + Platform Dual fee payment

🏗️ Platform Fee Calculation

Total Cost = Provider Fee + Platform Fee
Platform Fee = Provider Fee × Platform Fee Ratio ÷ 10,000
Example: Provider Fee = 1 ETH, Platform Fee = 2.5% → Total = 1.025 ETH

🔒 Security Enhancements

  • No Admin Private Keys: Eliminated server-side key storage
  • Fee Validation: Maximum 10% platform fee limit
  • Payment Validation: Proper ETH handling and excess returns
  • Access Controls: Only contract owner can modify platform fees

📖 Updated Specification

  • Interface Updates: All new functions added to IDigitalAsset
  • Documentation: Comprehensive platform fee system documentation
  • Events: Complete event coverage for fee management
  • Examples: Updated code examples with platform fee logic

Benefits Summary

  • 🔐 More Secure: No admin private keys stored on servers
  • 🌐 Fully Decentralized: Authors control their own minting
  • 💰 Sustainable Revenue: Dual fee structure for platforms
  • 👨‍🎨 Creator-Friendly: Authors don't pay fees to transfer their own work
  • 🔄 Backward Compatible: Standard transferFrom() still works
  • ⚡ Transparent: Clear fee breakdown before transactions
  • 🛡️ Production Ready: Working payment system with proper validation

🧪 Testing Coverage

✅ Tested direct author minting functionality
✅ Verified platform fee calculation and distribution
✅ Confirmed dual fee payment system works correctly
✅ Tested provider fee exemption logic
✅ Verified smart transfer automatic fee detection
New: Tested platform fee management functions
New: Verified fee recipient updates work correctly
New: Confirmed maximum fee limits are enforced

📁 Files Changed

  • contracts/src/DigitalAsset.sol - Complete overhaul with platform fees
  • contracts/src/MONFT.sol - Removed admin-only minting restrictions
  • contracts/src/IDigitalAsset.sol - Updated interface with platform fee functions
  • ERCs/ERCS/erc-7743.md - Comprehensive specification update
  • ERCs/assets/erc-7743/DigitalAsset.sol - Reference implementation updated
  • ERCs/assets/erc-7743/MONFT.sol - Reference implementation updated
  • ERCs/assets/erc-7743/IDigitalAsset.sol - Reference interface updated

🎯 Migration Impact

This is a breaking change that transforms ERC-7743 from a centralized admin-controlled system to a fully decentralized direct author minting system with sustainable platform monetization. The changes make the standard production-ready for real-world deployment while maintaining creator-friendly policies.

Previous implementations will need to migrate to support:

  1. Direct author minting instead of admin minting
  2. Platform fee handling in transfer logic
  3. Updated interface definitions

This update makes ERC-7743 secure (no admin keys), decentralized (direct author control), sustainable (platform fees), and creator-friendly (provider exemptions) - a complete solution for digital asset tokenization platforms.

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Jun 12, 2025

File ERCS/erc-7743.md

Requires 2 more reviewers from @g11tech, @lightclient, @SamWilsn, @xinbenlv

@eip-review-bot eip-review-bot changed the title Update ERC-7743 : asset code issue Update ERC-7743: asset code issue Jun 17, 2025
@jamesavechives jamesavechives changed the title Update ERC-7743: asset code issue Update ERC-7743: Fix transfer payment system to use user-paid model Jun 17, 2025
@jamesavechives jamesavechives changed the title Update ERC-7743: Fix transfer payment system to use user-paid model Update ERC-7743 : Payment System Fix + Provider Fee Exemption Jun 18, 2025
@eip-review-bot eip-review-bot changed the title Update ERC-7743 : Payment System Fix + Provider Fee Exemption Update ERC-7743: Payment System Fix + Provider Fee Exemption Jun 18, 2025
@jamesavechives jamesavechives changed the title Update ERC-7743: Payment System Fix + Provider Fee Exemption Update ERC-7743: Complete Architecture Overhaul - Direct Author Minting + Platform Fee System + Payment Fixes Jun 20, 2025
@SamWilsn
Copy link
Contributor

ERC-7743 is final and may no longer be modified. You may open a new proposal, with a different number, if you'd like to continue development.

@SamWilsn SamWilsn closed this Jun 25, 2025
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