Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

FRAMED Contracts

Smart contracts for the FRAMED platform. Built with Foundry.

Overview

FRAMED is a platform with subscription-based content access. These contracts handle:

  • Subscription NFTs - EIP-5643 compliant NFTs representing content subscriptions
  • Payment Splitting - Dynamic revenue distribution between artists, platform, and referrers

Contracts

FramedSubscriptionNFT

EIP-5643 compliant subscription NFT for content access on Base L2.

Function Description
mint(contentId, duration, referrer) Mint subscription (1-12 months)
renewSubscription(tokenId, duration) Extend existing subscription
cancelSubscription(tokenId) Cancel auto-renewal
isActive(tokenId) Check if subscription is active
hasActiveSubscription(user, contentId) Check user's subscription status

FramedPaymentSplitter

Handles USDC payment distribution with configurable splits.

Default Split:

  • Artist: 85% (90% without referrer)
  • Platform: 10%
  • Referrer: 5%
Function Description
distribute(contentId, amount, referrer) Distribute payment to recipients
setContentSplit(contentId, recipients, shares) Configure content-specific split
setArtistDefault(recipients, shares) Set artist's default split
lockContentSplit(contentId) Permanently lock a split config

Contract Addresses

Contract Base Sepolia Base Mainnet
FramedSubscriptionNFT TBD TBD
FramedPaymentSplitter TBD TBD
USDC 0x036CbD53842c5426634e7929541eC2318f3dCF7e 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Development

Prerequisites

Build

forge build

Test

forge test

Run with verbosity:

forge test -vvv

Format

forge fmt

Gas Snapshots

forge snapshot

Deployment

Environment Setup

export PRIVATE_KEY=<deployer_private_key>
export PLATFORM_ADDRESS=<platform_fee_recipient>
export USDC_ADDRESS=0x036CbD53842c5426634e7929541eC2318f3dCF7e  # Base Sepolia

Deploy to Testnet

forge script script/Deploy.s.sol:DeployScript \
  --rpc-url https://sepolia.base.org \
  --broadcast \
  --verify

Deploy to Mainnet

export USDC_ADDRESS=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
forge script script/Deploy.s.sol:DeployScript \
  --rpc-url https://mainnet.base.org \
  --broadcast \
  --verify

Architecture

src/
├── FramedSubscriptionNFT.sol   # EIP-5643 subscription NFT
├── FramedPaymentSplitter.sol   # Revenue distribution
└── interfaces/
    └── IERC5643.sol            # EIP-5643 interface

test/
├── FramedSubscriptionNFT.t.sol
├── FramedPaymentSplitter.t.sol
└── mocks/
    └── MockERC20.sol

script/
└── Deploy.s.sol

Standards

  • EIP-5643 - Subscription NFTs
  • ERC-721 - Non-Fungible Token Standard
  • ERC-20 - Token Standard (USDC payments)

Security

  • ReentrancyGuard on all payment functions
  • Ownable access control for admin functions
  • SafeERC20 for token transfers
  • Split configuration locking for immutable revenue sharing

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages