Core Features
1. Fallback Extension Pattern
- Modular Architecture: Core token functionality separated from advanced features via
RestrictedLockupTokenExtension
- Shared Storage: Both contracts operate on an identical storage layout through
delegatecall
2. Bitmask-Optimized Holdings
- Efficient Storage: Holdings tracked using bitmap indices instead of arrays
- Population Count Operations: Fast counting of holdings using CPU-level bit manipulation
- Bit Scan Algorithms: Direct access to specific holdings without iteration
- Gas Savings: Significant reduction in gas costs for users with many holdings
3. Multi-Type Token System
- Regulatory Compliance: Single contract handles RegS, RegD, RegCF, and custom token types
- Automatic Classification: Token types assigned based on investor identity and rules
- FIFO Transfer Logic: Maintains regulatory compliance through oldest-first transfers
- Flexible Minting: Both automatic and explicit token type specification
4. Unified Interest & Dividends Contract
- Dual Functionality: Handles both debt-like interest payments and equity-like dividends
- Snapshot Integration: Leverages SnapshotPeriods for historical balance calculations
- Multiple Token Support: Distributes any ERC-20 token as dividends or interest
- Backward Compatibility: Maintains IDividends interface for existing integrations
5. Atomic Purchase System
- Multi-Party Payments: Single transaction handles originator, admin, and interest funding
- AML/KYC Integration: Automatic compliance validation for all participants
- Purchase Tracking: Unique identifiers prevent duplicate transactions
- Automation Ready: Designed for external system integration