Skip to main content

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

RolePurposeBackend Usage
MINTER_ROLEIssue new licensesPrimary role for backend systems
PAUSER_ROLEEmergency pause/unpauseEmergency situations only
UPGRADER_ROLEContract upgradesDevelopment/maintenance
DEFAULT_ADMIN_ROLERole managementAdministrative 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

  1. Issuance: safeMint() → Returns assigned token ID
  2. Active: License is valid and functional
  3. Expired: Automatic expiry based on timestamp (0 = no expiry)
  4. Invalidated: Manually revoked by authorized roles
  5. 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 expiry
  • isTokenExpired(): Check if license is expired
  • startTime(): Get license start timestamp
  • endTime(): Get license end timestamp
  • locked(): Check soulbound status (ERC-5192)
  • updateLicenseMetadata(): Update license metadata
  • revoke(): Revoke and burn licenses
  • reassign(): Transfer licenses to new owners

📈 Usage Statistics

Available Functions

  • totalSupply(): Total licenses issued
  • isTokenExpired(tokenId): Check license expiry
  • startTime(tokenId): Get start timestamp
  • endTime(tokenId): Get end timestamp
  • locked(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

  1. MINTER_ROLE is the primary role for backend license issuance
  2. Soulbound nature prevents license trading/transfer
  3. Upgradeable architecture allows future improvements
  4. Time-based expiry provides flexible license management
  5. Admin reassignment allows license transfers when needed
  6. 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.