Skip to content

Repository files navigation

Yearn Vesting Escrow

Vesting escrows for standard ERC-20 tokens and ERC-4626 vault shares.

Important

Version 0.4.0 is released and deployed on Ethereum mainnet from frozen sources at 792c21b. This version has not received an independent audit.

Contracts

Version 0.4.0 has two dedicated escrow implementations behind one factory:

Contract Purpose
VestingEscrowSimple.vy Vests a fixed amount of an ordinary ERC-20 token.
VestingEscrow4626.vy Vests principal denominated in underlying assets while holding and paying ERC-4626 shares.
VestingEscrowFactory.vy Deploys funded minimal proxies from separate immutable implementation targets.

The two escrows share a role model and linear schedule, but deliberately have separate storage, APIs, and accounting. The standard escrow never needs to know about shares or yield. The ERC-4626 escrow makes every asset/share boundary explicit.

The factory exposes one full signature per deployment path:

deploy_vesting_contract(
    token,
    recipient,
    amount,
    vesting_duration,
    vesting_start,
    cliff_length,
    permissionless_claims,
    revoker,
)

deploy_erc4626_vesting(
    vault,
    recipient,
    principal_assets,
    max_funded_shares,
    vesting_duration,
    vesting_start,
    cliff_length,
    permissionless_claims,
    revoker,
    yield_recipient,
)

ERC-4626 callers choose an exact asset-denominated principal and cap the shares spent to fund it. preview_erc4626_funding(vault, principal_assets) quotes the factory's current rounded-up share requirement.

Factory creation events are the canonical escrow index. The contracts do not maintain a duplicate on-chain registry.

Documentation

Roles

Role Authority
recipient Owns vested principal, may redirect its own claims, and controls permissionless claiming.
revoker May stop vesting immediately and send unvested principal to an explicit receiver, or permanently renounce that authority.
receiver A per-call transfer destination with no persistent authority.
funder Supplies the initial tokens or shares and receives no implicit post-deployment rights.
yield_recipient Fixed destination for all ERC-4626 yield shares.

Permissionless claiming permits third-party execution, not third-party routing: a caller other than the recipient can only send principal to the stored recipient. ERC-4626 yield collection is permissionless because its destination is fixed.

Development

The contracts use Vyper 0.4.3 and Titanoboa on Python 3.11:

uv sync --locked
uv run --locked vesting-escrow-compile
uv run --locked pytest
uv run --locked pytest tests/functional/ --gas-profile

See the deployment guide for local deployment, pinned mainnet-fork testing, and the production checklist.

Escrow manager

Wavey's Vesting Escrow app provides an interface to find and manage escrows deployed by the historical Yearn v0.3.0 factory and the LlamaPay v2 factory. The app and its Ethereum event indexer are open source.

The app is independent software. This contracts repository does not index or operate deployed escrows.

Production deployments

Every factory and escrow listed here is immutable. Integrators must select the ABI matching each deployed version and factory address.

The 0.4.0 contract sources are frozen at commit 792c21b. All three contracts have exact creation matches on Sourcify and are verified on Etherscan. See the deployment manifest for transactions, blocks, compiler settings, and bytecode hashes.

This is the previous Yearn production factory.

LlamaPay v2 (derived from v0.3.0)

LlamaPay forked this repository at v0.3.0 (d14eed1) and retained its consumer interface. Its v2 adds an escrow registry, makes the Vyper donation opt-in by default, and hardens revoke and dust handling.

Warning

This version has an unpatched bug. Do not call renounce_ownership.

About

Vesting escrows for ERC-20 tokens and ERC-4626 vaults, with asset-denominated principal payouts, cliffs, and revocation.

Topics

Resources

Stars

69 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages