Skip to main content

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:

  1. Emissions and gauges: YB mints from an exponentially decaying reserve only when called by an authorized minter (GaugeController). GaugeController tracks veYB gauge votes and weights each gauge by its staking ratio sqrt(staked / totalSupply). Each market's LiquidityGauge is an ERC-4626 vault over LT shares that streams YB and up to 7 external reward tokens. StakeZap batches LT deposit/withdrawal with LiquidityGauge staking/unstaking.
  2. Voting power and fee distribution: VotingEscrow (veYB) locks YB for up to 4 years (MAXTIME), exposes ERC-5805 IVotes (mode=timestamp) for Aragon governance, and represents each lock as a soulbound-unless-max-locked ERC-721 NFT. FeeDistributor streams received fee tokens over OVER_WEEKS = 4 future weekly epochs proportional to veYB.getPastVotes(user, epoch) / veYB.getPastTotalSupply(epoch). VotingPowerCondition enforces the Aragon proposal-creation threshold.
  3. Vesting: VestingEscrow vests YB linearly between START_TIME and END_TIME, optionally deploying a per-recipient CliffEscrow minimal proxy that lets recipients lock into veYB and vote before the cliff expires. InflationaryVest unlocks YB strictly in proportion to YB.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 Δt=t−last_minted\Delta t = t - \text{last\_minted} and a rate_factor f∈[0,1018]f \in [0, 10^{18}]:

emissions(t,f)=reserve⋅(1−exp⁡(−Δt⋅max_mint_rate⋅f1036))\text{emissions}(t, f) = \text{reserve} \cdot \left(1 - \exp\left(-\frac{\Delta t \cdot \text{max\_mint\_rate} \cdot f}{10^{36}}\right)\right)

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​

GetterTypeDescription
reserve()uint256Remaining YB tokens available for future emission (1e18).
last_minted()uint256Timestamp of the last emit call; 0 before emissions start.
max_mint_rate()uint256Immutable ceiling decay rate max_rate * 1e18 // reserve (1e18 / s).
is_minter(address)boolWhether an address can call mint and emit.
owner()addressCurrent owner (address(0) after renounce_ownership()).

External functions​

FunctionAccessDescription
preview_emissions(t: uint256, rate_factor: uint256) -> uint256ViewSimulates emissions from last_minted to t at rate_factor (<= 1e18). Returns 0 if last_minted == 0 or t <= last_minted.
start_emissions()OwnerSets last_minted = block.timestamp if it is currently 0.
renounce_ownership()OwnerStarts emissions if not started, revokes is_minter[msg.sender], emits RoleMinterChanged, and transfers ownership to address(0).
emit(owner: address, rate_factor: uint256) -> uint256MinterMints decayed emissions to owner, decrements reserve, and updates last_minted. Reverts with "erc20: access is denied" for non-minters.
mint(owner: address, amount: uint256)MinterExported snekmate ERC-20 mint used for pre-renouncement allocations.
set_minter(minter: address, status: bool)OwnerExported snekmate minter role toggle.
transfer_ownership(new_owner: address)OwnerExported 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​

ConstantValueMeaning
WEEK7 * 86400 (604_800 s)All finite lock end timestamps round down to whole weeks.
MAXTIME / UMAXTIME4 * 365 * 86400 (126_144_000 s)Maximum lock duration (4 years) and minimum deposit quantum (_value >= UMAXTIME).
WAD10**18Fixed-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_for rounds total supply down to a multiple of UMAXTIME: new_supply = (supply_before + _value) // UMAXTIME * UMAXTIME, and transfers only rounded_value = new_supply - supply_before from msg.sender.
  • Infinite lock: infinite_lock_toggle() sets locked[user].end = type(uint256).max, giving slope = 0 and bias = amount. Toggling infinite lock off requires transfer_clearance_checker.ve_transfer_allowed(msg.sender) == True (zero active gauge votes in GaugeController) and converts the lock into a 4-year decaying lock rounded down to WEEK.
  • NFT transfer and merge: transferFrom and safeTransferFrom require token_id == uint256(uint160(owner)), owner != to, zero active gauge votes for owner, and matching maximum-lock end times for both owner and to (both infinite-locked, or both ending at the current maximum week (block.timestamp + UMAXTIME) // WEEK * WEEK). Transferring merges owner's lock into to and burns owner's NFT before invoking onERC721Received.
  • Delegation disabled: delegates(account) always returns account; delegate and delegateBySig revert with "Not supported".

State and immutables​

GetterTypeDescription
TOKEN()addressImmutable locked ERC-20 token (YB).
supply()uint256Total 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()uint256Latest 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)uint256Latest user checkpoint index.
slope_changes(uint256)int256Scheduled global slope delta at weekly boundary t.
transfer_clearance_checker()addressContract checked before disabling infinite lock or transferring a lock (GaugeController).

