December 2023 Deployment & Upgrade Procedure
1. Deploy All New Contracts
The first step is deploying various new contract implementations and initializing some of them. Here's a breakdown of the contracts being deployed:
contract | description |
| The new version of the fixed term loan factory |
| The new version of the fixed term loan implementation. Identical to V501, but needed for factory migration |
| The migrator contract for setting the new factory on deployed versions of the fixed term loan |
| The new version of the globals contract |
| The new version of the pool deployer contract |
| The new version of the pool manager contract |
| The new version of the pool manager contract. Identical to V300 but needed for allowing a migration |
| The initializer for the pool manager contract |
| The migrator contract for setting the new pool permission manager implementation on deployed versions of the pool manager |
| The migrator contract for setting the new queue withdrawal manager implementation on deployed versions of the pool manager |
| The new pool permission manager contract. This will be a non transparent proxy. |
| The new pool permission manager contract implementation. |
| The new pool permission manager Initializer contract. |
| The new implementation of the withdrawal manager cyclical contract |
| The initializer for the withdrawal manager cyclical contract |
| The factory for creating instances of the withdrawal manager queue contract |
| The new implementation of the withdrawal manager queue contract |
| The initializer for the withdrawal manager queue contract |
2. Upgrade Globals
The Globals contract is upgraded to the new implementation (V3) deployed in the previous step. This involves pointing the proxy contract to the new implementation address.
3. Enable Globals Keys
This function sets various permissions and configurations in the Globals contract. It registers new valid instances, enables deployment from specific factories, and sets permission for deploying contracts. Breakdown of values:
Function Name | Parameter 1 | Parameter 2 | Parameter 3 |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In this table, the Function Name
column contains the name of the function being called, the Parameter 1
, Parameter 2
, and Parameter 3
columns contain the parameters being passed to the function.
4. Add Delay to Oracles
This function sets a delay on price oracles for specific assets (WETH, WBTC) in the Globals contract.
Asset | Oracle | Delay |
---|---|---|
|
| |
|
|
5. Setup Factories
This function registers new implementations and default versions in various factories (PoolManager, FixedTermLoan, WithdrawalManager). It also enables upgrade paths for existing contracts to move to new implementations.
Factory | Function | Version | Arguments |
---|---|---|---|
Pool Manager Factory |
| 300 |
|
Pool Manager Factory |
| 301 |
|
Pool Manager Factory |
| 300 |
|
Pool Manager Factory |
| 200 -> 300 |
|
Pool Manager Factory |
| 201 -> 300 |
|
Pool Manager Factory |
| 300 -> 301 |
|
Fixed Term Loan Factory |
| 502 |
|
Fixed Term Loan Factory |
| 501 -> 502 |
|
Fixed Term Loan Factory V2 |
| 502 |
|
Fixed Term Loan Factory V2 |
| 502 |
|
Withdrawal Manager Factory |
| 110 |
|
Withdrawal Manager Factory |
| 110 |
|
Queue Withdrawal Manager Factory |
| 100 |
|
Queue Withdrawal Manager Factory |
| 100 |
|
6. Setup PoolPermissionManager
The newly deployed poolPermissionManager
is configured to match each pool configuration, including allowing all existing lenders.
7. Upgrade Pool Contracts
All the deployed poolManager's
contracts will be upgraded to version 300. The upgrades are performed with security admin privileges, ensuring secure and authorized changes.
8. Upgrade Fixed Term Loans
All the deployed FixedTermLoan's
contracts are upgraded to a new version using security admin privileges.
9. Upgrade to Queue Withdrawal Manager
The cash management pools will have their withdrawal manager migrated to the new WithdrawalManagerQueue
.
10. Deprecate Fixed Term Loan Factory
This is done by setting the default version to 0 to stop new instances being deployed.
11. Deprecate Pool Deployer V2
By setting the flag to false for the factory instances, we prevent new pools from being deployed through Pool Deployer V2.
Function Name | Parameter 1 | Parameter 2 | Parameter 3 |
---|---|---|---|
|
|
|
|
|
|
|
|
Last updated