Skip to main content

Overview

VeELTA is the vote-escrowed staking contract. Users lock ELTA for a chosen duration to receive veELTA, which grants governance voting power and a share of protocol rewards. Longer locks yield more weight.

Key Functions

Read

FunctionReturnsDescription
balanceOf(address account)uint256Current veELTA balance (decays over time)
locked(address account)LockedBalanceLock amount and unlock timestamp
totalSupply()uint256Total veELTA supply
getVotes(address account)uint256Governance voting power
getPastVotes(address account, uint256 timepoint)uint256Historical voting power

Write

FunctionAccessDescription
lock(uint256 amount, uint256 unlockTime)UserLock ELTA to mint veELTA
increaseAmount(uint256 amount)UserAdd more ELTA to existing lock
increaseUnlockTime(uint256 newUnlockTime)UserExtend lock duration
withdraw()UserWithdraw ELTA after lock expires
delegate(address delegatee)UserDelegate voting power

LockedBalance Struct

struct LockedBalance {
    uint256 amount;     // Locked ELTA
    uint256 unlockTime; // Unix timestamp
}

Weight Decay

veELTA balance decays linearly from lock time to unlock time: veELTA=amount×unlockTimenowmaxLockDuration\text{veELTA} = \text{amount} \times \frac{\text{unlockTime} - \text{now}}{\text{maxLockDuration}} Maximum lock duration is 4 years, yielding 1:1 veELTA per ELTA.

Events

EventEmitted When
Locked(address account, uint256 amount, uint256 unlockTime)New lock created
AmountIncreased(address account, uint256 amount)Lock amount increased
UnlockTimeExtended(address account, uint256 newUnlockTime)Lock extended
Withdrawn(address account, uint256 amount)ELTA withdrawn after expiry
DelegateChanged(address delegator, address delegatee)Voting power delegated