MVP implementation of a collateralized stablecoin (eSUSD) issuance protocol operating on the Sonic chain.
# Copy environment variable files
cp contract/.env.example contract/.env
cp web/.env.example web/.env
# Edit contract/.env
PRIVATE_KEY=your_private_key_here
# Edit web/.env (Get WalletConnect Project ID)
VITE_WALLETCONNECT_PROJECT_ID=your_project_id_herecd contract/
forge build
forge test
forge script script/DeployAndSave.s.sol --rpc-url https://rpc.sonic.test --broadcastcd web/
npm install
npm run devlybra/
├── contract/ # Foundry-based smart contracts
│ ├── src/ # Contract source code
│ ├── test/ # Test files
│ └── script/ # Deployment scripts
├── web/ # React + TypeScript frontend
│ └── src/
│ ├── components/ # UI components
│ ├── store/ # Zustand state management
│ └── contracts/ # Contract configuration
└── docs/ # Project specifications (Japanese)
- VaultManager: Collateral management, minting, burning, liquidations
- CollateralAdapter: S/stS price oracle integration
- Stablecoin: eSUSD ERC20 token
- Wallet Connection: RainbowKit integration
- Collateral Deposit: S/stS token support
- Stablecoin Issuance: eSUSD minting functionality
- Liquidation Features: Liquidation of unhealthy vaults
- Real-time Monitoring: Health Factor display
- MCR (Minimum Collateral Ratio): 150%
- Maximum LTV: 66.67%
- Liquidation Discount: 5%
- Supported Collateral: S tokens, stS tokens
- stS Exchange Rate: ~1.1 S (staking rewards included)
# Contract testing
cd contract/
forge test
# Frontend testing (to be added in future)
cd web/
npm testThe deployment script automatically:
- Deploys Mock price feeds, S tokens and stS tokens
- Deploys CollateralAdapter, Stablecoin, VaultManager
- Sets up connections between contracts
- Mints test tokens to the deployer
- Automatically saves addresses to
.envfile
- MockSToken (S):
0x8ffa6dcd633e3de633bb2d12b528ae82df189f2c - MockStSToken (stS):
0x279ec875d8b0cc18783b2451121b18c8ce9626f6 - CollateralAdapter:
0xc3a9d70a76df1459ac259d460cd6781e86620a45 - Stablecoin (eSUSD):
0xd519048928cfd8d2588e352d0cb7e095b25be6a6 - VaultManager:
0x6136a19a0f2dec456777eef274fba34437b7b689
- Sonic Testnet
- RPC:
https://rpc.testnet.soniclabs.com - Explorer:
https://explorer.sonic.test - Chain ID:
14601 - Faucet: Available through official Sonic Discord
- RPC:
UNLICENSED (for development)