XVSVault
XVS Vault
The XVS Vault allows XVS holders to lock their XVS to recieve voting rights in Venus governance and are rewarded with XVS.
Solidity API
pause
Pauses vault
resume
Resume vault
poolLength
Returns the number of pools with the specified reward token
Parameters
rewardToken
address
Reward token address
Return Values
[0]
uint256
Number of pools that distribute the specified token as a reward
add
Add a new token pool
Parameters
_rewardToken
address
Reward token address
_allocPoint
uint256
Number of allocation points assigned to this pool
_token
contract IBEP20
Staked token
_rewardPerBlock
uint256
Initial reward per block, in terms of _rewardToken
_lockPeriod
uint256
A period between withdrawal request and a moment when it's executable
set
Update the given pool's reward allocation point
Parameters
_rewardToken
address
Reward token address
_pid
uint256
Pool index
_allocPoint
uint256
Number of allocation points assigned to this pool
setRewardAmountPerBlock
Update the given reward token's amount per block
Parameters
_rewardToken
address
Reward token address
_rewardAmount
uint256
Number of allocation points assigned to this pool
setWithdrawalLockingPeriod
Update the lock period after which a requested withdrawal can be executed
Parameters
_rewardToken
address
Reward token address
_pid
uint256
Pool index
_newPeriod
uint256
New lock period
deposit
Deposit XVSVault for XVS allocation
Parameters
_rewardToken
address
The Reward Token Address
_pid
uint256
The Pool Index
_amount
uint256
The amount to deposit to vault
claim
Claim rewards for pool
Parameters
_account
address
The account for which to claim rewards
_rewardToken
address
The Reward Token Address
_pid
uint256
The Pool Index
executeWithdrawal
Execute withdrawal to XVSVault for XVS allocation
Parameters
_rewardToken
address
The Reward Token Address
_pid
uint256
The Pool Index
requestWithdrawal
Request withdrawal to XVSVault for XVS allocation
Parameters
_rewardToken
address
The Reward Token Address
_pid
uint256
The Pool Index
_amount
uint256
The amount to withdraw from the vault
getEligibleWithdrawalAmount
Get unlocked withdrawal amount
Parameters
_rewardToken
address
The Reward Token Address
_pid
uint256
The Pool Index
_user
address
The User Address
Return Values
withdrawalAmount
uint256
Amount that the user can withdraw
getRequestedAmount
Get requested amount
Parameters
_rewardToken
address
The Reward Token Address
_pid
uint256
The Pool Index
_user
address
The User Address
Return Values
[0]
uint256
Total amount of requested but not yet executed withdrawals (including both executable and locked ones)
getWithdrawalRequests
Returns the array of withdrawal requests that have not been executed yet
Parameters
_rewardToken
address
The Reward Token Address
_pid
uint256
The Pool Index
_user
address
The User Address
Return Values
[0]
struct XVSVaultStorageV1.WithdrawalRequest[]
An array of withdrawal requests
pendingReward
View function to see pending XVSs on frontend
Parameters
_rewardToken
address
Reward token address
_pid
uint256
Pool index
_user
address
User address
Return Values
[0]
uint256
Reward the user is eligible for in this pool, in terms of _rewardToken
updatePool
Update reward variables of the given pool to be up-to-date
Parameters
_rewardToken
address
Reward token address
_pid
uint256
Pool index
getUserInfo
Get user info with reward token address and pid
Parameters
_rewardToken
address
Reward token address
_pid
uint256
Pool index
_user
address
User address
Return Values
amount
uint256
Deposited amount
rewardDebt
uint256
Reward debt (technical value used to track past payouts)
pendingWithdrawals
uint256
Requested but not yet executed withdrawals
pendingWithdrawalsBeforeUpgrade
Gets the total pending withdrawal amount of a user before upgrade
Parameters
_rewardToken
address
The Reward Token Address
_pid
uint256
The Pool Index
_user
address
The address of the user
Return Values
beforeUpgradeWithdrawalAmount
uint256
Total pending withdrawal amount in requests made before the vault upgrade
delegate
Delegate votes from msg.sender
to delegatee
Parameters
delegatee
address
The address to delegate votes to
delegateBySig
Delegates votes from signatory to delegatee
Parameters
delegatee
address
The address to delegate votes to
nonce
uint256
The contract state required to match the signature
expiry
uint256
The time at which to expire the signature
v
uint8
The recovery byte of the signature
r
bytes32
Half of the ECDSA signature pair
s
bytes32
Half of the ECDSA signature pair
getCurrentVotes
Gets the current votes balance for account
Parameters
account
address
The address to get votes balance
Return Values
[0]
uint96
The number of current votes for account
getPriorVotes
Determine the xvs stake balance for an account
Parameters
account
address
The address of the account to check
blockNumber
uint256
The block number to get the vote balance at
Return Values
[0]
uint96
The balance that user staked
_become
Admin Functions **
setAccessControl
Sets the address of the access control of this contract
Parameters
newAccessControlAddress
address
New address for the access control
Last updated