This project contains the implementation of SolvBTC smart contracts on the Stellar Soroban platform.
fungible-token/: Fungible token contractoracle/: Price oracle contractvault/: Vault contracttests/: Integration tests
- Rust 1.74.0 or higher
- Soroban CLI
- wasm32-unknown-unknown target
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default stable
rustup target add wasm32-unknown-unknown
# Install Soroban CLI
cargo install --locked soroban-climake buildmake testmake integration-testmake checkmake fixmake generate-jsThe project is organized as a Cargo workspace with the following components:
- fungible-token: Implementation of a fungible token contract compatible with Stellar standards
- vault: Main vault contract for managing deposits and withdrawals
- oracle: NAV (Net Asset Value) oracle contract for price feeds
- integration-tests: End-to-end integration tests for the contracts
- key-test: Testing utilities for cryptographic operations
- Rust and Cargo (latest stable version)
- Soroban CLI with
optfeature - Wasm target:
rustup target add wasm32-unknown-unknown
To build all contracts:
make buildThis will:
- Compile all contracts
- Generate WASM files for each contract
- Optimize the WASM files using Soroban's optimizer
- Output the optimized WASM files to
target/wasm32-unknown-unknown/optimized/
To run all tests:
make testThis will run both unit tests and integration tests for all contracts.
make fmt: Format the code using rustfmtmake clean: Clean build artifactsmake generate-js: Generate TypeScript bindings for the contracts
A standard-compliant fungible token with additional features:
- Minting and burning capabilities
- Blacklist functionality
- Pausable transfers
- Admin controls
The main vault contract that:
- Manages deposits of assets
- Processes withdrawals with cryptographic verification
- Interacts with the oracle for NAV updates
Provides NAV (Net Asset Value) data:
- Managed by authorized administrators
- Enforces limits on NAV changes
- Supports configurable precision