Subvault Technical Docs

Contract Overview

Contract Name: Subvault Symbol: STS Token Type: ERC20 (non-transferable) Primary Asset: USDC (ERC20-compatible stablecoin) Stake Token: STS (Subvault Token Share) Security Modules: Pausable, ReentrancyGuard, Ownable, Chainalysis Oracle

πŸ—ƒ Data Structures

solidityCopyEditstruct StakeRecord {
    uint256 stsShares;      // Amount of STS minted during stake
    uint256 durationDays;   // Lock period (0, 90, 180)
    uint256 lockEndTime;    // Epoch time after which stake can be redeemed
    bool active;            // Active status
}

User stakes are stored in:

solidityCopyEditmapping(address => StakeRecord[]) public userStakeRecords;

🧠 Business Logic Flow

Staking

  1. User approves and calls stake(amount, duration)

  2. STS minted and stake recorded

  3. USDC transferred in

Unstaking

  1. Lock expires β†’ user calls unstake(index)

  2. STS burned β†’ USDC redeemed

Acquisition

  1. Admin calls withdrawForAcquisition(to, amount)

  2. Vault USDC decreases β†’ STS dilution occurs

πŸ“¦ Deployment Details

  • Compiler: Solidity 0.8.17 (locked)

  • Libraries: OpenZeppelin ERC20, SafeERC20, Pausable, ReentrancyGuard, Ownable

  • Decimals: STS follows 18 decimals; USDC assumed to use 6

  • Chainalysis Oracle: Must be deployed and compatible with SanctionsList interface

Last updated