A compliant, institution-grade platform for tokenizing real-world assets (like Real Estate, Treasury Bills, etc.) on the Ethereum blockchain. This project implements strict regulatory compliance features, including whitelisted transfers (KYC), forced transfers for asset recovery, and a snapshot-based dividend distribution system.
- Identity Registry: A centralized whitelist that manages KYC status for all users.
- Gated Transfers: The
CompliantTokenchecks theIdentityRegistrybefore every transfer. If a sender or receiver is not verified, the transaction reverts. - Separation of Concerns: Compliance logic is decoupled from the asset token, allowing a single KYC update to reflect across all assets.
- Legal Admin Role: Empowers a designated legal entity to seize tokens from a user and transfer them to another address.
- KYC Bypass: Forced transfers bypass standard KYC checks, ensuring court orders or lost key recoveries can always be executed.
- Snapshotting: Tokens track historical balances using OpenZeppelin's
Checkpointssystem (replacing the deprecatedERC20Snapshot). - Stablecoin Yields: Admins can deposit stablecoins (e.g., USDC) linked to a specific snapshot ID.
- Pro-rata Claims: Token holders claim their share of the dividend based on their exact holdings at the time of the snapshot.
- Asset Factory: A factory contract ensuring all deployed tokens utilize the verified, compliant bytecode and are automatically linked to the canonical Identity Registry.
- Solidity: v0.8.20
- Framework: Hardhat
- Libraries: OpenZeppelin Contracts v5.x
- Testing: Chai & Ethers.js
- Node.js (v18+)
- npm
npm installnpx hardhat compileRun the comprehensive test suite including Compliance, Forced Transfer, and Dividend flows:
npx hardhat testDeploy the entire suite (Registry, Factory, MockUSDC, Factory-deployed Token, Distributor) to a local Hardhat node:
npx hardhat run scripts/deploy.js| Contract | Path | Description |
|---|---|---|
| IdentityRegistry | contracts/core/IdentityRegistry.sol |
Manages isVerified mapping and COMPLIANCE_ADMIN_ROLE. |
| CompliantToken | contracts/token/CompliantToken.sol |
The RWA ERC20. Overrides _update for KYC checks and implements Checkpoints for history. |
| AssetFactory | contracts/core/AssetFactory.sol |
Deploys new CompliantToken instances. |
| DividendDistributor | contracts/core/DividendDistributor.sol |
Handles USDC deposits and user claims based on historical snapshots. |
This project is licensed under the MIT License.