A complete Solidity-based Real-World Asset (RWA) treasury tokenization protocol inspired by Ondo Finance's OUSG tokenized short-term US Treasuries product. This protocol enables tokenization of off-chain treasury assets with yield accrual, compliance features, and upgradeable architecture.
- Yield-Bearing Tokens: Two token models:
- OUSG-style (Appreciating): Token balance stays fixed, price/NAV increases over time to reflect yield
- rOUSG-style (Rebasing): Token price stays ~$1, balances increase daily to reflect yield accrual
- Minting & Redemption: Permissioned minting when off-chain assets are deposited, redemption with off-chain payout signaling
- Yield Accrual: Configurable APY (default 4%) with daily/periodic yield updates
- Compliance: Whitelist/blacklist functionality for KYC/AML compliance
- Access Control: Role-based access control (MINTER, REDEEMER, PAUSER, ORACLE, ADMIN)
- Upgradeability: UUPS proxy pattern for implementation upgrades
- Pausability: Emergency pause functionality for all operations
- Price Oracle: Mock oracle for NAV/price updates (production-ready for Chainlink integration)
- Transfer Restrictions: Enforceable whitelist/blacklist on transfers
- Gas Optimized: Efficient storage and computation patterns
- Security: Reentrancy guards, access control, overflow protection
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Users / Investors β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UUPS Proxy (TreasuryToken) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Implementation Contract β β
β β - mint() / redeem() β β
β β - yield accrual β β
β β - whitelist/blacklist β β
β β - pause/unpause β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββ¬βββββββββββββββ¬βββββββββββββββ¬βββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Price Oracle β β Access Controlβ β MockUSDC β
β (NAV/Price) β β (Roles) β β (Underlying) β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
- TreasuryToken: Main appreciating token (OUSG-style) - balance fixed, price increases
- RebasingTreasuryToken: Rebasing variant (rOUSG-style) - price fixed, balance increases
- TreasuryPriceOracle: Price oracle for NAV updates and yield rate management
- MockUSDC: Mock stablecoin for testing mint/redemption flows
- Token balance remains constant
- Price/NAV per token increases over time
- Formula:
price = initialPrice * (1 + yieldRate * timeElapsed / 365 days) - Users see value appreciation through price increase
- Token price stays constant (~$1)
- Token balances increase daily via rebasing
- Formula:
balance = scaledBalance * rebaseIndex - Users see value appreciation through balance increase
evm-rwa-treasury-tokenization/
βββ contracts/
β βββ interfaces/
β β βββ ITreasuryToken.sol
β β βββ ITreasuryPriceOracle.sol
β βββ treasury/
β β βββ TreasuryToken.sol
β β βββ RebasingTreasuryToken.sol
β βββ oracle/
β β βββ TreasuryPriceOracle.sol
β βββ mocks/
β βββ MockUSDC.sol
βββ scripts/
β βββ deploy.js
βββ test/
β βββ TreasuryToken.test.js
β βββ RebasingTreasuryToken.test.js
βββ hardhat.config.js
βββ helper-config.js
βββ package.json
βββ README.md
- Node.js (v16 or higher)
- npm or yarn
- Git
- Navigate to the project directory:
cd evm-rwa-treasury-tokenization-1/evm-rwa-treasury-tokenization- Install dependencies:
npm install
# or
yarn install- Create a
.envfile (optional, for testnet deployment):
PRIVATE_KEY=your_private_key_here
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/your_key
ETHERSCAN_API_KEY=your_etherscan_api_key- Compile the contracts:
npx hardhat compileRun the complete test suite:
npx hardhat testRun specific test files:
npx hardhat test test/TreasuryToken.test.js
npx hardhat test test/RebasingTreasuryToken.test.jsRun tests with gas reporting:
REPORT_GAS=true npx hardhat testThe test suite covers:
- β Contract deployment and initialization
- β Minting and redemption flows
- β Yield accrual mechanisms
- β Whitelist/blacklist enforcement
- β Transfer restrictions
- β Pausability
- β Upgradeability (UUPS proxy)
- β Role-based access control
- β Edge cases (zero amounts, unauthorized actions, etc.)
- Start a local Hardhat node:
npx hardhat node- In another terminal, deploy to localhost:
npx hardhat run scripts/deploy.js --network localhost-
Ensure your
.envfile is configured with:PRIVATE_KEY: Your wallet private keySEPOLIA_RPC_URL: Sepolia RPC endpointETHERSCAN_API_KEY: Etherscan API key (for verification)
-
Deploy to Sepolia:
npx hardhat run scripts/deploy.js --network sepolia- Verify contracts (optional):
npx hardhat verify --network sepolia <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS>- Telegram: https://t.me/rouncey
- Twitter: https://x.com/rouncey_