VxPremia

Git Source

Inherits: IVxPremia, PremiaStaking

Author: Premia

State Variables

PROXY_MANAGER_V2

The proxy manager contract used to deploy PremiaV2 pools

address private immutable PROXY_MANAGER_V2;

VAULT_REGISTRY

The vault registry contract for PremiaV3 vaults

address private immutable VAULT_REGISTRY;

Functions

constructor

constructor(
    address proxyManager,
    address lzEndpoint,
    address premia,
    address rewardToken,
    address exchangeHelper,
    address vaultRegistry
) PremiaStaking(lzEndpoint, premia, rewardToken, exchangeHelper);

_beforeUnstake

function _beforeUnstake(address user, uint256 amount) internal override;

_subtractExtraUserVotes

subtract user votes, starting from the end of the list, if not enough voting power is left after amountUnstaked is unstaked

function _subtractExtraUserVotes(VxPremiaStorage.Layout storage l, address user, uint256 amountUnstaked) internal;

_subtractUserVotes

subtract user votes, starting from the end of the list

function _subtractUserVotes(VxPremiaStorage.Layout storage l, address user, uint256 amount) internal;

_calculateUserVotingPowerUsed

function _calculateUserVotingPowerUsed(address user) internal view returns (uint256 votingPowerUsed);

getPoolVotes

get total votes for specific pools

function getPoolVotes(VoteVersion version, bytes calldata target) external view returns (uint256);

Parameters

NameTypeDescription
versionVoteVersionversion of target (used to know how to decode data)
targetbytesABI encoded target of the votes

Returns

NameTypeDescription
<none>uint256total votes for specific pool

getUserVotes

get votes of user

function getUserVotes(address user) external view returns (VxPremiaStorage.Vote[] memory);

Parameters

NameTypeDescription
useraddressuser from which to get votes

Returns

NameTypeDescription
<none>VxPremiaStorage.Vote[]votes of user

castVotes

add or remove votes, in the limit of the user voting power

function castVotes(VxPremiaStorage.Vote[] calldata votes) external nonReentrant;

Parameters

NameTypeDescription
votesVxPremiaStorage.Vote[]votes to cast

_resetUserVotes

function _resetUserVotes(VxPremiaStorage.Layout storage l, VxPremiaStorage.Vote[] storage userVotes, address user)
    internal;

resetUserVotes

function resetUserVotes(address user) external onlyOwner;