External functions​

FunctionAccessDescription
create_lock(_value: uint256, _unlock_time: uint256)PublicCreates 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)PublicAdds _value >= UMAXTIME to an existing, unexpired lock for _for without changing end.
increase_unlock_time(_unlock_time: uint256)PublicExtends msg.sender's unexpired lock to a later week boundary (<= block.timestamp + UMAXTIME).
infinite_lock_toggle()PublicToggles between finite lock and infinite lock (end = type(uint256).max). Disabling infinite lock checks transfer_clearance_checker.
withdraw(_for: address = msg.sender)PublicWithdraws all locked YB to _for once block.timestamp >= locked[msg.sender].end and burns the NFT.
checkpoint()PublicAdvances global point_history up to block.timestamp.
transferFrom(owner, to, token_id) / safeTransferFrom(owner, to, token_id, data)Owner or approvedMerges owner's max-locked position into to and burns token_id.
set_transfer_clearance_checker(checker: address)OwnerSets the clearance checker contract and emits SetTransferClearanceChecker.
getVotes(account: address) -> uint256ViewCurrent voting power of account.
getPastVotes(account: address, timepoint: uint256) -> uint256ViewVoting power of account at timepoint (binary search over user_point_history).
totalVotes() -> uint256ViewCurrent total voting power (total_supply_at(block.timestamp)).
getPastTotalSupply(timepoint: uint256) -> uint256ViewTotal voting power at timepoint (works for past and future timestamps).
get_last_user_slope(addr: address) -> int256ViewLatest recorded decay slope for addr.
get_last_user_point(addr: address) -> (uint256 bias, uint256 slope)ViewLatest recorded unsigned (bias, slope) for addr.
locked__end(_addr: address) -> uint256ViewUnlock timestamp for _addr.
clock() -> uint48ViewCurrent block.timestamp cast to uint48.
supportsInterface(interface_id: bytes4) -> boolViewERC-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:

  1. It reads adjustment = min(Gauge(gauge).get_adjustment(), 10**18). For LiquidityGauge, get_adjustment() returns isqrt(staked * 1e36 / totalSupply), which is staked/supply\sqrt{\text{staked} / \text{supply}} in 1e18.
  2. It updates raw gauge_weight[gauge] = pt.bias and adjusted_gauge_weight[gauge] = w_new * adjustment // 10**18, along with gauge_weight_sum and adjusted_gauge_weight_sum.
  3. It calls TOKEN.emit(self, aw_sum * 10**18 // w_sum) using the pre-update sums as the rate_factor. Lower average staking across gauges throttles global YB inflation.
  4. It credits specific_emissions += d_emissions * 10**18 // aw_sum and accrues (specific_emissions - specific_emissions_per_gauge[gauge]) * aw // 10**18 into weighted_emissions_per_gauge[gauge].

Constants and storage​

Getter / ConstantTypeDescription
WEEKuint2567 * 86400 s (weekly slope-change grid).
WEIGHT_VOTE_DELAYuint25610 * 86400 s (10-day cooldown per (user, gauge) pair).
TOKEN()addressImmutable YB token address.
VOTING_ESCROW()addressImmutable VotingEscrow address.
n_gauges() / gauges(uint256)uint256 / addressCount and enumeration of registered gauges.
is_killed(address)boolWhether 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)uint256Total basis points allocated by user (<= 10000).
last_user_vote(user, gauge)uint256Last vote timestamp for (user, gauge).
gauge_weight(gauge) / gauge_weight_sum()uint256Unadjusted gauge weight and global sum.
adjusted_gauge_weight(gauge) / adjusted_gauge_weight_sum()uint256Adjustment-scaled gauge weight and global sum.
weighted_emissions_per_gauge(gauge) / sent_emissions_per_gauge(gauge)uint256Cumulative accrued vs. transferred YB per gauge.

External functions​

FunctionAccessDescription
add_gauge(gauge: address)OwnerRegisters a new gauge, initializes time_weight[gauge] = block.timestamp, and emits NewGauge.
set_killed(gauge: address, is_killed: bool)OwnerKills 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)PublicCheckpoints a registered gauge, triggering YB.emit(...).
emit() -> uint256Registered 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) -> uint256ViewCurrent unadjusted weight (bias) of addr.
gauge_relative_weight(gauge: address) -> uint256Viewadjusted_gauge_weight[gauge] * 1e18 // adjusted_gauge_weight_sum (1e18 = 100%).
preview_emissions(gauge: address, at_time: uint256) -> uint256ViewUnclaimed YB emissions accruable by gauge up to at_time.
ve_transfer_allowed(user: address) -> boolViewReturns 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 / ConstantTypeDescription
VERSION()String[8]"v1.0.0".
MAX_REWARDSuint2568 (slot 0 is always YB; up to 7 custom tokens).
MIN_SHARES()uint25610**12 minimum non-zero total supply.
GC() / YB() / LP_TOKEN() / FACTORY()addressImmutable references to GaugeController, YB, market LT, and Factory.
reward_count() / reward_tokens(uint256)uint256 / addressNumber 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)uint256Cumulative rewards already transferred to user.

External functions​

FunctionAccessDescription
deposit(assets, receiver) -> uint256PublicCheckpoints LT rebase and user rewards, stakes assets LT, enforces MIN_SHARES, calls GC.emit().
mint(shares, receiver) -> uint256PublicStakes LT for exact shares, checkpoints rebase and rewards, calls GC.emit().
withdraw(assets, receiver, owner) -> uint256PublicBurns gauge shares for exact assets LT, checkpoints rebase and rewards, calls GC.emit().
redeem(shares, receiver, owner) -> uint256Public (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)PublicCheckpoints both sender and recipient across all reward tokens, transfers gauge shares, calls GC.emit().
claim(reward: IERC20 = YB, user: address = msg.sender) -> uint256PublicVests reward (calling GC.emit() if reward == YB), checkpoints user, and transfers accrued reward to user.
preview_claim(reward: IERC20, user: address) -> uint256ViewSimulates claimable reward for user at block.timestamp.
get_adjustment() -> uint256ViewReturns 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)OwnerUpdates the distributor for a custom reward token and emits ChangeRewardDistributor.
deposit_reward(token: IERC20, amount: uint256, finish_time: uint256)Distributor or OwnerPulls 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()ViewReturns "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 / ConstantTypeDescription
OVER_WEEKS()uint2564 (number of future weekly epochs over which new inflows stream).
MAX_TOKENS()uint256100 (maximum tokens per token set).
INITIAL_EPOCH()uint256Immutable first distributable epoch (deploy_ts + WEEK) // WEEK * WEEK.
VE()addressImmutable 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 / addressActive token set ID and element-wise token getter (enumerate i = 0, 1, ... until revert; no whole-array getter).
balances_for_epoch(epoch, token)uint256Total token allocated to epoch.
last_claimed_for(user)uint256Last weekly epoch claimed for user (0 before first claim).
is_killed()boolWhether fill_epochs is halted ("Ded") and recover_token can sweep full balances.

External functions​

FunctionAccessDescription
fill_epochs()PublicDistributes 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)PublicClaims 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[])ViewReturns (tokens, amounts) allocated to (block.timestamp // WEEK + week_shift) * WEEK.
add_token_set(token_set: IERC20[])OwnerCalls _fill_epochs(), increments current_token_set, stores the new token set, and emits AddTokenSet.
recover_token(token: IERC20, receiver: address)OwnerRecovers unassigned token balance (balanceOf(self) - token_balances[token]), or full balance when is_killed == True.
kill_toggle(is_killed: bool)OwnerToggles is_killed and emits Kill.
Calling claim for a CliffEscrow recipient

When 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​

FunctionAccessDescription
deposit_and_stake(gauge: LiquidityGauge, assets: uint256, debt: uint256, min_shares: uint256, receiver: address = msg.sender) -> uint256PublicPulls 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) -> uint256PublicRedeems 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 / FunctionType / AccessDescription
VE()addressImmutable VotingEscrow address.
MIN_POWER()uint256Immutable minimum veYB voting power required (1e18).
isGranted(_where, _who, _permission_id, calldata) -> boolViewReturns VE.getVotes(_who) >= MIN_POWER.
supportsInterface(interface_id: bytes4) -> boolViewReturns 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​

