Overview
This is a Security Token smart contract implementation from CoMakery (dba Upside). The core purpose of the token is to enforce transfer restrictions for certain groups while supporting multiple token types (RegS, RegD, RegCF, etc.) based on investor identity and regulatory requirements.
This implementation attempts to balance simplicity and sufficiency for smart contract security tokens that need to comply with regulatory authorities - without adding unnecessary complexity for simple use cases. It implements the ERC-20 token standard with ERC-1404 security token transfer restrictions, enhanced with multi-type token functionality.
This approach takes into account yet-to-be-standardized guidance from ERC-1400 (which has additional recommendations for more complex security token needs) and ERC-1404, which offers an approach similar to ERC-902. Unfortunately, ERC-1404 does not adopt ERC-1066 standard error codes—which this project may adopt in the future. Since no security token standards have reached mass adoption or maturity, and they do not fully agree with each other, the token optimizes for a simple and sufficient implementation.
Simplicity is desirable so that contract functionality is clear. It also reduces the number of smart contract lines that need to be secured (each line of a smart contract is a security liability).
Contracts
RestrictedLockupToken
The RestrictedLockupToken
contract is the core token contract that implements the ERC-20 token standard with ERC-1404 transfer restrictions.
RestrictedLockupTokenExtension
The RestrictedLockupTokenExtension
contract is an extension of the RestrictedLockupToken
contract that implements token holder management, vestings, and optimized token holding operations through a delegatecall fallback pattern.
RestrictedLockupTokenManagementExtension
The RestrictedLockupTokenManagementExtension
contract is an extension of the RestrictedLockupToken
contract that implements additional token holder management through a delegatecall fallback pattern.
AccessControl
The AccessControl
contract implements an access control system for the token.
IdentityRegistry
The IdentityRegistry
contract implements a reusable global identity registry across multiple token deployments.
InterestPayment
The InterestPayment
contract implements an interest accrual and payment system for token holders.
PurchaseContract
The PurchaseContract
contract implements atomic token purchase mechanisms and fee distribution.
RestrictedSwap
The RestrictedSwap
contract implements an atomic token swap mechanism.
SnapshotPeriods
The SnapshotPeriods
contract tracks historical token ownership for interest/dividend calculations.
Storage
The Storage
contract implements the storage layout for the core token contract and extensions.
TransferRules
The TransferRules
contract implements the issuance and transfer rules system.
Disclaimer
This open or closed source software is provided with no warranty. This is not legal advice. CoMakery (dba Upside) is not a legal firm and is not your lawyer. Securities are highly regulated across multiple jurisdictions. Issuing a security token incorrectly can result in financial penalties or jail time if done incorrectly. Consult a lawyer and tax advisor. Conduct an independent security audit of the code.
Features
Compliance
- AML/KYC: Integrated identity verification registry
- Transfer Restrictions: Regulatory holding periods
- Audit Trails: Complete transaction and holding history
- Role Separation: Multi-signature governance support
Holding Management
- Wallet Holdings: User-specific view with FIFO ordering
- Global Holdings: System-wide administrative view
- Transfer Operations: Standard FIFO, timelock, and specific holding transfers
- Token Type Updates: Regulatory reclassification support
TradFi Integration
- Purchase Contract: Atomic stablecoin-to-token exchanges
- Interest Payments: Bond-like interest accrual and claiming
- Dividend Distributions: Equity-like profit sharing
Snapshot System
- Time-Weighted Ownership: Fair interest/dividend calculations
- Historical Lookups: Past balance queries for any timestamp
- Automatic Updates: Seamless integration with token transfers
DeFi Integration
- ERC-20 Compatibility: Standard interface maintained
- Soft Burn: Allowance-based burning for yield farming
- Batch Operations: Gas-efficient multi-transaction support
Burning Mechanisms
- Standard Burn: Reserve Admin direct authority
- Soft Burn: Allowance-based for DeFi protocols
- Specific Holding Burn: Precise targeting by global index