Casper Liquid Staking
Автор: Hatim
Загружено: 2025-12-19
Просмотров: 19
Описание:
Liquid Staking DApp on Casper Network
Overview
This project is a *Liquid Staking Decentralized Application (DApp)* built on the *Casper Network**. It allows users to stake their **CSPR* tokens and receive *lCSPR* (Liquid Staking Token) in return.
Unlike traditional staking where assets are locked, *lCSPR* is a liquid ERC20-like token that represents your stake plus accrued rewards. The exchange rate between CSPR and lCSPR increases over time as staking rewards accumulate, allowing users to unstake more CSPR than they deposited.
Features
**🪙 Liquid Staking**: Stake CSPR and mint lCSPR instantly
**📈 Auto-Compounding Rewards**: The value of lCSPR appreciates against CSPR
**🔓 Flexible Unstaking**: Unstake lCSPR to burn tokens and initiate a withdrawal request
**⏳ Withdraw Mechanism**: Claim your unstaked CSPR after the cooldown period (simulated for dev/testnet)
**🔄 Real-Time UI**: Data automatically refreshes after transactions
**🛡️ Secure Architecture**: Built with Rust (Odra Framework) and Casper best practices
Tech Stack
**Frontend**: React, Vite, Casper JS SDK
**Smart Contracts**: Rust, Odra Framework
**Blockchain**: Casper Testnet (Condor/Delta)
**Wallet**: Casper Wallet
Prerequisites
Node.js (v16+)
Casper Wallet browser extension
Rust toolchain (only required if building contracts from source)
Installation & Setup
1. Clone the Repository
```bash
git clone github.com/hatim85/Casper_liquid_staking
cd casper-liquid-staking
```
2. Frontend Setup
Navigate to the frontend directory:
```bash
cd frontend
```
Install dependencies:
```bash
npm install
```
Start the development server:
```bash
npm run dev
```
The application will be available at:
```
http://localhost:5173
```
3. Smart Contract (Optional)
If you want to deploy your own version of the contract:
```bash
cd liquid_staking
cargo odra build -b casper -t testnet
```
Deploy using Odra deployment commands or `casper-client`.
How to Use
1. Connect Wallet
Click the *Connect Wallet* button in the top-right corner
Approve the connection in Casper Wallet
2. Stake
Enter the amount of *CSPR* you want to stake
Click *Stake*
Sign the transaction in your wallet
After confirmation, your *lCSPR balance* will update
3. Unstake
Navigate to the *Unstake* section
Enter the amount of *lCSPR* to burn
Click *Unstake*
Sign the transaction
This initiates the cooldown period
4. Withdraw
Once the unstake transaction is confirmed, the *Withdraw* section will display your pending amount
Wait for the unlock time (if applicable)
Click *Withdraw* to claim your original CSPR plus rewards
Project Structure
```
├── frontend/ # React Application
│ ├── src/ # Components (LiquidStaking.jsx, Connect.jsx)
│ └── public/ # Static assets
└── liquid_staking/ # Rust Smart Contracts (Odra)
├── src/ # Contract logic
└── tests/ # Unit tests
```
Hackathon Context
Prepared specifically for the **Casper Hackathon 2026**.
**Track**: Liquid Staking / DeFi
**Goal**: Demonstrate a functional and user-friendly liquid staking solution on Casper
License
MIT
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: