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

function pause() external

resume

Resume vault

function resume() external

poolLength

Returns the number of pools with the specified reward token

function poolLength(address rewardToken) external view returns (uint256)

Parameters

Name
Type
Description

rewardToken

address

Reward token address

Return Values

Name
Type
Description

[0]

uint256

Number of pools that distribute the specified token as a reward


add

Add a new token pool

Parameters

Name
Type
Description

_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

Name
Type
Description

_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

Name
Type
Description

_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

Name
Type
Description

_rewardToken

address

Reward token address

_pid

uint256

Pool index

_newPeriod

uint256

New lock period


deposit

Deposit XVSVault for XVS allocation

Parameters

Name
Type
Description

_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

Name
Type
Description

_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

Name
Type
Description

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index


requestWithdrawal

Request withdrawal to XVSVault for XVS allocation

Parameters

Name
Type
Description

_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

Name
Type
Description

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index

_user

address

The User Address

Return Values

Name
Type
Description

withdrawalAmount

uint256

Amount that the user can withdraw


getRequestedAmount

Get requested amount

Parameters

Name
Type
Description

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index

_user

address

The User Address

Return Values

Name
Type
Description

[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

Name
Type
Description

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index

_user

address

The User Address

Return Values

Name
Type
Description

[0]

struct XVSVaultStorageV1.WithdrawalRequest[]

An array of withdrawal requests


pendingReward

View function to see pending XVSs on frontend

Parameters

Name
Type
Description

_rewardToken

address

Reward token address

_pid

uint256

Pool index

_user

address

User address

Return Values

Name
Type
Description

[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

Name
Type
Description

_rewardToken

address

Reward token address

_pid

uint256

Pool index


getUserInfo

Get user info with reward token address and pid

Parameters

Name
Type
Description

_rewardToken

address

Reward token address

_pid

uint256

Pool index

_user

address

User address

Return Values

Name
Type
Description

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

Name
Type
Description

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index

_user

address

The address of the user

Return Values

Name
Type
Description

beforeUpgradeWithdrawalAmount

uint256

Total pending withdrawal amount in requests made before the vault upgrade


delegate

Delegate votes from msg.sender to delegatee

Parameters

Name
Type
Description

delegatee

address

The address to delegate votes to


delegateBySig

Delegates votes from signatory to delegatee

Parameters

Name
Type
Description

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

Name
Type
Description

account

address

The address to get votes balance

Return Values

Name
Type
Description

[0]

uint96

The number of current votes for account


getPriorVotes

Determine the xvs stake balance for an account

Parameters

Name
Type
Description

account

address

The address of the account to check

blockNumber

uint256

The block number to get the vote balance at

Return Values

Name
Type
Description

[0]

uint96

The balance that user staked


_become

  • Admin Functions **


setAccessControl

Sets the address of the access control of this contract

Parameters

Name
Type
Description

newAccessControlAddress

address

New address for the access control


Last updated