DAO contracts
The YieldBasis DAO stack coordinates YB token emissions, vote-escrowed voting power (veYB), gauge-weighted staking rewards, multi-token protocol fee distribution, Aragon governance gating, and token vesting. Every contract is written in Vyper (0.4.3) and interacts through explicit on-chain getters rather than off-chain snapshots.
For deployed mainnet addresses, see Contract addresses. For event signatures and revert reasons across these contracts, see Event catalog and Error codes.
Architecture overview
The DAO contracts form three connected subsystems:
- Emissions and gauges:
YBmints from an exponentially decayingreserveonly when called by an authorized minter (GaugeController).GaugeControllertracksveYBgauge votes and weights each gauge by its staking ratiosqrt(staked / totalSupply). Each market'sLiquidityGaugeis an ERC-4626 vault overLTshares that streamsYBand up to 7 external reward tokens.StakeZapbatchesLTdeposit/withdrawal withLiquidityGaugestaking/unstaking. - Voting power and fee distribution:
VotingEscrow(veYB) locksYBfor up to 4 years (MAXTIME), exposes ERC-5805IVotes(mode=timestamp) for Aragon governance, and represents each lock as a soulbound-unless-max-locked ERC-721 NFT.FeeDistributorstreams received fee tokens overOVER_WEEKS = 4future weekly epochs proportional toveYB.getPastVotes(user, epoch) / veYB.getPastTotalSupply(epoch).VotingPowerConditionenforces the Aragon proposal-creation threshold. - Vesting:
VestingEscrowvestsYBlinearly betweenSTART_TIMEandEND_TIME, optionally deploying a per-recipientCliffEscrowminimal proxy that lets recipients lock intoveYBand vote before the cliff expires.InflationaryVestunlocksYBstrictly in proportion toYB.reserve()depletion.
YB.vy
YB is an ERC-20 token ("Yield Basis", "YB", 18 decimals) backed by snekmate ownable and erc20. Emissions follow continuous exponential decay out of reserve, scaled by a rate_factor in [0, 1e18] supplied by the minter (GaugeController).
Emission formula
For elapsed time and a rate_factor :
At deployment, max_mint_rate = max_rate * 10**18 // reserve (units of 1e18 per second). Calling emit subtracts the minted amount from reserve, updates last_minted = block.timestamp, and mints to owner.
State and immutables
| Getter | Type | Description |
|---|---|---|
reserve() | uint256 | Remaining YB tokens available for future emission (1e18). |
last_minted() | uint256 | Timestamp of the last emit call; 0 before emissions start. |
max_mint_rate() | uint256 | Immutable ceiling decay rate max_rate * 1e18 // reserve (1e18 / s). |
is_minter(address) | bool | Whether an address can call mint and emit. |
owner() | address | Current owner (address(0) after renounce_ownership()). |
External functions
| Function | Access | Description |
|---|---|---|
preview_emissions(t: uint256, rate_factor: uint256) -> uint256 | View | Simulates emissions from last_minted to t at rate_factor (<= 1e18). Returns 0 if last_minted == 0 or t <= last_minted. |
start_emissions() | Owner | Sets last_minted = block.timestamp if it is currently 0. |
renounce_ownership() | Owner | Starts emissions if not started, revokes is_minter[msg.sender], emits RoleMinterChanged, and transfers ownership to address(0). |
emit(owner: address, rate_factor: uint256) -> uint256 | Minter | Mints decayed emissions to owner, decrements reserve, and updates last_minted. Reverts with "erc20: access is denied" for non-minters. |
mint(owner: address, amount: uint256) | Minter | Exported snekmate ERC-20 mint used for pre-renouncement allocations. |
set_minter(minter: address, status: bool) | Owner | Exported snekmate minter role toggle. |
transfer_ownership(new_owner: address) | Owner | Exported snekmate ownership transfer. |
Standard ERC-20 (IERC20, IERC20Detailed) functions are exported directly from snekmate erc20.
VotingEscrow.vy (veYB)
VotingEscrow locks YB for up to 4 years to produce linearly decaying voting power (or constant voting power while infinite-locked). It implements ERC-721 (each user's token_id equals uint256(uint160(user))) and ERC-5805 IVotes with EIP-6372 CLOCK_MODE = "mode=timestamp".
Constants and mechanics
| Constant | Value | Meaning |
|---|---|---|
WEEK | 7 * 86400 (604_800 s) | All finite lock end timestamps round down to whole weeks. |
MAXTIME / UMAXTIME | 4 * 365 * 86400 (126_144_000 s) | Maximum lock duration (4 years) and minimum deposit quantum (_value >= UMAXTIME). |
WAD | 10**18 | Fixed-point scaling constant. |
CLOCK_MODE | "mode=timestamp" | EIP-6372 clock mode; clock() returns uint48(block.timestamp). |
Key invariants to account for when integrating:
- Deposit rounding:
_deposit_forrounds totalsupplydown to a multiple ofUMAXTIME:new_supply = (supply_before + _value) // UMAXTIME * UMAXTIME, and transfers onlyrounded_value = new_supply - supply_beforefrommsg.sender. - Infinite lock:
infinite_lock_toggle()setslocked[user].end = type(uint256).max, givingslope = 0andbias = amount. Toggling infinite lock off requirestransfer_clearance_checker.ve_transfer_allowed(msg.sender) == True(zero active gauge votes inGaugeController) and converts the lock into a 4-year decaying lock rounded down toWEEK. - NFT transfer and merge:
transferFromandsafeTransferFromrequiretoken_id == uint256(uint160(owner)),owner != to, zero active gauge votes forowner, and matching maximum-lock end times for bothownerandto(both infinite-locked, or both ending at the current maximum week(block.timestamp + UMAXTIME) // WEEK * WEEK). Transferring mergesowner's lock intotoand burnsowner's NFT before invokingonERC721Received. - Delegation disabled:
delegates(account)always returnsaccount;delegateanddelegateBySigrevert with"Not supported".
State and immutables
| Getter | Type | Description |
|---|---|---|
TOKEN() | address | Immutable locked ERC-20 token (YB). |
supply() | uint256 | Total locked YB across all accounts. |
locked(address) | (int256 amount, uint256 end) | Account's locked YB and unlock timestamp (type(uint256).max for infinite lock). |
epoch() | uint256 | Latest global checkpoint index. |
point_history(uint256) | (int256 bias, int256 slope, uint256 ts) | Global voting power curve points. |
user_point_history(address, uint256) | (int256 bias, int256 slope, uint256 ts) | Per-user voting power curve points. |
user_point_epoch(address) | uint256 | Latest user checkpoint index. |
slope_changes(uint256) | int256 | Scheduled global slope delta at weekly boundary t. |
transfer_clearance_checker() | address | Contract checked before disabling infinite lock or transferring a lock (GaugeController). |
External functions
| Function | Access | Description |
|---|---|---|
create_lock(_value: uint256, _unlock_time: uint256) | Public | Creates a new lock for msg.sender and mints NFT token_id = uint256(uint160(msg.sender)). Requires _value >= UMAXTIME, no existing lock, and future unlock_time <= block.timestamp + UMAXTIME. |
increase_amount(_value: uint256, _for: address = msg.sender) | Public | Adds _value >= UMAXTIME to an existing, unexpired lock for _for without changing end. |
increase_unlock_time(_unlock_time: uint256) | Public | Extends msg.sender's unexpired lock to a later week boundary (<= block.timestamp + UMAXTIME). |
infinite_lock_toggle() | Public | Toggles between finite lock and infinite lock (end = type(uint256).max). Disabling infinite lock checks transfer_clearance_checker. |
withdraw(_for: address = msg.sender) | Public | Withdraws all locked YB to _for once block.timestamp >= locked[msg.sender].end and burns the NFT. |
checkpoint() | Public | Advances global point_history up to block.timestamp. |
transferFrom(owner, to, token_id) / safeTransferFrom(owner, to, token_id, data) | Owner or approved | Merges owner's max-locked position into to and burns token_id. |
set_transfer_clearance_checker(checker: address) | Owner | Sets the clearance checker contract and emits SetTransferClearanceChecker. |
getVotes(account: address) -> uint256 | View | Current voting power of account. |
getPastVotes(account: address, timepoint: uint256) -> uint256 | View | Voting power of account at timepoint (binary search over user_point_history). |
totalVotes() -> uint256 | View | Current total voting power (total_supply_at(block.timestamp)). |
getPastTotalSupply(timepoint: uint256) -> uint256 | View | Total voting power at timepoint (works for past and future timestamps). |
get_last_user_slope(addr: address) -> int256 | View | Latest recorded decay slope for addr. |
get_last_user_point(addr: address) -> (uint256 bias, uint256 slope) | View | Latest recorded unsigned (bias, slope) for addr. |
locked__end(_addr: address) -> uint256 | View | Unlock timestamp for _addr. |
clock() -> uint48 | View | Current block.timestamp cast to uint48. |
supportsInterface(interface_id: bytes4) -> bool | View | ERC-165 check for ERC-165, ERC-721, Metadata, Enumeration, ERC-4906, and IVotes (0xE90FB3F6). |
GaugeController.vy
GaugeController aggregates veYB gauge votes, computes each gauge's staking-adjusted weight, triggers YB.emit(...) on every checkpoint, and transfers earned YB to gauges on emit().
Weight adjustment and emission throttling
When _checkpoint_gauge(gauge) runs:
- It reads
adjustment = min(Gauge(gauge).get_adjustment(), 10**18). ForLiquidityGauge,get_adjustment()returnsisqrt(staked * 1e36 / totalSupply), which is in1e18. - It updates raw
gauge_weight[gauge] = pt.biasandadjusted_gauge_weight[gauge] = w_new * adjustment // 10**18, along withgauge_weight_sumandadjusted_gauge_weight_sum. - It calls
TOKEN.emit(self, aw_sum * 10**18 // w_sum)using the pre-update sums as therate_factor. Lower average staking across gauges throttles globalYBinflation. - It credits
specific_emissions += d_emissions * 10**18 // aw_sumand accrues(specific_emissions - specific_emissions_per_gauge[gauge]) * aw // 10**18intoweighted_emissions_per_gauge[gauge].
Constants and storage
| Getter / Constant | Type | Description |
|---|---|---|
WEEK | uint256 | 7 * 86400 s (weekly slope-change grid). |
WEIGHT_VOTE_DELAY | uint256 | 10 * 86400 s (10-day cooldown per (user, gauge) pair). |
TOKEN() | address | Immutable YB token address. |
VOTING_ESCROW() | address | Immutable VotingEscrow address. |
n_gauges() / gauges(uint256) | uint256 / address | Count and enumeration of registered gauges. |
is_killed(address) | bool | Whether voting non-zero weight for a gauge is blocked. |
vote_user_slopes(user, gauge) | VotedSlope | (slope, bias, power, end) for a user's gauge vote. |
vote_user_power(user) | uint256 | Total basis points allocated by user (<= 10000). |
last_user_vote(user, gauge) | uint256 | Last vote timestamp for (user, gauge). |
gauge_weight(gauge) / gauge_weight_sum() | uint256 | Unadjusted gauge weight and global sum. |
adjusted_gauge_weight(gauge) / adjusted_gauge_weight_sum() | uint256 | Adjustment-scaled gauge weight and global sum. |
weighted_emissions_per_gauge(gauge) / sent_emissions_per_gauge(gauge) | uint256 | Cumulative accrued vs. transferred YB per gauge. |
External functions
| Function | Access | Description |
|---|---|---|
add_gauge(gauge: address) | Owner | Registers a new gauge, initializes time_weight[gauge] = block.timestamp, and emits NewGauge. |
set_killed(gauge: address, is_killed: bool) | Owner | Kills or unkills a registered gauge and emits SetKilled. Killed gauges reject non-zero new votes. |
vote_for_gauge_weights(_gauge_addrs: address[], _user_weights: uint256[]) | Public (veYB holder) | Allocates up to 50 gauge weights in bps (0..10000, total <= 10000). Requires VOTING_ESCROW.transfer_clearance_checker() == self, unexpired lock, and 10-day cooldown per gauge. |
checkpoint(gauge: address) | Public | Checkpoints a registered gauge, triggering YB.emit(...). |
emit() -> uint256 | Registered gauge (msg.sender) | Checkpoints msg.sender and transfers weighted_emissions_per_gauge[msg.sender] - sent_emissions_per_gauge[msg.sender] YB to msg.sender. |
get_gauge_weight(addr: address) -> uint256 | View | Current unadjusted weight (bias) of addr. |
gauge_relative_weight(gauge: address) -> uint256 | View | adjusted_gauge_weight[gauge] * 1e18 // adjusted_gauge_weight_sum (1e18 = 100%). |
preview_emissions(gauge: address, at_time: uint256) -> uint256 | View | Unclaimed YB emissions accruable by gauge up to at_time. |
ve_transfer_allowed(user: address) -> bool | View | Returns vote_user_power[user] == 0. Called by VotingEscrow. |
LiquidityGauge.vy
LiquidityGauge is an ERC-4626 vault (erc4626.vy) over a market's LT (yb-LP) token. Depositing stakes LT shares to earn YB emissions from GaugeController plus up to MAX_REWARDS - 1 = 7 external reward tokens.
Staker rebase and ERC-4626 accounting
Because LT rebases the staker's balance when the pool is below the watermark or collecting fees, every state-changing vault operation (deposit, mint, withdraw, redeem) calls LT(LP_TOKEN).checkpoint_staker_rebase() first. View conversions (totalAssets, convertToShares, convertToAssets, previewDeposit, previewWithdraw, previewRedeem, maxWithdraw; previewMint is not @external on LiquidityGauge) read LT(LP_TOKEN).updated_balances()[1] so quotes reflect pending rebases without mutating state.
To prevent ERC-4626 inflation attacks, erc4626.vy enforces MIN_SHARES = 10**12 (MIN_SHARES_DECIMALS = 12): after any deposit, mint, withdraw, or redeem, totalSupply must be either 0 or >= 10**12, otherwise the call reverts with "erc4626: leave MIN_SHARES".
State and immutables
| Getter / Constant | Type | Description |
|---|---|---|
VERSION() | String[8] | "v1.0.0". |
MAX_REWARDS | uint256 | 8 (slot 0 is always YB; up to 7 custom tokens). |
MIN_SHARES() | uint256 | 10**12 minimum non-zero total supply. |
GC() / YB() / LP_TOKEN() / FACTORY() | address | Immutable references to GaugeController, YB, market LT, and Factory. |
reward_count() / reward_tokens(uint256) | uint256 / address | Number and array of registered reward tokens. |
rewards(token) | (address distributor, uint256 finish_time, uint256 total) | Custom reward stream metadata (YB distributor is GC). |
claimed_rewards(user, token) | uint256 | Cumulative rewards already transferred to user. |
External functions
| Function | Access | Description |
|---|---|---|
deposit(assets, receiver) -> uint256 | Public | Checkpoints LT rebase and user rewards, stakes assets LT, enforces MIN_SHARES, calls GC.emit(). |
mint(shares, receiver) -> uint256 | Public | Stakes LT for exact shares, checkpoints rebase and rewards, calls GC.emit(). |
withdraw(assets, receiver, owner) -> uint256 | Public | Burns gauge shares for exact assets LT, checkpoints rebase and rewards, calls GC.emit(). |
redeem(shares, receiver, owner) -> uint256 | Public (or FACTORY.emergency_admin() when LT.is_killed()) | Redeems shares for LT. In kill mode, FACTORY.emergency_admin() can redeem on behalf of any owner strictly with receiver == owner. |
transfer(to, amount) / transferFrom(owner, to, amount) | Public | Checkpoints both sender and recipient across all reward tokens, transfers gauge shares, calls GC.emit(). |
claim(reward: IERC20 = YB, user: address = msg.sender) -> uint256 | Public | Vests reward (calling GC.emit() if reward == YB), checkpoints user, and transfers accrued reward to user. |
preview_claim(reward: IERC20, user: address) -> uint256 | View | Simulates claimable reward for user at block.timestamp. |
get_adjustment() -> uint256 | View | Returns isqrt(staked * 1e36 / totalSupply) in [0, 1e18] for GaugeController. |
add_reward(token: IERC20, distributor: address) | Owner (Factory.admin()) | Adds a custom reward token (not YB, not LP_TOKEN, max 8 total) and emits AddReward. |
change_reward_distributor(token: IERC20, distributor: address) | Owner | Updates the distributor for a custom reward token and emits ChangeRewardDistributor. |
deposit_reward(token: IERC20, amount: uint256, finish_time: uint256) | Distributor or Owner | Pulls amount of custom token and streams it until finish_time (or preserves the existing rate if finish_time == 0 and unvested rewards remain). |
name() / symbol() | View | Returns "YB Gauge: <LT.symbol()>" and "g(<LT.symbol()>)". |
FeeDistributor.vy
FeeDistributor distributes multi-token protocol revenues to veYB holders across weekly epochs. Whenever tokens arrive and fill_epochs() (or any claim) runs, the newly received balance of every token in token_sets[current_token_set] is split evenly across the next OVER_WEEKS = 4 future weekly epochs (cursor, cursor + WEEK, cursor + 2*WEEK, cursor + 3*WEEK, where cursor = (block.timestamp + WEEK) // WEEK * WEEK).
Constants and storage
| Getter / Constant | Type | Description |
|---|---|---|
OVER_WEEKS() | uint256 | 4 (number of future weekly epochs over which new inflows stream). |
MAX_TOKENS() | uint256 | 100 (maximum tokens per token set). |
INITIAL_EPOCH() | uint256 | Immutable first distributable epoch (deploy_ts + WEEK) // WEEK * WEEK. |
VE() | address | Immutable VotingEscrow address. |
VESTING_ESCROWS() | address[] | Immutable array (up to 5) of VestingEscrow contracts for cliff-escrow claims. |
current_token_set() / token_sets(uint256, uint256) | uint256 / address | Active token set ID and element-wise token getter (enumerate i = 0, 1, ... until revert; no whole-array getter). |
balances_for_epoch(epoch, token) | uint256 | Total token allocated to epoch. |
last_claimed_for(user) | uint256 | Last weekly epoch claimed for user (0 before first claim). |
is_killed() | bool | Whether fill_epochs is halted ("Ded") and recover_token can sweep full balances. |
External functions
| Function | Access | Description |
|---|---|---|
fill_epochs() | Public | Distributes newly arrived balances of the active token set evenly across the next 4 weekly epochs. Reverts with "Ded" if killed. |
claim(receiver: address = msg.sender, epoch_count: uint256 = 50, use_vest: bool = False) | Public | Claims up to epoch_count (capped at 50) past epochs for receiver. When use_vest == True, looks up receiver's CliffEscrow in VESTING_ESCROWS and claims using the cliff escrow's veYB balance while sending tokens directly to receiver. |
preview_claim(receiver: address, epoch_count: uint256 = 50, use_vest: bool = False) -> (IERC20[], uint256[]) | Nonpayable (call via eth_call) | Executes _execute_claim and returns (tokens, amounts). Always simulate via static eth_call, never send as a transaction. |
preview_distribution(week_shift: int256 = 0) -> (IERC20[], uint256[]) | View | Returns (tokens, amounts) allocated to (block.timestamp // WEEK + week_shift) * WEEK. |
add_token_set(token_set: IERC20[]) | Owner | Calls _fill_epochs(), increments current_token_set, stores the new token set, and emits AddTokenSet. |
recover_token(token: IERC20, receiver: address) | Owner | Recovers unassigned token balance (balanceOf(self) - token_balances[token]), or full balance when is_killed == True. |
kill_toggle(is_killed: bool) | Owner | Toggles is_killed and emits Kill. |
claim for a CliffEscrow recipientWhen use_vest == False and receiver != msg.sender, FeeDistributor probes receiver.VE(). If receiver looks like a CliffEscrow (returns VE() equal to FeeDistributor.VE()), the call reverts with "Might be a vest" to prevent trapping rewards inside a cliff contract. Pass the beneficiary's address as receiver with use_vest = True instead.
StakeZap.vy
StakeZap is a stateless helper (aside from lazy infinite-approval caching per LiquidityGauge) that combines LT deposit/withdrawal with LiquidityGauge staking/unstaking in one transaction.
External functions
| Function | Access | Description |
|---|---|---|
deposit_and_stake(gauge: LiquidityGauge, assets: uint256, debt: uint256, min_shares: uint256, receiver: address = msg.sender) -> uint256 | Public | Pulls assets of LT.ASSET_TOKEN(), calls lt.deposit(assets, debt, min_shares), stakes the minted LT shares in gauge for receiver, and returns gauge shares minted. |
withdraw_and_unstake(gauge: LiquidityGauge, shares: uint256, min_assets: uint256, receiver: address = msg.sender) -> uint256 | Public | Redeems shares from gauge (requires caller's ERC-20 approval of gauge shares to StakeZap), calls lt.withdraw(lt_tokens, min_assets, receiver), and returns underlying asset tokens received. |
For markets running YBOraclizedPolicy, see Deposit, withdraw, and migrate for computing debt within policy.ratio_tolerance(), or use LTDepositZap for debt-free deposit-and-stake flows.
VotingPowerCondition.vy
VotingPowerCondition implements Aragon OSx IPermissionCondition (0x2675fdd0) to gate governance actions (such as proposal creation) by a minimum veYB balance.
| Getter / Function | Type / Access | Description |
|---|---|---|
VE() | address | Immutable VotingEscrow address. |
MIN_POWER() | uint256 | Immutable minimum veYB voting power required (1e18). |
isGranted(_where, _who, _permission_id, calldata) -> bool | View | Returns VE.getVotes(_who) >= MIN_POWER. |
supportsInterface(interface_id: bytes4) -> bool | View | Returns True for ERC-165 (0x01FFC9A7) and IPermissionCondition (0x2675fdd0). |
VestingEscrow.vy
VestingEscrow linearly vests TOKEN (YB) for multiple recipients between START_TIME and END_TIME. Optionally, fund deploys a per-recipient CliffEscrow minimal proxy when cliff_time > block.timestamp, recording the vesting allocation under the proxy address and mapping recipient_to_cliff[recipient] = cliff_escrow.
State and immutables
| Getter | Type | Description |
|---|---|---|
TOKEN() / CLIFF_ESCROW() | address | Immutable vested token (YB) and CliffEscrow implementation. |
START_TIME() / END_TIME() | uint256 | Immutable linear vesting start and end timestamps. |
initial_locked(addr) / total_claimed(addr) | uint256 | Total allocation and claimed amount for addr (or its CliffEscrow). |
recipient_to_cliff(recipient) | address | Deployed CliffEscrow proxy for recipient (address(0) if funded without a cliff). |
initial_locked_supply() / unallocated_supply() | uint256 | Allocated vs. unallocated TOKEN balances tracked by the escrow. |
can_disable() | bool | Whether the owner can call toggle_disable. |
disabled_at(addr) / disabled_amounts(addr) / disabled_rugged(addr) | uint256 / uint256 / bool | Disability timestamp, unvested disabled amount, and whether it was reclaimed via rug_disabled. |
External functions
| Function | Access | Description |
|---|---|---|
add_tokens(_amount: uint256) | Owner | Pulls _amount of TOKEN into unallocated_supply. |
fund(_recipients: address[], _amounts: uint256[], cliff_time: uint256) | Owner | Allocates up to 100 recipients from unallocated_supply. If cliff_time > block.timestamp, clones CLIFF_ESCROW per recipient and funds the proxy. |
claim(addr: address = msg.sender) | Public | Transfers vested, unclaimed TOKEN to addr (for cliffed recipients, pass the CliffEscrow address). |
toggle_disable(_recipient: address) | Owner | Freezes or unfreezes future vesting for _recipient (already-vested tokens remain claimable). Requires can_disable == True and not rugged. |
rug_disabled(_recipient: address, _to: address) | Owner | Reclaims the unvested disabled_amounts[_recipient] to _to and marks disabled_rugged[_recipient] = True. |
disable_can_disable() | Owner | Irreversibly sets can_disable = False. |
vestedOf(addr) / balanceOf(addr) / lockedOf(addr) | View | Total vested, currently claimable, and still-locked amounts for addr. |
vestedSupply() / lockedSupply() | View | Global vested and locked totals (does not adjust for rugged amounts). |
CliffEscrow.vy
CliffEscrow is a single-recipient minimal proxy cloned by VestingEscrow. Before unlock_time, the recipient cannot transfer or approve YB out of the escrow, but can lock claimed YB into VotingEscrow, vote on gauges in GaugeController, and vote on Aragon DAO proposals.
State and immutables
| Getter | Type | Description |
|---|---|---|
YB() / VE() / GC() | address | Immutable YB, VotingEscrow, and GaugeController addresses set in implementation constructor. |
recipient() | address | Sole beneficiary authorized to operate the proxy. |
unlock_time() | uint256 | Timestamp when the cliff expires. |
External functions
| Function | Access | Cliff required | Description |
|---|---|---|---|
initialize(recipient, unlock_time) -> bool | Once | No | Sets recipient and unlock_time and grants max YB approval to VE. |
create_lock(_value, _unlock_time) | recipient | No | Calls VE.create_lock from the escrow. |
increase_amount(_value) | recipient | No | Calls VE.increase_amount from the escrow. |
increase_unlock_time(_unlock_time) | recipient | No | Calls VE.increase_unlock_time from the escrow. |
infinite_lock_toggle() | recipient | No | Calls VE.infinite_lock_toggle from the escrow. |
withdraw() | recipient | No | Withdraws expired veYB back into the CliffEscrow contract. |
vote_for_gauge_weights(_gauge_addrs, _user_weights) | recipient | No | Votes on gauge weights via GC. |
aragon_vote(dao, proposal_id, vote_option, early_execution) | recipient | No | Casts an Aragon DAO vote using the escrow's veYB. |
transferFrom(owner, to, token_id) | recipient | Yes | Transfers the veYB NFT out of the escrow via VE.transferFrom. |
transfer(to, amount) | recipient (any to) or anyone (to == recipient) | Yes | Transfers unlocked YB out of the escrow. |
approve(_for, amount) | recipient | Yes | Approves _for to spend unlocked YB. |
recover_token(token, to, amount) | recipient | No | Recovers any ERC-20 token other than YB ("Cannot recover YB"). |
InflationaryVest.vy
InflationaryVest unlocks a fixed YB allocation for a single governance-updatable recipient strictly in proportion to cumulative YB reserve depletion:
State and external functions
| Getter / Function | Type / Access | Description |
|---|---|---|
YB() / INITIAL_YB_RESERVE() | address / uint256 | Immutable YB token and YB.reserve() captured at deployment. |
recipient() / claimed() / initial_vest_reserve() | address / uint256 / uint256 | Current beneficiary, cumulative claimed YB, and balance snapshotted at start(). |
start() | Owner ("Admin required") | Snapshots initial_vest_reserve = YB.balanceOf(self) once ("Already started") and emits Start. |
set_recipient(new_recipient: address) | Owner ("Admin required") | Updates recipient and emits NewRecepient (source spelling preserved). |
claimable() -> uint256 | View | Returns currently claimable YB. |
claim() -> uint256 | Public | Transfers claimable() YB to recipient, increments claimed, and emits Claim. |
owner() / transfer_ownership(new_owner) | View / Owner | Exported snekmate ownership getters and transfer. |
Related
- veYB and governance: governance workflow and vote-escrow concepts.
- Tokenomics:
YBemission schedule and allocation overview. - Event catalog: canonical signatures and
topic0hashes for all DAO events. - Error codes: revert strings and remediation for all DAO contracts.