Architecture
Smart Contracts
Smart Contracts
Cairo smart contracts deployed on Starknet.
VaubanDelegationManager
Upgradeable proxy contract that sits between users and Starknet's native delegation pools.
Responsibilities
- Handles ERC20 token transfers from users
- Delegates to Starknet native pools (STRK pool, BTC pool)
- Tracks individual user positions per token
- Implements fee collection (5% on claims, 0% on restaking)
- Epoch-based withdrawal batching (24h collection + 7d unbonding)
Centralized Delegation Model
VaubanManager enters each pool once as a single pool_member, then aggregates user stakes:
User A stakes 100 STRK ─┐
User B stakes 200 STRK ─┤── VaubanManager (single pool_member) ──> STRK Pool
User C stakes 50 STRK ─┘This reduces commission from 10% per user to 10% total, split across all users.
Key Functions
| Function | Description |
|---|---|
enter_pool(token, amount, reward_address) | First-time delegation |
add_to_pool(token, amount) | Add to existing position |
claim_rewards(token) | Claim with 5% fee |
restake(token) | Auto-compound at 0% fee |
request_epoch_withdrawal(token, amount) | Join withdrawal batch |
propose_upgrade(class_hash) | Start 60s timelock upgrade |
execute_upgrade() | Complete upgrade after timelock |
Security Features
- OpenZeppelin: Ownable, ReentrancyGuard, Pausable, Upgradeable
- Anti-flash-loan protection (minimum stake duration)
- Synthetix-pattern reward distribution (V2.8)
- u256 arithmetic for fee calculation (no u128 overflow)
VaubanVault (ERC4626)
Tokenized vault implementing liquid staking tokens (LST).
LST Tokens
| Token | Underlying | Vault |
|---|---|---|
| vaSTRK | STRK | VAUBAN_VAULT |
| vawBTC | wBTC | VAWBTC_VAULT |
| vatBTC | tBTC | VATBTC_VAULT |
| vaLBTC | LBTC | VALBTC_VAULT |
| vasBTC | sBTC | VASBTC_VAULT |
V5.0 Withdrawal Flow
Buffer is disabled. All withdrawals require 7-day unbonding:
request_withdraw(assets)-- Burns shares, starts unbonding- Wait 7 days
complete_withdrawal(request_id)-- Retrieves assets
For instant liquidity, swap LST tokens on Ekubo DEX.
Auto-Compounding
Anyone can call compound() to reinvest vault rewards and earn a 0.1% incentive on compounded amount.
Privacy & Governance Contracts
Three additional contracts implement privacy-preserving payments and sybil-resistant governance:
| Contract | Purpose | Tests |
|---|---|---|
| StealthRegistry | ERC-5564 stealth addresses for private transfers | 20/20 |
| ConfidentialPool | Privacy Pools (Poseidon commitments + nullifiers) | 29/29 |
| DaoGovernance | One-person-one-vote via HumanAttestation SBT | 21/21 |
See Privacy & Governance for full documentation.