IAutoStakingV3

Parameter Structs
Functions

Parameter Structs

UserInfo

struct UserInfo {
        uint256 shares; 
        uint256 lastDepositedTime; 
        uint256 tokensAtLastUserAction; 
        uint256 lastUserActionTime; 
        uint256[] rewardPending;
        uint256[] rewardDebt;
    }

Structure that contains info about the user`s deposit and reward in auto staking.

Fields description

Status

struct Status {
        address token;
        uint256 rewardPerBlock;
        uint256 tokensWithCompounding;
        uint256 tokensAtLastUserAction;
        uint256 performanceFee;
        uint256 callFee;
        uint256 withdrawFee;
        uint256 withdrawFeePeriod;
        uint256 rewardPerClaim;
        uint256 userTimeFeeEnd;
        uint256 accDeposited;
    }

Structure that contains auto staking`s status for specified user.

Fields description

Functions

getRewardPerClaim

function getRewardPerClaim(uint256 _timestamp) external view returns (uint256)

Returns reward per claim at the time _timestamp.

getStatus

function getStatus(address _user, uint256 _timestamp) external view returns (Status memory)

Returns auto staking status for _user at the time _timestamp.

getUserInfo

function getUserInfo(address _user) external view returns (UserInfo memory)

Returns _user`s auto staking info.

unstakeAvailable

function unstakeAvailable(address _user, uint256 _timestamp) external view returns (uint256)

Returns summarized amounts of _user`s deposited and available to claim compounded tokens at the time _timestamp.

totalAssets

function totalAssets(address _user, uint256 _timestamp) external view returns (uint256)

Returns summarized amounts of _user`s deposited, available to claim compounded tokens, and locked compounded tokens at the time _timestamp.

earnedSinceLastAction

function earnedSinceLastAction(address _user, uint256 _timestamp) external view returns (uint256)

Returns the amount of tokens that the user earned since the last deposit/withdrawal operation.

deposit

function deposit(uint256 _amount) external

Deposits tokens from msg.sender to auto staking.

withdrawAll

function withdrawAll() external

Withdraws all the msg.sender`s deposited and available to claim compounded tokens. Locked compounded tokens are distributed among all the left users.

claim

function claim() external

Compounds all the auto staking rewards and sends back the claim reward to msg.sender.

getPricePerFullShare

function getPricePerFullShare(uint256 _timestamp) external view returns (uint256)

Returns the amount of all the autostaking tokens per share at the time _timestamp.

withdraw

function withdraw(uint256 _amount) external

Withdraws msg.sender`s tokens and sends them back to him.

Last updated