This project is a Collateralized Stablecoin Decentralized Application (dApp) built on the blazing-fast Solana blockchain! π It allows users to:
- π Deposit SOL as collateral.
- mint π° USDS stablecoins against their collateral.
- π Redeem SOL by burning USDS.
- π₯ Participate in liquidation of undercollateralized positions (if you dare!).
- π Monitor their risk level in real-time! ππ
It's a simplified example to demonstrate the power of programmable money and decentralized finance (DeFi). Think of it as a mini-MakerDAO, but on Solana! π
This beautiful UI, built with Next.js and Tailwind CSS, lets you interact with the smart contract and manage your stablecoin positions. π¨ Connect your wallet and start experimenting! π
This project is powered by a robust Anchor program (smart contract) written in Rust. Let's get it running locally!
cd program
anchor buildThis command will compile your Rust code and prepare the program for deployment. β¨ Watch the magic happen! β¨
solana-test-validatorFire up the Solana Test Validator! This creates a local blockchain environment perfect for development and testing. π§ͺ Keep this running in a separate terminal window.
anchor deploy --provider.cluster localnetDeploy your compiled program to your local Solana validator! π This makes your smart contract live and ready to interact with on your local network. π‘
Important: After deployment, make sure to:
* β
Update idl.json in frontend/anchor/: Copy the new idl.json from program/target/idl/ to frontend/anchor/ to ensure your frontend knows about the latest contract.
* π Restart Frontend: Restart your frontend (npm run dev in frontend directory) to pick up the updated idl.json.
anchor testRun the automated tests! π§ͺ These tests in program/tests/stablecoin.ts verify the core functionality of your smart contract. Make sure all tests pass! π
Enjoy exploring the world of programmable money with this Collateralized Stablecoin dApp! π Remember, this is just the beginning β the possibilities are endless! π