sthUSD Implementation
What Problem Does sthUSD Solve?
Contract Overview
Property
Value
How sthUSD Works: Core Concepts
The Share-Based Model
Asset Definitions
asset() - thUSD (The Underlying Token)
asset() - thUSD (The Underlying Token)shares - sthUSD (The Vault Token)
shares - sthUSD (The Vault Token)State Variables Explained
Accounting Model: How Value Accrues
The Core Challenge: Preventing Manipulation
Total Assets Calculation
Yield Vesting: Preventing Yield Theft
Asset Flow Tracking
Yield Vesting Mechanism
Cooldown System
Cooldown States
Cooldown Period
Behavior
Use Case
Cooldown Implementation
Silo Contract
Fee Structure
Fee Configuration
Current Fee Parameters
Fee Type
Current Rate
Maximum
Applied When
Access Control & Security
Role-Based Permissions
Role
Permissions
Purpose
Security Features
Gas Optimization
Efficient Storage Layout
Gas-Efficient Operations
Operation
Gas Cost
Optimization
Testing & Validation
Comprehensive Test Suite
Invariant Testing
Integration Examples
Basic Integration
Advanced Integration with Cooldown
Last updated
