Skip to main content

IVeToken

Functions

balanceOf

function balanceOf(
address
) external returns (uint256)

Parameters

NameTypeDescription
``address

locked

function locked(
address
) external returns (uint256)

Parameters

NameTypeDescription
``address

create_lock

function create_lock(
uint256 value,
uint256 unlock_time
) external

Parameters

NameTypeDescription
valueuint256
unlock_timeuint256

increase_amount

function increase_amount(
uint256 value
) external

Parameters

NameTypeDescription
valueuint256

increase_unlock_time

function increase_unlock_time(
uint256 unlock_time
) external

Parameters

NameTypeDescription
unlock_timeuint256

withdraw

function withdraw() external

locked__end

function locked__end(
address
) external returns (uint256)

Parameters

NameTypeDescription
``address

checkpoint

function checkpoint() external

VoteEscrowTokenManager

Functions

constructor

function constructor(
contract IERC20 _liquidToken,
contract IVeToken _veToken,
uint256 _lockDuration
) internal

VoteEscrowTokenManager token Snapshot Delegator PCV Deposit constructor

Parameters

NameTypeDescription
_liquidTokencontract IERC20the token to lock for vote-escrow
_veTokencontract IVeTokenthe vote-escrowed token used in governance
_lockDurationuint256amount of time (in seconds) tokens will be vote-escrowed for

setLockDuration

function setLockDuration(
uint256 newLockDuration
) external

Set the amount of time tokens will be vote-escrowed for in lock() calls

Parameters

NameTypeDescription
newLockDurationuint256

lock

function lock() external

Deposit tokens to get veTokens. Set lock duration to lockDuration. The only way to withdraw tokens will be to pause this contract for lockDuration and then call exitLock().

exitLock

function exitLock() external

Exit the veToken lock. For this function to be called and not revert, tokens had to be locked previously, and the contract must have been paused for lockDuration in order to prevent lock extensions by calling lock(). This function will recover tokens on the contract, which can then be moved by calling withdraw() as a PCVController if the contract is also a PCVDeposit, for instance.

_totalTokensManaged

function _totalTokensManaged() internal returns (uint256)

returns total balance of tokens, vote-escrowed or liquid.

Events

Lock

event Lock(
uint256 cummulativeTokensLocked,
uint256 lockHorizon
)

Parameters

NameTypeDescription
cummulativeTokensLockeduint256
lockHorizonuint256

Unlock

event Unlock(
uint256 tokensUnlocked
)

Parameters

NameTypeDescription
tokensUnlockeduint256