VibeFactory Contract
The VibeFactory contract is the core factory for creating Real-Time Asset (RTA) NFTs and managing their delegation system. It extends ERC-721 functionality with integrated delegation management.Contract Overview
Address:0x49B2E60fF51B107624be84363B718cfF292A0517Standard: ERC-721 (NFT) with custom extensions
Features: RTA creation, delegation management, cross-contract integration
Core Functions
Creating RTAs
Basic RTA Creation
mode: Stream mode identifierstoreToFilecoin: Whether to store content on Filecoindistance: Geographic constraint in metersmetadataURI: IPFS URI for metadataticketsAmount: Number of tickets available (0 for no tickets)ticketPrice: Price per ticket in weipayPerStream: Enable real-time payments via PPMstreamPrice: Payment rate per minute in wei
RTA Creation with Delegation
Delegation System
The VibeFactory implements a ProxyAdmin-based delegation system that allows RTA creators to authorize others to manage their vibestreams.Setting Delegates
- ProxyAdmin
- ProxyAdmin owner
- RTA creator (through authorized addresses)
Removing Delegates
Authorization Management
Access Control
Permission Hierarchy
- Contract Owner: Full administrative control
- ProxyAdmin: Delegation management across all RTAs
- Authorized Addresses: Global permissions for delegation
- RTA Creator: Permissions for their specific RTAs
- Delegates: Permissions for delegated RTAs
Modifier: canModifyVibestream
RTA Management
Metadata Updates
canModifyVibestream permission.
Finalization
Cross-Contract Integration
PPM Integration
When creating RTAs withpayPerStream = true, the contract automatically registers the vibestream with the PPM contract:
VibeKiosk Integration
RTAs withticketsAmount > 0 are registered with the VibeKiosk for ticket sales:
View Functions
RTA Data Retrieval
Events
RTA Creation
Delegation Events
Gas Optimization
Gas Buffer
The contract implements a gas buffer mechanism to prevent operations from failing due to insufficient gas:Security Features
Reentrancy Protection
All state-changing functions use OpenZeppelin’sReentrancyGuard: