VStaker
Implements staking of LP Tokens and of VRSW tokens
VStaker allows users to stake their LP Tokens and their VRSW tokens, and calculates rewards that accrue to users according to their stakes.
A single VStaker instance can exist per VirtuSwap deployment on a network.
Events
event StakeVrsw
Emitted when someone stakes VRSW
event StakeLp
Emitted when someone stakes an LP token of a VirtuSwap Pool
event RewardsClaimed
Emitted when rewards on a pool are claimed
event UnstakeVrsw
Emitted when someone unstakes VRSW tokens
event UnstakeLp
Emitted when someone unstakes LP tokens
event LockVrsw
Emitted when someone locks VRSW tokens for lockDuration seconds
event LockStakedVrsw
Emitted when someone locks staked VRSW tokens for lockDuration seconds
event UnlockVrsw
Emitted when someone unlocks VRSW tokens
State-Changing Functions
function stakeVrsw
Stakes VRSW tokens into the Staker. The caller receives the same amount of veVRSW tokens.
Emits StakeVrsw event
Parameters:
amount
uint256
Amount to stake
function stakeLp
Stakes LP tokens into the Staker
Emits StakeLp event
Parameters:
lpToken
address
Address of the LP token being staked
amount
uint256
Amount to stake
function unstakeVrsw
Unstakes VRSW tokens from the Staker, burning the same amount of veVRSW. Caller must have staked at least the amount
previously
Parameters:
amount
uint256
Amount to stake
function unstakeLp
Unstakes LP tokens from the staker. Caller must have staked at least the amount
previously
Parameters:
lpToken
address
Address of the LP token being unstaked
amount
uint256
Amount to stake
function lockVrsw
Allows the user to lock VRSW tokens in the contract for a specified duration of time.
Locking Vrsw tokens boosts the protocol rewards for the locker.
Parameters:
amount
uint256
Amount to stake
lockDuration
uint256
lock duration in seconds
function lockStakedVrsw
Allows the user to lock staked VRSW tokens in the contract for a specified duration of time.
Locking staked VRSW tokens boosts the protocol rewards for the locker.
Parameters:
amount
uint256
Amount to stake
lockDuration
uint256
lock duration in seconds
function claimRewards
Allows a user to claim their accrued VRSW rewards. The sender's accrued rewards are calculated according to the Tokenomics formulas. The rewards claimed are transferred to the user's address using the transferRewards function of the vMinter contract.
Read-Only Functions
function checkLock
Checks for any stake positions of a given users that are currently unlocked
Parameters:
who
address
Address of the wallet to check for
function viewRewards
Returns the amount of VRSW rewards that a user has accrued in a given VirtuSwap pool, but not yet claimed
Parameters:
who
address
Address of the wallet to check for
lpToken
address
Address of the LP Token representing the pool
function viewVrswStakes
Returns an array of VrswStake structures containing information about the caller's VRSW stakes
Parameters:
who
address
Address of the wallet to check for
function viewLpStakes
Returns an array of LpStake structures containing information about the caller's LP Token stakes
Parameters:
who
address
Address of the wallet to check for
function isLpTokenValid
Checks if a given address represents a valid VirtuSwap pool LP token.
Last updated