StTrendex
Inherits: TimeLockPenaltyERC20
stTrendex is a staking contract that allows users to deposit TrendexONE assets.
State Variables
NAME
string constant NAME = "Stake TrendexONE";
SYMBOL
string constant SYMBOL = "stTrendex";
Functions
constructor
Deploy the stMeta contract.
constructor(address _underlying, address _addressProvider, uint64 _timeLockDuration)
TimeLockPenaltyERC20(NAME, SYMBOL, _underlying, _addressProvider, _timeLockDuration);
Parameters
| Name | Type | Description |
|---|---|---|
_underlying | address | The underlying TrendexONE token. |
_addressProvider | address | The address of the AddressProvider. |
_timeLockDuration | uint64 | The time lock duration. |
deposit
Deposit assets into the contract and mint the equivalent amount of tokens.
function deposit(uint256 _assetAmount, bytes32[] calldata _proof)
external
whenNotPaused
nonReentrant
onlyWhitelistedIfSetup(_proof);
Parameters
| Name | Type | Description |
|---|---|---|
_assetAmount | uint256 | The amount of assets to deposit. |
_proof | bytes32[] | The proof of the whitelisted address. |
depositFor
Deposit assets into the contract and mint the equivalent amount of tokens.
function depositFor(uint256 _assetAmount, address _user)
external
whenNotPaused
nonReentrant
onlyAllowlistedDepositors(msg.sender);
Parameters
| Name | Type | Description |
|---|---|---|
_assetAmount | uint256 | The amount of assets to deposit. |
_user | address | The user to deposit for. |
emergencyWithdraw
Allow users to emergency withdraw assets without penalties.
This function can only be called when the contract is paused.
function emergencyWithdraw(uint256 _unlockingAmount) external whenPaused nonReentrant;
Parameters
| Name | Type | Description |
|---|---|---|
_unlockingAmount | uint256 | The amount of assets to unlock. |
withdraw
Withdraw multiple withdrawal requests.
function withdraw(uint256[] calldata _ids) external nonReentrant;
Parameters
| Name | Type | Description |
|---|---|---|
_ids | uint256[] | The IDs of the withdrawal requests to withdraw. |