Core Functions
1. Staking (stake
)
stake
)Users stake USDC and receive STS in return, representing a share of the vault’s USDC balance.
STS minting logic:
If
totalSupply() == 0
, STS is minted at a 1:1 ratio scaled by1e12
to align with USDC decimals (6) vs. STS decimals (18).Otherwise, mint proportionally to existing vault state.
Stake Details:
Tracked via
StakeRecord[]
:stsShares
: Amount of STS minteddurationDays
: Lockup period (0, 90, or 180)lockEndTime
: Timestamp when the stake becomes redeemableactive
: Whether the stake is still claimable
Sanctions Check:
Uses Chainalysis Oracle via
checkSanctions(msg.sender)
If oracle fails or flags the address, the tx is reverted
2. Unstaking (unstake
)
unstake
)Users burn STS to redeem a share of the vault’s USDC
Amount returned is based on the pro-rata share of current vault balance:
Lock period must be expired (
block.timestamp >= lockEndTime
)Stake is marked as inactive and shares zeroed out
3. Non-Transferability
STS is a non-transferable ERC20:
Transfers are blocked unless minting (
from == 0
) or burning (to == 0
)Prevents secondary market speculation and enforces 1:1 mint/burn lifecycle
4. Acquisition Withdrawals (withdrawForAcquisition
)
withdrawForAcquisition
)Admin-only method to withdraw USDC for real estate purchases
This directly impacts vault balance → STS value is diluted
5. Rescuing Mistaken Tokens
Recovers any tokens mistakenly sent to vault (except USDC or STS)
Safeguard against misrouted assets or phishing
6. Oracle Management (setSanctionsOracleAddress
)
setSanctionsOracleAddress
)Updates the sanctions oracle used for address screening
Emits
SanctionsOracleUpdated
7. Pause Mechanism
pause()
andunpause()
let the owner halt operations during threatsUses OpenZeppelin’s
Pausable
modifier
View Functions
getTotalVaultedUSDC()
Returns the current USDC balance of the vault
getCurrentValueOfActiveStakes(user)
Calculates user’s total USDC share based on active STS
getUserStakeRecordsPaginated(user, cursor, limit)
Returns paginated view of user's stake records
getUserStakeCount(user)
Total number of stakes recorded by the user
getStakeRecord(user, index)
Returns the full struct for a given user stake
Last updated