TokenFarm
This is the contract for staking and vesting.
Owner Function
This is an owner function to create new pool Info for multi-rewarders. for specific pool, we can set cooldownduration, so before passing cooldown duration, nobody can withdraw their staked token.
tokenFarm.
add(
IBoringERC20 _lpToken,
IComplexRewarder[] calldata _rewarders,
bool _enableCooldown
)
Example Input
(
'0x020F88c59222241378B23325fdCFEc4ea3fF5199',
[
'0x1fd018999420dAb0f98032e8831C0A735f55EDd0',
'0x22B1E7E25ce22251DAf656B7c85b0fcc16d8aF8D'
],
true
) // we give vela and eVela as rewards for VLP stakers. we enable cooldownDuration.
Example Output
Function
This is a function for deposting stake token.
tokenFarm.deposit(uint256 _pid, uint256 _amount)
Example Input
('0', 10000000000000000000) // stake 10 VLP
Example Output
Owner Function
This is an owner function for update cooldown duration.
tokenFarm.updateCooldownDuration(
uint256 _newCooldownDuration
)
Example Input
0 // no cooldown duration
Example Output
Function
This is a function for withdraw with reward token.
tokenFarm.withdraw(
uint256 _pid,
uint256 _amount
)
Example Input
('0', 10000000000000000000) // unstake 10 VLP
Example Output
Function
This is a function for withdraw full amount of staked token without reward token.
tokenFarm.emergencyWithdraw(uint256 _pid)
Example Input
('0') //
Example Output
Function
This is a function to get pending multi reward tokens amount of the pool.
tokenFarm.pendingTokens(
uint256 _pid,
address _user
)
Example Input
('0', '0x93F2394ceA60fa9E2E9AC215cd8ba04c30ed103b') // pId = 0
Example Output
{
addresses: [ '0x0aD6371dd7E9923d9968D63Eb8B9858c700abD9d' ],
symbols: [ 'esVELA' ],
decimals: [ 18 ],
amounts: [ '125600000000000000000' ]
}
Function
This is a function to get the length of pool.
tokenFarm.poolLength()
Example Input
Example Output
3
Function
This is a function to get reward tokens address of the pool.
tokenFarm.poolRewarders(
uint256 _pid
)
Example Input
('0') // pId = 0
Example Output
[ '0x0aD6371dd7E9923d9968D63Eb8B9858c700abD9d' ]
Function
This is a function to get rewards per second of the pool.
tokenFarm.poolRewardsPerSec(
uint256 _pid
)
Example Input
('0') // pId = 0
Example Output
{
addresses: [ '0x0aD6371dd7E9923d9968D63Eb8B9858c700abD9d' ],
symbols: [ 'esVELA' ],
decimals: [ 18 ],
rewardsPerSec: [ '10000000000000000' ]
}
Function
This is a function to get total LP of the pool.
tokenFarm.poolTotalLp(uint256 pid)
Example Input
('0') // pId = 0
Example Output
'15643200000000000000000'
Function
This is a function for deposting vest token
tokenFarm.depositVesting(uint256 _amount)
Example Input
(10000000000000000000) // stake 10 eVELA
Example Output
Owner Function
This is an owner function to update vesting duration
tokenFarm.updateVestingDuration(
uint256 _vestingDuration
)
Example Input
60 * 60 * 24* 365 // set 365 days for vesting duration
Example Output
Function
This is a function to get claimable token amount from vesting
tokenFarm.claimable(address _account)
Example Input
('0x0aD6371dd7E9923d9968D63Eb8B9858c700abD9d')
Example Output
'15643200000000000000000'
Function
This is a function to get vested token amount
tokenFarm.getVestedAmount(address _account)
Example Input
('0x0aD6371dd7E9923d9968D63Eb8B9858c700abD9d')
Example Output
'15643200000000000000000'
Owner Function
This is an owner function to withdraw token from vesting.
tokenFarm.withdrawVesting()
Example Input
Example Output
Last modified 4mo ago