A comprehensive smart contract framework and decentralized application (dApp) designed to tokenize traditional financial instruments—such as equities, bonds, futures, and options—along with real-world assets like land, on the Ethereum blockchain.
This project provides a robust, compliant, and upgradeable infrastructure for asset tokenization. It leverages the UUPS (Universal Upgradeable Proxy Standard) pattern to allow for future logic updates while maintaining a consistent contract address.
- Equities (ERC-20): Represent corporate shares with built-in dividend distribution logic.
- Bonds (ERC-20): Represent debt instruments with automated coupon payments and maturity redemption.
- Derivatives (ERC-1155): Handle semi-fungible contracts for futures and options, integrating with Chainlink oracles for settlement.
- Land (ERC-1155): Enable fractional ownership of real estate properties.
- TokenFactory: A central registry and deployment hub for all asset tokens.
- Compliance Layer: Integrated whitelisting and access control (Role-Based Access Control) to meet regulatory requirements.
- Upgradeability: All asset tokens are deployed as proxies, allowing for bug fixes and feature enhancements without losing state.
- Security: Implements OpenZeppelin's industry-standard libraries for secure token logic and proxy management.
- Smart Contracts: Solidity 0.8.24, Hardhat, OpenZeppelin (Upgradeable/UUPS), Chainlink.
- Frontend: React, Vite, TypeScript, Ethers.js (v6).
- Network: Ethereum Sepolia (testnet) and local Hardhat network.
-
Clone the repository:
git clone https://github.com/diepdaocs/tokenized-assets.git cd tokenized-assets -
Install root dependencies (Hardhat):
npm install
-
Install frontend dependencies:
cd frontend npm install cd ..
-
Environment Setup: Create a
.envfile in the root directory based on.env.example:SEPOLIA_RPC_URL=your_rpc_url PRIVATE_KEY=your_private_key ETHERSCAN_API_KEY=your_etherscan_api_key
-
Compile Contracts:
npx hardhat compile
-
Run Tests:
npx hardhat test -
Local Deployment:
- Start a local Hardhat node:
npx hardhat node
- Deploy to the local network:
npx hardhat run scripts/deploy.js --network localhost
- Start a local Hardhat node:
-
Sepolia Deployment:
npx hardhat run scripts/deploy.js --network sepolia
-
Configure Factory Address: After deploying, copy the
TokenFactoryaddress and update theFACTORY_ADDRESSconstant infrontend/src/App.tsx. -
Start Development Server:
cd frontend npm run dev -
Open
http://localhost:5173in your browser.
├── contracts/ # Solidity smart contracts
│ ├── AssetBase.sol # Base compliance & upgradeable logic
│ ├── EquityToken.sol # ERC-20 Equity implementation
│ ├── BondToken.sol # ERC-20 Bond implementation
│ ├── ... # Other asset types
│ └── TokenFactory.sol # Factory for deploying proxies
├── scripts/ # Deployment and interaction scripts
├── test/ # Comprehensive unit tests
├── frontend/ # React + Vite application
│ ├── src/ # Application source code
│ └── ...
└── hardhat.config.js # Hardhat configuration
- Whitelisting: Transfers are restricted to whitelisted addresses by default.
- Access Control: Critical functions (minting, pausing, upgrading) are protected by roles (
DEFAULT_ADMIN_ROLE,ISSUER_ROLE). - Oracles: Derivatives rely on Chainlink for decentralized price feeds to prevent manipulation.
Distributed under the MIT License. See LICENSE for more information.