swapSaiToDai- Takes Sai (ERC-20 DAI from Single Collateral System) returns DAI (ERC-20 DAI from MultiCollateral System).
swapDaiToSai- Takes DAI (ERC-20 DAI from MultiCollateral System) returns Sai (ERC-20 DAI from Single Collateral System)
migrate- Moves a Vault from SCD to MCD by closing the SCD one and opening a corresponding MCD one.
tub: SCD Tub contract address
vat: MCD Vat Contract address
cdpManager: MCD CDP manager
saiJoin: SAI collateral adapter for MCD
wethJoin: WETH collateral adapter for MCD
daiJoin: DAI join adapter for MCD
approvethe migration contract on the SAI ERC-20 contract so that it can perform the
transferFrom. The migration contract holds a Vault in MCD that takes SAI as collateral and allows it to exit MCD-DAI, which it does and returns to the
approves the migration contract on the DAI ERC-20 contract so that it can
jointhe DAI back into MCD. This pays back the "debt" in its SAI-MCD Vault and allows it to retrieve the SAI "collateral" and return it to the
MigrationProxyActionsas it requires the migration contract owns the SCD-Vault (
cup) already and that the migration contract has enough MKR to pay the stability fees. The
msg.senderto the migration contract so that the migration contract has enough MKR to pay the stability fee and close the
cup(along with the MKR it has from the proxy action to pay the fee). Then it withdraws the PETH as WETH.
joins its WETH into its new Vault and withdraws enough DAI from the new Vault (and pays back its Vault) to compensate for the SAI it drew earlier in this step.
wadamount has to be below the debt ceiling for both the overall MCD system and the SAI collateral type, otherwise the
frobwill fail. This means that these governance parameters can impact the speed of the transition from SAI to DAI.
wadamount has to be below the amount of SAI collateral in the migration contract's Vault. If a user with DAI wants to move to SAI but no SAI users have already moved to DAI, then this will fail.
cupand SAI, they should decide whether it makes sense to:
cupin SCD, then
cupto MCD (essentially just transfer the collateral to a new MCD Vault).
cupwith the debt in place, then use
swapSaiToDaito get DAI which they can then use as an ERC-20 or payback their MCD debt.
cup, a user will have to purchase MKR in order to pay the stability fee and be able to
exitthe SCD system. However, once in MCD, new fees will be accrued (and have to be paid) in DAI. If a user's converted SAI does not cover their MCD debt + stability fee, they may have to purchase DAI on the open market.
Jug.basehave to be set to
0during the migration period
cups are lost/not migrated than lost/not migrated Sai): results in an auction and possibly MKR auction to cover bad debt.