Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: create d3m checklist #41

Merged
merged 11 commits into from
Sep 20, 2024
156 changes: 156 additions & 0 deletions spell/d3m-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# D3M Checklist

- IF new D3M is being onboarded
- [ ] Ensure `ilk` follows the ilk format `DIRECT-XXX-YYY` (where `XXX` is the unique name of the module, such as `SPARK`, `SPARK-AAVE` and `YYY` is the token such as `DAI`, `USDS`)
- Ensure the following contracts are deployed
- `D3MPlan`
- [ ] Optimizer is enabled
- [ ] Optimize runs is set to `200`
- [ ] Deployed contract matches the code in the [repo directory](https://github.com/makerdao/dss-direct-deposit/tree/master/src/plans)
- Constructor params:
- [ ] IF params exist, they match relevant values or addresses found in the Exec Sheet
- `wards` state variable
- [ ] `MCD_PAUSE_PROXY` is relied
- [ ] Deployer is denied
- [ ] No other address has been relied
- `D3MPool`
- [ ] Optimizer is enabled
- [ ] Optimize runs is set to `200`
- [ ] Deployed contract matches the code in the [repo directory](https://github.com/makerdao/dss-direct-deposit/tree/master/src/pools)
- Constructor params:
- [ ] `ilk_` matches `bytes32` representation of ilk name in the Exec Sheet
- [ ] `hub_` matches `DIRECT_HUB` from the chainlog
- [ ] IF `dai` exists, it matches `MCD_DAI` from the chainlog
- [ ] IF `daiJoin` exists, it matches `MCD_JOIN_DAI` from the chainlog
- [ ] IF `usdsJoin` exists, it matches `USDS_JOIN` from the chainlog
- [ ] IF other params exist, they match values or addresses in the Exec sheet
- `wards` state variable
- [ ] `MCD_PAUSE_PROXY` is relied
- [ ] Deployer is denied
- [ ] No other address has been relied
- `D3MOracle`
- [ ] Optimizer is enabled
- [ ] Optimize runs is set to `200`
- [ ] Deployed contract matches the code in the [repo](https://github.com/makerdao/dss-direct-deposit/blob/master/src/D3MOracle.sol)
- Constructor params:
- [ ] `vat_` matches `MCD_VAT`
- [ ] `ilk_` matches `bytes32` representation of ilk name in the Exec Sheet
- `wards` state variable
- [ ] `MCD_PAUSE_PROXY` is relied
- [ ] Deployer is denied
- [ ] No other address has been relied
- IF `D3MPlan` has `operator` state variable
- [ ] `operator` is a known multisig contract
- [ ] Address is present in the Exec Sheet
- IF any other contract is required as part of the new D3M module
- [ ] Deployed contract is verified on etherscan
- [ ] Address is present in the Exec Sheet
- Ensure the following values are initialized
- `D3MPlan`
- [ ] `DIRECT_MOM` is relied
- [ ] IF `operator` exists, it is set to the address in the Exec sheet
- [ ] IF other state variable values are specified in the Exec sheet, they are set correctly
- `D3MPool`
- [ ] `hub` is set to `DIRECT_HUB` from the chainlog
- [ ] `ilk` name matches
SidestreamStrongStrawberry marked this conversation as resolved.
Show resolved Hide resolved
- [ ] `vat` is set to `MCD_VAT` from the chainlog
SidestreamStrongStrawberry marked this conversation as resolved.
Show resolved Hide resolved
- [ ] IF `king` exists, it is set to `MCD_PAUSE_PROXY` from the chainlog
- [ ] IF other state variable values are specified in the Exec sheet, they are set correctly
- `D3MOracle`
- [ ] `hub` is set to `DIRECT_HUB` from the chainlog
- `DIRECT_HUB`
- `ilk` is added correctly
- [ ] `plan` is set to `D3MPlan` address for the current D3M
- [ ] `pool` is set to `D3MPool` address for the current D3M
- [ ] `tau` is set to the value in the Exec sheet
- [ ] `culled` and `tic` values are not updated
- `MCD_VAT`
- [ ] `ilk` is initialized using [`vat.init(ilk)`](https://github.com/makerdao/dss/blob/fa4f6630afb0624d04a003e920b0d71a00331d98/src/vat.sol#L100-L103)
- [ ] `Line` is updated to `vat.Line() + gap`
SidestreamStrongStrawberry marked this conversation as resolved.
Show resolved Hide resolved
- `MCD_JUG`
- [ ] `ilk` is initialized using [`jug.init(ilk)`](https://github.com/makerdao/dss/blob/fa4f6630afb0624d04a003e920b0d71a00331d98/src/jug.sol#L101-L106)
- `MCD_SPOT`
- [ ] `pip` is set to the current `D3MOracle` address using [`spotter.file(ilk, 'pip', address(D3MOracle))`](https://github.com/makerdao/dss/blob/fa4f6630afb0624d04a003e920b0d71a00331d98/src/spot.sol#L81-L85)
- [ ] `mat` is set to `RAY (10 ** 27)` using [`spotter.file(ilk, 'mat', 10 **27)`](https://github.com/makerdao/dss/blob/fa4f6630afb0624d04a003e920b0d71a00331d98/src/spot.sol#L91-L95)
- [ ] [`spotter.poke(ilk)`](https://github.com/makerdao/dss/blob/fa4f6630afb0624d04a003e920b0d71a00331d98/src/spot.sol#L98-L103) is called after set values above to update `ilk.spot` in `vat`
- `MCD_IAM_AUTO_LINE`
- `ilk` is set using [`setIlk`](https://github.com/makerdao/dss-auto-line/blob/bff7e6cc43dbd7d9a054dd359ef18a1b4d06b6f5/src/DssAutoLine.sol#L81-L86)
- [ ] `ilk` matches `ilk` name
- [ ] `line` matches `maxLine` value in the Exec sheet
- [ ] `gap` matches `gap` value in the Exec sheet
- [ ] `ttl` matches `ttl` value in the Exec sheet
- `ILK_REGISTRY`
- `ilk` is added using [`ilkRegistry.put`](https://github.com/makerdao/ilk-registry/blob/1d65fb6e17c28e9e94ac88f0d8ccad04d8945f3c/src/IlkRegistry.sol#L389-L427)
- [ ] `_ilk` matches `ilk` name
- [ ] `_join` matches `DIRECT_HUB` address from the chainlog
- [ ] `_gem` matches the current D3M `D3MPool.redeemable()` address
- [ ] `_dec` matches the current D3M `D3MPool.redeemable()` tokens decimal
- [ ] `_class` matches `4` (`ilk registry class for D3Ms`)
- [ ] `_pip` matches the current D3M `D3MOracle` address
- [ ] `_xlip` matches `address(0)`
- [ ] `_name` matches the current D3M `D3MPool.redeemable()` tokens name
- [ ] `_symbol` matches the current D3M `D3MPool.redeemable()` tokens symbol
- `CHAINLOG`
- `D3MPlan` is added to the chainlog
- [ ] Correct address is added
- [ ] Name follows pattern `ILK_PREFIX_PLAN` (`ILK_PREFIX` matches [`ScriptTools.ilkToChainlogFormat(ilk)`](https://github.com/makerdao/dss-test/blob/36ff4adbcb35760614e0d2df864026991c23d028/src/ScriptTools.sol#L226-L239) return value)
- `D3MPool` is added to the chainlog
- [ ] Correct address is added
- [ ] Name follows pattern `ILK_PREFIX_POOL` (`ILK_PREFIX` matches [`ScriptTools.ilkToChainlogFormat(ilk)`](https://github.com/makerdao/dss-test/blob/36ff4adbcb35760614e0d2df864026991c23d028/src/ScriptTools.sol#L226-L239) return value)
- `D3MOracle` is added to the chainlog
- [ ] Correct address is added
- [ ] Name follows pattern `ILK_PREFIX_ORACLE` (`ILK_PREFIX` matches [`ScriptTools.ilkToChainlogFormat(ilk)`](https://github.com/makerdao/dss-test/blob/36ff4adbcb35760614e0d2df864026991c23d028/src/ScriptTools.sol#L226-L239) return value)
- [ ] `Chainlog` version is bumped
- Ensure the following functionality is covered with tests
- `D3MPlan`
- [ ] IF `operator` exists, it matches the address in the Exec sheet
- [ ] IF other state variable values are specified in the Exec sheet, they are set correctly
- E2E test
- [ ] Ensure `targetAssets` can be updated either by `MCD_PAUSE_PROXY` or by the `operator` (if present in `D3MPlan`) through setting `targetRate` or `targetAsset` directly.
- [ ] `getTargetAssets` returns correct amount
- `D3MPool`
- [ ] `hub` matches `DIRECT_HUB` from the chainlog
- [ ] `ilk` matches bytes32 representation of ilk name in the Exec Sheet
- [ ] `vat` matches `MCD_VAT` from the chainlog
- [ ] Contract is activated (i.e. `require(D3MPool.active())`)
- [ ] `redeemable` matches Liquidity pool token address or vault address
- [ ] IF other state variable values are specified in the Exec sheet, they are set correctly
- [ ] `D3MMom` is relied (i.e. `plan.wards(address(mom))`)
- [ ] IF `dai` exists, it matches `MCD_DAI` from the chainlog
- [ ] IF `daiJoin` exists, it matches `MCD_JOIN_DAI` from the chainlog
- [ ] IF `usds` exists, it matches `USDS` from the chainlog
- [ ] IF `usdsJoin` exists, it matches `USDS_JOIN` from the chainlog
- [ ] IF Liquidity pool token exists, it matches the address in the Exec sheet
- [ ] IF `vault` exists, it matches the address in the Exec sheet
- [ ] IF `king` exists, it matches `MCD_PAUSE_PROXY` from the chainlog
- `D3MHub`
- [ ] `ilk.pool` matches the address in the Exec sheet
- [ ] `ilk.plan` matches the address in the Exec sheet
- [ ] `ilk.tau` matches the value in the Exec sheet
- [ ] `ilk.culled` is 0
- [ ] `vow` matches `MCD_VOW` from the chainlog
- [ ] `end` matches `MCD_END` from the chainlog
- E2E test
- [ ] `hub.exec(ilk)` updates debt correctly
- `D3MOracle`
- [ ] `hub` matches `DIRECT_HUB` from the chainlog
- `D3MMom`
- [ ] `authority` matches `MCD_ADM` from the chainlog
- E2E test
- [ ] `mom.disable(D3MPlan)` deactivate the plan contract
- [ ] Executing `hub.exec(ilk)` after disabling plan, update both `ink`, `art` to a value `< 1 * WAD`
- `MCD_SPOT`:
- [ ] `spotter(D3M_ILK).mat` is set to 100% (`1 * RAY`) (:information_source: covered in `config.sol`)
- [ ] `spotter(D3M_ILK).pip` is set to `D3MOracle` address
- `ILK_REGISTRY`
- [ ] New ilk is added to the registry
- [ ] `join` matches `DIRECT_HUB` address from the chainlog
- [ ] `gem` matches the current D3M `D3MPool.redeemable()` address
- [ ] `dec` matches the current D3M `D3MPool.redeemable()` tokens decimal
- [ ] `class` matches `4` (`ilk registry class for D3Ms`)
- [ ] `pip` matches the current D3M `D3MOracle` address
- [ ] `xlip` matches `address(0)`
- [ ] `name` matches the current D3M `D3MPool.redeemable()` tokens name
- [ ] `symbol` matches the current D3M `D3MPool.redeemable()` tokens symbol
- `MCD_VAT`
- [ ] `DIRECT_HUB` is relied (i.e. `vat.wards(address(hub))`)
SidestreamStrongStrawberry marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions spell/spell-reviewer-mainnet-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
* IF PSM migration, onboarding or offboarding is present:
* [ ] Insert and follow the relevant checklists below:
* [PSM Checklists](./psm-checklists.md)
* [ ] IF D3M onboarding is present, insert and follow [D3M Checklist](./d3m-checklist.md)
* IF collateral offboarding is present in the spell
* 1st stage collateral offboarding
* [ ] Collateral type (`ilk`) is removed from AutoLine (`MCD_IAM_AUTO_LINE`) IF currently enabled
Expand Down
Loading