Migrate to ALE v5
Summary
This proposal migrates FiRM from the current ALE v4 deployment to ALE v5 following the discovery of an approval-handling bug in ALE v4.
ALE v4 relied on persistent approvals between ALE and FiRM markets. Certain inherited helper functions could overwrite these approvals and leave them at zero after use, causing subsequent ALE leverage transactions for the affected market to fail.
ALE v5 fixes this by using ad-hoc approvals, approving the exact amount required immediately before each interaction rather than relying on persistent approvals.
ALE v5: 0x43Fa5E63253b00D5e34f42e711D734A058142055
As with the previous ALE migration, a migration helper will be used to copy the existing market configurations from ALE v4 to ALE v5.
The existing DbrHelper will continue to be used.
Exchange Routers
ALE v5 will approve both Enso and KyberSwap for swap routing, allowing the FiRM UI to offer both options to users.
- Enso:
0xF75584eF6673aD213a685a1B58Cc0330B8eA22Cf - KyberSwap:
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
Odos will not be approved following the shutdown of the protocol.
On-chain Actions
- Allow ALE v5 on the BorrowController:
borrowController.allow(
0x43Fa5E63253b00D5e34f42e711D734A058142055
);
- Approve Enso and KyberSwap on ALE v5:
newALE.allowProxy(
0xF75584eF6673aD213a685a1B58Cc0330B8eA22Cf
);
newALE.allowProxy(
0x6131B5fae19EA4f9D964eAc0408E4408b66337b5
);
- Nominate the migration helper as pending governance of ALE v5 and DbrHelper:
newALE.setPendingGov(migrationHelper);
dbrHelper.setPendingGov(migrationHelper);
- Execute the migration:
migrationHelper.migrate();
This copies the existing FiRM market configurations from ALE v4 to ALE v5 and ensures the relevant markets are approved by DbrHelper.
- Reclaim governance:
newALE.claimPendingGov();
dbrHelper.claimPendingGov();
- Disable ALE v4 on the BorrowController:
borrowController.deny(
0x39D167Fe676EFC3be49bE874a37349A5D89f9058
);
No user positions, collateral, debt, or FiRM market parameters are changed as part of this migration.