MigrationFactoryOwner
The source code of the MigrationFactoryOwner.vy contract can be found on GitHub. The contract is written with Vyper version 0.4.3.
Overview
MigrationFactoryOwner is a slimmer predecessor of HybridFactoryOwner — same admin-proxy pattern, fewer features. It owns its FACTORY and forwards governance calls, but it lacks the limit_setters allowlist and the lt_distribute_borrower_fees surface. It still exists on-chain because LTMigrator reads two of its views to gate migrations.
The bulk of this contract is governance plumbing for the DAO that operates the migration-era Factory. Integrators only care about two public views.
What integrators read
@external
@view
def lt_in_factory(lt: address) -> bool
Returns True if STABLECOIN.allowance(FACTORY, lt) > 0 — a stand-in check for "this LT has been deployed by FACTORY and was given crvUSD spend permission." LTMigrator calls this against both lt_from and lt_to before routing a migration; integrators should do the same before treating an LT address as a valid YB market under this Factory.
disabled_lts: public(HashMap[LT, bool])
Map keyed by LT address. True means admin disabled that market (via lt_allocate_stablecoins(lt, 0)). LTMigrator refuses to migrate INTO any LT where this flag is set ("lt_to deprecated").
@view accessor signature: disabled_lts(lt: address) -> bool.
Governance surface (admin-only)
For completeness — none of these are intended for non-admin callers. Each requires msg.sender == ADMIN.
| Function | Forwards to / effect |
|---|---|
transfer_ownership_back() | FACTORY.set_admin(ADMIN, emergency_admin) |
lt_set_rate(lt, rate) | LT.set_rate |
lt_set_amm_rate(lt, fee) | LT.set_amm_fee (note the function name differs from the LT method) |
lt_set_killed(lt, is_killed) | LT.set_killed |
lt_allocate_stablecoins(lt, limit) | Admin-only when limit > 0 (no limit_setters allowlist here); permissionless when limit == 0 and disabled_lts[lt] == True, same 75% safe floor as HybridFactoryOwner. |
lt_needs_withdraw(lt) | View: shares that need to be withdrawn for available_limit to match stablecoin_allocated. |
add_market(...) | FACTORY.add_market |
set_fee_receiver(addr) | FACTORY.set_fee_receiver |
set_implementations(...) | FACTORY.set_implementations |
set_min_admin_fee(value) | FACTORY.set_min_admin_fee |
This contract does not expose lt_distribute_borrower_fees, set_allocator, set_agg, set_flash, fill_staker_vpool, or set_limit_setter. For those, use HybridFactoryOwner.
Related
- Core: HybridFactoryOwner — current admin proxy with the fuller surface.
- Core: LTMigrator — primary consumer of
lt_in_factoryanddisabled_lts.