Staked TRX
Introduction
Based on Stake 2.0, with TRX Liquid Staking, users can stake TRX to get sTRX tokens and gain high rewards. Compared to traditional staking, TRX Liquid Staking is easier to use and more profitable. Staked TRX will be used automatically for voting and governance, and gain rewards via Energy Rental. The contract StakedTRX used to set up the staked TRX service.
Solidity API
Query Interface
Exchange rate
Query the exchange rate between sTRX and TRX.
Parameter description: None
Returns: Exchange rate, 1 sTRX / 1 TRX exchange rate, scaled by 1e18.
Total TRX assets
Query the total TRX assets managed by contract.
Parameter description: None
Returns: The total assets of TRX managed by contract, the minimum unit.
User balance in TRX
Query the amount of TRX corresponding to the sTRX held by user
Parameter description:
Parameter | Type | Description |
---|---|---|
_account | address | User address |
Returns: The amount of TRX corresponding to the sTRX held by user, the minimum unit.
Write Interface
Deposit TRX
Deposit TRX assets and receive sTRX.
Parameter description:
Parameter | Type | Description |
---|---|---|
msg.value | The amount of TRX to deposit |
Returns: The amount of sTRX received by user through exchange, the minimum unit.
Withdraw sTRX
specify the amount of sTRX to withdraw, the minimum unit.
Parameter description:
Parameter | Type | Description |
---|---|---|
tokenAmount | uint256 | The amount of sTRX to withdraw |
Returns: The amount of TRX to be unfrozen when user withdraws, the minimum unit.
Withdraw sTRX (with the amount of TRX specified)
specify the amount of TRX user hopes to obtain through withdrawal, the minimum unit.
Parameter description:
Parameter | Type | Description |
---|---|---|
tokenAmount | uint256 | The amount of sTRX to withdraw |
Returns: The amount of sTRX withdrawn by user, the minimum unit.
Claim TRX
Claim the ready-to-be-withdrawn TRX unfrozen in the earliest round.
Parameter description: None
Returns: The amount of TRX claimed by user in the earliest unfreezing round, the minimum unit.
Claim all unfrozen TRX
Claim all ready-to-be-withdrawn, unfrozen TRX
Parameter description: None
Returns: The amount of TRX claimed by the user for all expired unfreezing rounds, the minimum unit.
Key Events
Event | Description |
---|---|
| Emits when user successfully deposits TRX
|
| Emits when user successfully withdraws sTRX
|
| Emits when user successfully claims TRX
|
Last updated