GetterTypeDescription
TOKEN() / CLIFF_ESCROW()addressImmutable vested token (YB) and CliffEscrow implementation.
START_TIME() / END_TIME()uint256Immutable linear vesting start and end timestamps.
initial_locked(addr) / total_claimed(addr)uint256Total allocation and claimed amount for addr (or its CliffEscrow).
recipient_to_cliff(recipient)addressDeployed CliffEscrow proxy for recipient (address(0) if funded without a cliff).
initial_locked_supply() / unallocated_supply()uint256Allocated vs. unallocated TOKEN balances tracked by the escrow.
can_disable()boolWhether the owner can call toggle_disable.
disabled_at(addr) / disabled_amounts(addr) / disabled_rugged(addr)uint256 / uint256 / boolDisability timestamp, unvested disabled amount, and whether it was reclaimed via rug_disabled.

External functions​

FunctionAccessDescription
add_tokens(_amount: uint256)OwnerPulls _amount of TOKEN into unallocated_supply.
fund(_recipients: address[], _amounts: uint256[], cliff_time: uint256)OwnerAllocates 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)PublicTransfers vested, unclaimed TOKEN to addr (for cliffed recipients, pass the CliffEscrow address).
toggle_disable(_recipient: address)OwnerFreezes or unfreezes future vesting for _recipient (already-vested tokens remain claimable). Requires can_disable == True and not rugged.
rug_disabled(_recipient: address, _to: address)OwnerReclaims the unvested disabled_amounts[_recipient] to _to and marks disabled_rugged[_recipient] = True.
disable_can_disable()OwnerIrreversibly sets can_disable = False.
vestedOf(addr) / balanceOf(addr) / lockedOf(addr)ViewTotal vested, currently claimable, and still-locked amounts for addr.
vestedSupply() / lockedSupply()ViewGlobal 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​

GetterTypeDescription
YB() / VE() / GC()addressImmutable YB, VotingEscrow, and GaugeController addresses set in implementation constructor.
recipient()addressSole beneficiary authorized to operate the proxy.
unlock_time()uint256Timestamp when the cliff expires.

External functions​

FunctionAccessCliff requiredDescription
initialize(recipient, unlock_time) -> boolOnceNoSets recipient and unlock_time and grants max YB approval to VE.
create_lock(_value, _unlock_time)recipientNoCalls VE.create_lock from the escrow.
increase_amount(_value)recipientNoCalls VE.increase_amount from the escrow.
increase_unlock_time(_unlock_time)recipientNoCalls VE.increase_unlock_time from the escrow.
infinite_lock_toggle()recipientNoCalls VE.infinite_lock_toggle from the escrow.
withdraw()recipientNoWithdraws expired veYB back into the CliffEscrow contract.
vote_for_gauge_weights(_gauge_addrs, _user_weights)recipientNoVotes on gauge weights via GC.
aragon_vote(dao, proposal_id, vote_option, early_execution)recipientNoCasts an Aragon DAO vote using the escrow's veYB.
transferFrom(owner, to, token_id)recipientYesTransfers the veYB NFT out of the escrow via VE.transferFrom.
transfer(to, amount)recipient (any to) or anyone (to == recipient)YesTransfers unlocked YB out of the escrow.
approve(_for, amount)recipientYesApproves _for to spend unlocked YB.
recover_token(token, to, amount)recipientNoRecovers 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:

claimable=⌊(INITIAL_YB_RESERVE−YB.reserve())⋅initial_vest_reserveINITIAL_YB_RESERVE⌋−claimed\text{claimable} = \left\lfloor \frac{(\text{INITIAL\_YB\_RESERVE} - \text{YB.reserve}()) \cdot \text{initial\_vest\_reserve}}{\text{INITIAL\_YB\_RESERVE}} \right\rfloor - \text{claimed}

State and external functions​

Getter / FunctionType / AccessDescription
YB() / INITIAL_YB_RESERVE()address / uint256Immutable YB token and YB.reserve() captured at deployment.
recipient() / claimed() / initial_vest_reserve()address / uint256 / uint256Current 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() -> uint256ViewReturns currently claimable YB.
claim() -> uint256PublicTransfers claimable() YB to recipient, increments claimed, and emits Claim.
owner() / transfer_ownership(new_owner)View / OwnerExported snekmate ownership getters and transfer.
  • veYB and governance: governance workflow and vote-escrow concepts.
  • Tokenomics: YB emission schedule and allocation overview.
  • Event catalog: canonical signatures and topic0 hashes for all DAO events.
  • Error codes: revert strings and remediation for all DAO contracts.