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

NameTypeDescription

rewardToken

address

Reward token address

Return Values

NameTypeDescription

[0]

uint256

Number of pools that distribute the specified token as a reward


add

Add a new token pool

function add(address _rewardToken, uint256 _allocPoint, contract IBEP20 _token, uint256 _rewardPerBlock, uint256 _lockPeriod) external

Parameters

NameTypeDescription

_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

function set(address _rewardToken, uint256 _pid, uint256 _allocPoint) external

Parameters

NameTypeDescription

_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

function setRewardAmountPerBlock(address _rewardToken, uint256 _rewardAmount) external

Parameters

NameTypeDescription

_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

function setWithdrawalLockingPeriod(address _rewardToken, uint256 _pid, uint256 _newPeriod) external

Parameters

NameTypeDescription

_rewardToken

address

Reward token address

_pid

uint256

Pool index

_newPeriod

uint256

New lock period


deposit

Deposit XVSVault for XVS allocation

function deposit(address _rewardToken, uint256 _pid, uint256 _amount) external

Parameters

NameTypeDescription

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index

_amount

uint256

The amount to deposit to vault


claim

Claim rewards for pool

function claim(address _account, address _rewardToken, uint256 _pid) external

Parameters

NameTypeDescription

_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

function executeWithdrawal(address _rewardToken, uint256 _pid) external

Parameters

NameTypeDescription

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index


requestWithdrawal

Request withdrawal to XVSVault for XVS allocation

function requestWithdrawal(address _rewardToken, uint256 _pid, uint256 _amount) external

Parameters

NameTypeDescription

_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

function getEligibleWithdrawalAmount(address _rewardToken, uint256 _pid, address _user) external view returns (uint256 withdrawalAmount)

Parameters

NameTypeDescription

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index

_user

address

The User Address

Return Values

NameTypeDescription

withdrawalAmount

uint256

Amount that the user can withdraw


getRequestedAmount

Get requested amount

function getRequestedAmount(address _rewardToken, uint256 _pid, address _user) external view returns (uint256)

Parameters

NameTypeDescription

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index

_user

address

The User Address

Return Values

NameTypeDescription

[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

function getWithdrawalRequests(address _rewardToken, uint256 _pid, address _user) external view returns (struct XVSVaultStorageV1.WithdrawalRequest[])

Parameters

NameTypeDescription

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index

_user

address

The User Address

Return Values

NameTypeDescription

[0]

struct XVSVaultStorageV1.WithdrawalRequest[]

An array of withdrawal requests


pendingReward

View function to see pending XVSs on frontend

function pendingReward(address _rewardToken, uint256 _pid, address _user) external view returns (uint256)

Parameters

NameTypeDescription

_rewardToken

address

Reward token address

_pid

uint256

Pool index

_user

address

User address

Return Values

NameTypeDescription

[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

function updatePool(address _rewardToken, uint256 _pid) external

Parameters

NameTypeDescription

_rewardToken

address

Reward token address

_pid

uint256

Pool index


getUserInfo

Get user info with reward token address and pid

function getUserInfo(address _rewardToken, uint256 _pid, address _user) external view returns (uint256 amount, uint256 rewardDebt, uint256 pendingWithdrawals)

Parameters

NameTypeDescription

_rewardToken

address

Reward token address

_pid

uint256

Pool index

_user

address

User address

Return Values

NameTypeDescription

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

function pendingWithdrawalsBeforeUpgrade(address _rewardToken, uint256 _pid, address _user) public view returns (uint256 beforeUpgradeWithdrawalAmount)

Parameters

NameTypeDescription

_rewardToken

address

The Reward Token Address

_pid

uint256

The Pool Index

_user

address

The address of the user

Return Values

NameTypeDescription

beforeUpgradeWithdrawalAmount

uint256

Total pending withdrawal amount in requests made before the vault upgrade


delegate

Delegate votes from msg.sender to delegatee

function delegate(address delegatee) external

Parameters

NameTypeDescription

delegatee

address

The address to delegate votes to


delegateBySig

Delegates votes from signatory to delegatee

function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external

Parameters

NameTypeDescription

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

function getCurrentVotes(address account) external view returns (uint96)

Parameters

NameTypeDescription

account

address

The address to get votes balance

Return Values

NameTypeDescription

[0]

uint96

The number of current votes for account


getPriorVotes

Determine the xvs stake balance for an account

function getPriorVotes(address account, uint256 blockNumber) external view returns (uint96)

Parameters

NameTypeDescription

account

address

The address of the account to check

blockNumber

uint256

The block number to get the vote balance at

Return Values

NameTypeDescription

[0]

uint96

The balance that user staked


_become

  • Admin Functions **

function _become(contract XVSVaultProxy xvsVaultProxy) external

setAccessControl

Sets the address of the access control of this contract

function setAccessControl(address newAccessControlAddress) external

Parameters

NameTypeDescription

newAccessControlAddress

address

New address for the access control


Last updated