Digital License Contract - Overview
📋 What is the Digital License Contract?
The Digital License Contract is a soulbound ERC-721 NFT contract designed for business-grade digital licenses. Built with upgradeable architecture and comprehensive access control, it provides secure license management for Innovation City's digital identity system.
🏗️ Technical Architecture
Contract Type
- ERC-721 NFT: Standard non-fungible token implementation
- Soulbound (ERC-5192): Non-transferable, permanently bound to holder
- Upgradeable (UUPS): Contract can be upgraded while preserving state
- Access Control: Role-based permissions for secure operations
- ERC-7572: Contract-level metadata standard
- ERC-7858: Expirable NFT standard (time-based expiry)
Core Features
- ✅ Soulbound Security: Licenses cannot be transferred, sold, or burned
- ✅ Time-Based Expiry: Automatic expiry with flexible timestamp management
- ✅ Admin Invalidation: Licenses can be manually invalidated by authorized roles
- ✅ Admin Reassignment: Admin can transfer licenses to new owners
- ✅ Emergency Controls: Pausable system for security incidents
- ✅ Upgradeable: Contract logic can be updated
🔐 Access Control & Roles
Role Hierarchy
DEFAULT_ADMIN_ROLE (0x0000...0000)
├── MINTER_ROLE (0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6)
├── PAUSER_ROLE (0x65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a)
└── UPGRADER_ROLE (0x189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3)
Note: These are role identifiers (hashes), not wallet addresses. Wallet addresses need to be assigned to these roles once deployed.
Role Responsibilities
| Role | Purpose | Backend Usage |
|---|---|---|
| MINTER_ROLE | Issue new licenses | Primary role for backend systems |
| PAUSER_ROLE | Emergency pause/unpause | Emergency situations only |
| UPGRADER_ROLE | Contract upgrades | Development/maintenance |
| DEFAULT_ADMIN_ROLE | Role management | Administrative functions - Role Updates |
📊 Token Economics
Token Supply
- Infinite Supply: No maximum limit on licenses
- Sequential IDs: Auto-incrementing from 1
Minting Process
function safeMint(
address to,
string calldata uri,
uint64 startTime,
uint64 endTime // 0 = no expiry
) external onlyRole(MINTER_ROLE)
License Lifecycle
- Issuance:
safeMint()→ Returns assigned token ID - Active: License is valid and functional
- Expired: Automatic expiry based on timestamp (0 = no expiry)
- Invalidated: Manually revoked by authorized roles
- Soulbound: Permanently bound to holder, cannot be transferred or sold
🎯 Events & Monitoring
Core Events
event LicenseIssued(
address indexed to,
uint256 indexed tokenId,
uint64 startTime,
uint64 endTime,
string uri
);
event LicenseUpdated(
uint256 indexed tokenId,
bool invalid,
uint64 expiresAt,
string reason
);
event LicenseReassigned(
uint256 indexed tokenId,
address indexed from,
address indexed to,
string reason
);
event Locked(uint256 tokenId); // ERC-5192 soulbound event
Event Usage
- LicenseIssued: Track new license issuance
- LicenseUpdated: Monitor status changes (suspension, reactivation)
- LicenseReassigned: Track admin reassignments
- Locked: Confirm soulbound status for marketplaces
🔧 Key Functions
Primary Functions
safeMint(): Issue new licenses with metadata and expiryisTokenExpired(): Check if license is expiredstartTime(): Get license start timestampendTime(): Get license end timestamplocked(): Check soulbound status (ERC-5192)updateLicenseMetadata(): Update license metadatarevoke(): Revoke and burn licensesreassign(): Transfer licenses to new owners
📈 Usage Statistics
Available Functions
totalSupply(): Total licenses issuedisTokenExpired(tokenId): Check license expirystartTime(tokenId): Get start timestampendTime(tokenId): Get end timestamplocked(tokenId): Check soulbound status
Business Integration
- Backend Systems: Use MINTER_ROLE for automated issuance
- Administrative: Use admin functions for role management
- Monitoring: Track events for compliance and reporting
- Emergency: Use pauser role for system-wide stops
🎯 Key Takeaways
- MINTER_ROLE is the primary role for backend license issuance
- Soulbound nature prevents license trading/transfer
- Upgradeable architecture allows future improvements
- Time-based expiry provides flexible license management
- Admin reassignment allows license transfers when needed
- Event-driven monitoring for compliance and analytics
This contract is designed for business-grade license management with security, upgradeability, and administrative control as core principles.