Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

StTrendex

ABI

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

NameTypeDescription
_underlyingaddressThe underlying TrendexONE token.
_addressProvideraddressThe address of the AddressProvider.
_timeLockDurationuint64The 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

NameTypeDescription
_assetAmountuint256The amount of assets to deposit.
_proofbytes32[]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

NameTypeDescription
_assetAmountuint256The amount of assets to deposit.
_useraddressThe 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

NameTypeDescription
_unlockingAmountuint256The amount of assets to unlock.

withdraw

Withdraw multiple withdrawal requests.

function withdraw(uint256[] calldata _ids) external nonReentrant;

Parameters

NameTypeDescription
_idsuint256[]The IDs of the withdrawal requests to withdraw.