Core Functionality
Event NFT Management
EventFactory mints unique ERC721 tokens for each event, where ownership determines control rights:Per-Event Contract Deployment
The factory deploys dedicated contracts for each event using CREATE2 for deterministic addresses:Storage Optimization
The contract uses optimized storage packing to minimize gas costs:Permission Architecture
Access Control Model
The EventFactory implements a permission delegation system through the EventManager:- Event Creator: Original NFT holder, full control
- EventManager: Authorized contract for metadata and price updates
- Delegated Addresses: Granted specific permissions through delegation proxies
Authorized Operations
Only the EventManager can call restricted functions:Event Finalization Logic
The factory handles the complex logic for transferring NFTs based on tipping results:Curation Integration
EventFactory provides optional curation contract deployment:Gas Optimization Features
Deterministic Contract Deployment
Using CREATE2 enables predictable addresses and reduces lookup costs:Library Separation
EventFactoryLib contains deployment logic to keep the main contract under the 24KB limit:Integration Points
External Contract Registration
During event creation, the factory automatically registers with dependent contracts:Query Interface
The factory provides comprehensive view functions for frontend integration:Design Advantages
- Single Source of Truth: All event data flows through one contract
- Automatic Integration: Contract registration handled during creation
- Gas Efficient: Storage packing and CREATE2 deployment optimization
- Flexible Metadata: Dynamic URI updates through authorized managers
- Creator-Friendly: Simple interface with complex logic handled internally
Testnet Considerations
Centralization
- Owner controls treasury receiver and can update contract addresses, this will be decentralized through multi-sig on main net.
- EventManager authorization is binary - either full access or none - this will be improved through dynamic, deterministic proxies.
Technical Limitations
- 96-bit limitations on dates and prices may become insufficient over time, storage will be expanded before main net release, after additional bytecode size optimizations (read below).
- String storage for metadata and categories is not gas-optimized - this will substantially reduce EventFactory’s size, allowing further improvements (see storage limitation above)
- No batch operations for multiple event management. This can be improved in a v2/v3, once implemented app-wide account abstraction.