Smart contracts for the FRAMED platform. Built with Foundry.
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
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 |
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 | Base Sepolia | Base Mainnet |
|---|---|---|
| FramedSubscriptionNFT | TBD | TBD |
| FramedPaymentSplitter | TBD | TBD |
| USDC | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
forge buildforge testRun with verbosity:
forge test -vvvforge fmtforge snapshotexport PRIVATE_KEY=<deployer_private_key>
export PLATFORM_ADDRESS=<platform_fee_recipient>
export USDC_ADDRESS=0x036CbD53842c5426634e7929541eC2318f3dCF7e # Base Sepoliaforge script script/Deploy.s.sol:DeployScript \
--rpc-url https://sepolia.base.org \
--broadcast \
--verifyexport USDC_ADDRESS=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
forge script script/Deploy.s.sol:DeployScript \
--rpc-url https://mainnet.base.org \
--broadcast \
--verifysrc/
├── 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
- EIP-5643 - Subscription NFTs
- ERC-721 - Non-Fungible Token Standard
- ERC-20 - Token Standard (USDC payments)
- ReentrancyGuard on all payment functions
- Ownable access control for admin functions
- SafeERC20 for token transfers
- Split configuration locking for immutable revenue sharing
MIT