Delegation System
The VibeFactory implements a ProxyAdmin-based delegation system that allows RTA creators to authorize others to manage their vibestreams without transferring NFT ownership.Overview
Delegation enables creators to grant management permissions for specific RTAs to trusted parties while retaining ownership of the underlying NFT. This is useful for:- Management Services: Hiring third parties to manage vibestreams
- Team Collaboration: Allowing team members to operate vibestreams
- Automation: Delegating to smart contracts or bots
- Temporary Access: Granting time-limited management rights
Permission Hierarchy
The delegation system implements a multi-level permission hierarchy:graph TD
A[Contract Owner] —> B[ProxyAdmin]
A —> C[Authorized Addresses]
B —> D[Per-RTA Delegates]
C —> D
E[RTA Creator] —> Dstyle A fill:#ff9999
style B fill:#99ccff
style C fill:#99ff99
style D fill:#ffcc99
style E fill:#cc99ff
1. Contract Owner
- Full administrative control
- Can set ProxyAdmin address
- Can manage authorized addresses
- Emergency controls
2. ProxyAdmin
- Can set/remove delegates for any RTA
- Manages global delegation operations
- Typically a multisig or governance contract
3. Authorized Addresses
- Global whitelist of trusted addresses
- Can perform delegation operations across all RTAs
- Managed by owner or ProxyAdmin
4. RTA Creator
- Can manage their own RTAs through authorized addresses
- Retains NFT ownership
- Can request delegation during RTA creation
5. Delegates
- Authorized to manage specific RTAs
- Can update metadata and finalize RTAs
- Cannot transfer ownership
Core Functions
Setting Delegates
Direct Delegation (ProxyAdmin Only)
Delegation During Creation
Removing Delegates
Authorization Management
Adding Authorized Addresses
Removing Authorized Addresses
Access Control Implementation
Permission Checking
ThecanModifyVibestream modifier implements comprehensive permission checking:
ProxyAdmin Validation
ProxyAdmin permissions are validated through multiple pathways:Delegated Operations
Delegates can perform the following operations on assigned RTAs:Metadata Management
Finalization
State Tracking
Delegation Mappings
View Functions
Events
Delegation Events
Security Considerations
Delegation Isolation
Each delegation is isolated to a specific RTA:Owner Protection
RTA creators retain ultimate control:- NFT ownership cannot be transferred by delegates
- Only specific management functions are delegated
- Creators can work through authorized addresses to manage delegation
Emergency Controls
Contract owner maintains emergency capabilities:- Can update ProxyAdmin address
- Can modify authorized address list
- Can pause contract operations if needed
Usage Examples
Creating RTA with Delegation
Setting Delegate After Creation
Delegate Operations
Authorization Management
Integration Patterns
Management Services
Delegation enables professional management services:- Creator creates RTA with delegation to service
- Service manages day-to-day operations
- Creator retains ownership and ultimate control
- Revenue flows directly to creator
Team Collaboration
Teams can collaborate on vibestream management:- Add team members to authorized addresses
- Team members can delegate specific RTAs
- Distributed management with centralized oversight
Automated Management
Smart contracts can be delegated for automation:- Deploy management contract with specific logic
- Delegate RTAs to management contract
- Automated operations based on predefined rules
Delegation Flow Diagram
sequenceDiagram
participant Creator
participant VibeFactory
participant ProxyAdmin
participant DelegateCreator->>VibeFactory: createVibestreamWithDelegate()
VibeFactory->>VibeFactory: mint RTA NFT
VibeFactory->>VibeFactory: set delegate mapping
VibeFactory—>>Creator: vibeIdNote over Delegate: Can now manage RTADelegate->>VibeFactory: setMetadataURI()
VibeFactory->>VibeFactory: check canModifyVibestream
VibeFactory—>>Delegate: successProxyAdmin->>VibeFactory: removeDelegate()
VibeFactory->>VibeFactory: clear delegate mapping
VibeFactory—>>ProxyAdmin: successNote over Delegate: No longer has access
Best Practices
For Creators
- Verify Delegates: Only delegate to trusted addresses
- Monitor Activity: Track delegate actions through events
- Use Authorized Services: Work with established management services
- Retain Control: Keep ultimate oversight through ownership
For Delegates
- Respect Boundaries: Only perform authorized operations
- Communicate Changes: Inform creators of significant actions
- Maintain Security: Protect delegate private keys
- Follow Guidelines: Adhere to creator’s management preferences
For ProxyAdmin
- Governance: Implement proper governance for delegation decisions
- Transparency: Make delegation operations visible
- Security: Use multisig or timelock for ProxyAdmin operations
- Documentation: Maintain clear delegation policies