🔧Technical documentation
Technical documentation for TenderTokens
tToken Implementation
Overview
tTokens are elastic supply ERC-20 tokens that represent staked positions with specific validators. They implement both standard ERC-20 functionality and EIP-2612 for permits, with additional features for handling staking rewards and slashing events.
Core Functions
Staking
Purpose: Deposits assets and mints tTokens.
Returns: Amount of tTokens minted.
Additional Details: Triggers a rebase before the operation.
Unstaking
Purpose: Initiates the unstaking process.
Details:
Burns tTokens.
Creates an unlock position.
Returns: Unique unlock identifier.
Withdraw
Purpose: Completes the unstaking process.
Details:
Transfers underlying assets to the specified receiver.
Requires the unlock position to mature.
Conversion Functions
Purpose: Handle conversion between shares (tTokens) and assets (underlying tokens).
Details: Accounts for changes in the elastic supply.
Integration Guide For DeFi Protocols
Token Implementation
Implements the standard ERC-20 interface.
Includes an additional rebase mechanism.
Use
convertToAssets()
for accurate balance calculations.
Handling Rebases
Rebases occur automatically before token transfers.
External calls should account for supply changes.
Monitor
Rebase
events for updates to supply.
Safety Considerations
Always check return values for all operations.
Account for potential slashing events that may affect balances.
Handle failed operations gracefully to ensure robust integrations.
Last updated