- Overview
- Architecture Structure
- Module Descriptions
- Transfer System โ Controlled and Auditable
- Transfer Flow
- Main Transfer Functions
- Transfer Module Architecture
- Author Consensus System
- Final Inheritance Flow
- Data Flow Diagram
- Security & Compliance
- Benefits
- Deployment
- Outcome
The IP Registry is a modular, enterprise-grade smart contract system for managing intellectual property (IP) on-chain โ including registration, licensing, transfer, validation, and legal compliance.
It is built with a modular architecture, ensuring scalability, maintainability, and auditability.
Includes a controlled transfer system and author consensus mechanism for legal compliance and democratic management of rights.
Version: 2.0.0 - Modular Architecture
contracts/Registry/
โโโ types/
โ โโโ IPTypes.sol # Data structures and enums
โโโ base/
โ โโโ IPRegistryBase.sol # Core ERC721 + AccessControl
โโโ modules/
โ โโโ LicensingModule.sol # Licensing and royalty management
โ โโโ ValidationModule.sol # Legal validation and compliance
โ โโโ TransferModule/ # Advanced transfer system
โ โโโ TransferModule.sol # Main orchestrator
โ โโโ core/
โ โ โโโ TransferCore.sol # Core validation & entrypoint
โ โโโ consensus/
โ โ โโโ AuthorConsensus.sol # Author preference system
โ โโโ approval/
โ โ โโโ TransferApproval.sol # Multi-author approvals
โ โโโ history/
โ โโโ TransferHistory.sol # Transfer records & analytics
โโโ libraries/ # Supporting logic libraries
โโโ Registry.sol # Main contract combining all modules
Defines all core enums and structs:
- Enums:
EntityType,IntellectualPropertyType,TransferType,RegistrationStatus - Structs:
Author,LegalData,Registration,Licensing,TransferRecord,TransferApproval - Purpose: Centralized type definitions for maintainability
Abstract base contract providing:
- ERC721 functionality with custom
_update()override - AccessControl with
MINTER_ROLEandDEFAULT_ADMIN_ROLE - Core storage mappings for tokens, authors, licenses, ownership
- Registration system with
registerIntellectualProperty() - Rights management with
getRightsStatus()
Handles licensing and royalties:
- License lifecycle:
grantLicense(),revokeLicense(),renewRegistration() - Royalty management:
payRoyalty()with automatic distribution - Status management:
updateRegistrationStatus(),isExpired() - Analytics:
getLicenseStats(),getActiveLicenses()
Ensures legal compliance:
- Entity verification:
registerEntityLegalData(),verifyLegalCapacity() - Document validation:
validateTransfer(),setRequiredDocuments() - Due diligence:
generateDueDiligenceReport(),isTokenFullyValidated() - Compliance scoring:
getComplianceScore()(0-100 scale)
Every transfer must pass through the registry's controlled validation flow. No bypassing allowed.
ERC721._update()
โ
IPRegistryBase._update()
โ
TransferCore._validateTransferInUpdate()
โ (checks _directTransferApprovals[tokenId][to])
โ (records history and consumes approval)
โ
super._update()
Each transfer requires a direct approval, either:
- Manual:
approveDirectTransfer(tokenId, to)for simple transfers - Automatic: created after
requestTransfer()is fully approved by authors
// 1. Owner approves direct transfer
registry.approveDirectTransfer(tokenId, recipient);
// 2. Anyone can execute the transfer
registry.transferFrom(owner, recipient, tokenId);
// OR
registry.safeTransferFrom(owner, recipient, tokenId);// 1. Owner requests transfer with author approval
uint256 transferId = registry.requestTransfer(
tokenId,
newOwner,
TransferType.SALE,
false, // maintainAuthorRights
7 // deadlineInDays
);
// 2. Each author approves individually
registry.connect(author1).approveTransfer(transferId);
registry.connect(author2).approveTransfer(transferId);
// ... all authors must approve
// 3. After all approvals, transfer is executed
registry.transferFrom(owner, newOwner, tokenId);Any unauthorized transfer attempt reverts automatically.
| Function | Description |
|---|---|
approveDirectTransfer(tokenId, to) |
Approve direct transfer |
revokeDirectTransferApproval(tokenId, to) |
Revoke direct approval |
isDirectTransferApproved(tokenId, to) |
Verify approval status |
requestTransfer(...) |
Start a complex transfer |
approveTransfer(transferId) |
Author approves transfer |
getTransferHistory(tokenId) |
Retrieve all transfer history |
getPendingTransfer(transferId) |
Get pending transfer details |
hasAuthorApproved(transferId, author) |
Check individual author approval |
The TransferModule.sol was refactored into 4 specialized submodules for single-responsibility clarity:
- Responsibility: Core validation & entrypoint for
_update() - Features: Direct transfer approvals, validation logic
- Key Functions:
_validateTransferInUpdate(),approveDirectTransfer()
- Responsibility: Author preference and voting system
- Features: Individual author preferences, automatic consensus resolution
- Key Functions:
setAuthorApprovalPreference(),getConsensusStats()
- Responsibility: Multi-author approval logic
- Features: Complex transfer requests, approval workflows
- Key Functions:
requestTransfer(),approveTransfer(),cancelPendingTransfer()
- Responsibility: Records & analytics for all transfers
- Features: Complete transfer history, statistics, ownership tracking
- Key Functions:
getTransferHistory(),getTransferStats(),hasBeenOwner()
Allows authors to vote on whether transfers require approval, enabling democratic management of IP ownership.
- Each author sets individual
true/falsepreference - Automatic consensus resolution based on voting rules
- Dynamic update of
requiresAuthorApprovalstate - Protection: only authors can enable approval requirements
| Scenario | Result |
|---|---|
| All authors enable | Approval required |
| All authors disable | Approval removed |
| Conflicting opinions | Keeps current state |
| Owner not author | Cannot enable |
setAuthorApprovalPreference(tokenId, bool preference);
getAuthorApprovalPreference(tokenId, author);
getAllAuthorPreferences(tokenId);
getConsensusStats(tokenId);// โ This will revert if authors require approval
registry.approveDirectTransfer(tokenId, buyer);
// โ
This works - uses author approval system
registry.requestTransfer(tokenId, buyer, SALE, false, 7);IPRegistry (Main Contract)
โโโ LicensingModule
โ โโโ IPRegistryBase
โโโ TransferModule
โ โโโ TransferHistory
โ โโโ TransferApproval
โ โโโ AuthorConsensus
โ โโโ TransferCore
โ โโโ IPRegistryBase
โโโ ValidationModule
โโโ IPRegistryBase
graph TD
A[IPTypes] --> B[IPRegistryBase]
B --> C[LicensingModule]
B --> D[TransferModule]
B --> E[ValidationModule]
C --> F[Registry]
D --> F
E --> F
D --> G[TransferCore]
D --> H[AuthorConsensus]
D --> I[TransferApproval]
D --> J[TransferHistory]
G --> K[Direct Transfers]
H --> L[Author Preferences]
I --> M[Complex Transfers]
J --> N[Transfer Records]
graph TD
A[User calls transferFrom] --> B[_validateTransferInUpdate]
B --> C{Has Direct Approval?}
C -->|Yes| D[Consume approval & record]
C -->|No| E[โ REVERT: Use approval system]
D --> F[Notify licenses]
F --> G[โ
Execute ERC721 transfer]
H[approveDirectTransfer] --> I[Grant Direct Approval]
J[requestTransfer + all approvals] --> I
I --> K[Ready for transfer]
- Role-based permissions on sensitive functions
- MINTER_ROLE for registration
- DEFAULT_ADMIN_ROLE for system management
- Double-layer validation for author approvals
- No bypass possible - all transfers go through validation
- Single-use approvals - consumed after transfer
- On-chain history for full auditability
- Legal entity verification with
LegalDatastructs - Due diligence reports with compliance scoring
- Document validation system
- Standard interface preserved - works with existing wallets/exchanges
- Custom
_update()override for controlled transfers - Gas-efficient validation with minimal overhead
- Modular structure - each module has single responsibility
- Clear separation of concerns - easy to locate and fix issues
- ~5x smaller modules compared to monolithic approach
- Easily extendable (e.g., Dispute, Auction, Insurance modules)
- Upgradeable via proxy patterns
- Independent module updates possible
- Every action logged on-chain with events
- Full ownership and approval history tracked
- Compliance scoring for legal validation
- Clean APIs with intuitive function names
- Easy-to-read modular design
- Comprehensive view functions for data access
# Deploy the complete registry system
npx hardhat run scripts/deploy-registry.js
# The Registry contract includes all functionality
# No need to deploy individual modules// Get system information
(string memory architecture, string[] memory modules, string memory transferSystem) =
registry.getSystemInfo();
// Get global statistics
(uint256 totalTokens, uint256 totalAuthors, uint256 totalLicenses, string memory version) =
registry.getGlobalStats();After full modular refactor and consensus integration:
- โ ~5x smaller modules, easier to audit and maintain
- โ 100% backward compatibility with existing interfaces
- โ Secure, transparent multi-author approval system
- โ Legally compliant and production-ready
- โ Modular architecture ready for future extensions
The IP Registry delivers a professional-grade modular system, combining:
- Licensing - Complete royalty and license management
- Ownership - Secure transfer system with author consensus
- Author Rights - Democratic management of IP rights
- Legal Compliance - Full validation and due diligence
All within a scalable, maintainable, and auditable blockchain architecture.
ยฉ 2025 โ All Rights Reserved.