Getters of TokensFarm Contract
Get info from relevant contract public fields
The staked ERC-20 token's address
Total amount of tokens deposited to a farm
Total amount of tokens that were paid out as rewards
The current total rewards amount
The amount of tokens rewarded per second
The farm's start and end times
The early withdrawal penalty
The fee rates in percentages %
The number of farm participants
The addresses of all farm participants and mapping
of users to get the index
mapping
of users to get the index
Getters
Get the Address of a Staked Token
Get the Amount of Deposited ERC-20 Tokens via stakeId
stakeId
user
address
The user
address whose data you fetch
stakeId
uint256
The stakeId
of the particular stake
returns:
stake.amount
uint256
The resulting number will be the ERC-20 amount that was deposited in the requested stake.
Get pending reward amount
user
address
The user
address whose data you fetch
stakeId
uint256
The stakeId
of the particular stake
returns:
rewardAmount
uint256
The amount of pending ERC-20 rewards
How many time a user staked
To get the number of user stakes from a TokensFarm contract, you must call getNumberOfUserStakes
on the TokensFarm
smart contract.
user
address
The user
address whose data you fetch
returns:
stakeInfo[user].length
uint256
The resulting number will represent how many times the user has staked.
Get deposit timestamp
user
address
The user
address whose data you fetch
stakeId
uint256
The stakeId
of the particular stake
returns:
timestamp
uint256
The timestamp of the deposit
Get withdraw timestamp
user
address
The user
address whose data you fetch
stakeId
uint256
The stakeId
of the particular stake
returns:
timestamp
uint256
The timestamp of the withdraw
Last updated