From 18ea200e172cc06905f84cb0f049e08e4cad117f Mon Sep 17 00:00:00 2001 From: amusingaxl <112016538+amusingaxl@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:01:27 -0300 Subject: [PATCH 1/4] refactor: add RWA Offboarding checkilst + restructuring --- spell/rwa-checklists.md | 189 ++++++++++++++++++++++ spell/rwa-onboarding-checklist.md | 137 ---------------- spell/spell-reviewer-mainnet-checklist.md | 41 +---- 3 files changed, 196 insertions(+), 171 deletions(-) create mode 100644 spell/rwa-checklists.md delete mode 100644 spell/rwa-onboarding-checklist.md diff --git a/spell/rwa-checklists.md b/spell/rwa-checklists.md new file mode 100644 index 0000000..0dda0bb --- /dev/null +++ b/spell/rwa-checklists.md @@ -0,0 +1,189 @@ +# RWA Checklists + +## RWA Onboarding Checklist + +* [ ] Deployed Contracts + * [ ] `RwaToken` (Token Used as Collateral In Adapter) + * [ ] deployed via [`RwaTokenFactory`](https://github.com/makerdao/rwa-toolkit/blob/master/src/tokens/RwaTokenFactory.sol) + * [ ] Fab matches [chainlog](https://chainlog.makerdao.com/) + * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/blob/92c79aac24ef7645902ce4be57ba41b19e6c7dd5/src/tokens/RwaToken.sol) and it's consistent with previous RWA onboarding + * [ ] Rwa Token transferred to MCD Pause Proxy + * [ ] `createRwaToken` parameters are correct + * [ ] `name` is in `RWA-XYZ` format + * [ ] `symbol` is in `RWAXYZ` format + * [ ] `recipient` matches MCD Pause Proxy + * [ ] `AuthGemJoin` (Join Adapter) + * [ ] deployed via [JoinFab](https://github.com/makerdao/JoinFab/blob/master/src/JoinFab.sol) + * [ ] Fab matches [chainlog](https://chainlog.makerdao.com/) + * [ ] ensure source matches [GitHub code](https://github.com/makerdao/dss-gem-joins/blob/8ca0a7fdd5edc6ed3da68c3ffdfadfb9540c83f7/src/join-auth.sol) and it's consistent with previous RWA onboarding (NOTE: Etherscan may have a bug where it displays additional code for `AuthGemJoin`. In this case, using `cast interface` or otherwise, ensure that this code cannot be executed) + * [ ] `newAuthGemJoin` parameters are correct + * [ ] `owner` matches `PAUSE_PROXY` + * [ ] `ilk` is the `bytes32` representation of "RWAXYZ-A" + * [ ] `cast --to-ascii ` matches ASCII Ilk + * [ ] `cast --to-bytes32 $(cast --from-ascii "RWAXYZ-A")` matches `bytes32` (to check the amount of padding zeroes is correct) + * [ ] `gem` matches `RwaToken` deployed contract + * [ ] check `wards` + * [ ] `MCD_PAUSE_PROXY` is relied + * [ ] deployer is denied + * [ ] no other address has been relied + * [ ] `RwaUrn`/`RwaUrn2` + * [ ] contract is verified on etherscan + * [ ] ensure `0.6.12` solc version is used + * [ ] ensure optimizations are off + * [ ] ensure license is specified (SPDX in code or otherwise) + * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/tree/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/urns) and it's consistent with previous RWA onboardings + * [ ] constructor args are correct and match [Chainlog](https://chainlog.makerdao.com/) + * [ ] `vat` matches `MCD_VAT` + * [ ] `jug` matches `MCD_JUG` + * [ ] `gemJoin` matches `MCD_JOIN_RWAXYZ_A` (Per spell code) + * [ ] `daiJoin` matches `MCD_JOIN_DAI` + * [ ] `outputConduit` matches `RwaOutputConduit<2,3>` (Per spell code) + * [ ] check `wards` + * [ ] `MCD_PAUSE_PROXY` is relied + * [ ] deployer is denied + * [ ] no other address has been relied + * [ ] `RwaJar` + * [ ] contract is verified on etherscan + * [ ] ensure `0.6.12` solc version is used + * [ ] ensure optimization are off + * [ ] ensure license is specified (SPDX in code or otherwise) + * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/blob/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/jars/RwaJar.sol) and it's consistent with previous RWA onboarding + * [ ] constructor arg matches [`ChainLog`](https://chainlog.makerdao.com/) + * [ ] `chainlog` + * [ ] no `wards` + * [ ] `RwaInputConduit<2>`/`RwaSwapInputConduit<2>` + * [ ] contract is verified on etherscan + * [ ] ensure `0.6.12` solc version is used + * [ ] ensure optimization are off + * [ ] ensure license is specified (SPDX in code or otherwise) + * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/tree/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/conduits) and it's consistent with previous RWA onboarding + * [ ] constructor args are correct and match [chainlog](https://chainlog.makerdao.com/) + * [ ] `dai` + * [ ] `to` (`RwaUrn`, `RwaJar`) + * [ ] `gov` (`v1`) + * [ ] `psm`, `gem` (`v3`) + * [ ] check `wards` + * [ ] `MCD_PAUSE_PROXY` is relied + * [ ] deployer is denied + * [ ] no other address has been relied + * [ ] `RwaOutputConduit<2>`/`RwaSwapOutputConduit` + * [ ] contract is verified on etherscan + * [ ] ensure `0.6.12` solc version is used + * [ ] ensure optimization are off + * [ ] ensure license is specified (SPDX in code or otherwise) + * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/tree/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/conduits) and it's consistent with previous RWA onboarding + * [ ] constructor args are correct and match [chainlog](https://chainlog.makerdao.com/) + * [ ] `dai` + * [ ] `gov` (`v1`) + * [ ] `psm`, `gem` (`v3`) + * [ ] check `wards` + * [ ] `MCD_PAUSE_PROXY` is relied + * [ ] deployer is denied + * [ ] no other address has been relied + * [ ] Risk Parameters Match Doc + * [ ] `duty`(stability fee) + * [ ] `line`(debt ceiling) + * [ ] `mat` (liquidation ratio) + * [ ] `val` (oracle price) + * [ ] `tau` (pre-agreed remediation period) + * [ ] `doc` (IPFS Hash) + * [ ] Onboarding Actions + * [ ] `ilk` matches the format `RWAXYZ-A` + * [ ] Sanity Checks (constructor args, public vars, ... via `require` condition) + * [ ] `oracle.init` + * [ ] `vat.init.ilk` + * [ ] `jug.init.ilk` (this will set `duty` to `RAY` (zero pct) by default) + * [ ] `vat` rely `join` + * [ ] Increase Ilk Debt Ceiling (set DC + increase Global DC) + * [ ] File Ilk `pip` in the `spotter` + * [ ] File Ilk `mat` in the `spotter` + * [ ] Poke `spotter` to pull in the price + * [ ] `join` rely `urn` + * [ ] Access Control + * [ ] `hope` (operator, pause proxy) + * [ ] `mate` (operator, pause proxy as fallback if required) + * [ ] `kiss` (whitelist for `urn` destination address `who`) + * [ ] Filable (`RwaSwapOutputConduit` and `RwaSwapInputConduit`) + * [ ] `quitTo` (`file` the appropriate address for conduits per technical assessment) + * [ ] New Chainlog Entries + * [ ] `RWAXYZ` + * [ ] `PIP_RWAXYZ` precomputed via `cast compute-address $MIP21_LIQUIDATION_ORACLE` + * [ ] Note that a nonce change for `MIP21_LIQUIDATION_ORACLE` prior to casting will cause this to be incorrect + * [ ] `MCD_JOIN_RWAXYZ_A` + * [ ] `RWAXYZ_A_URN` + * [ ] `RWAXYZ_A_JAR` + * [ ] `RWAXYZ_A_INPUT_CONDUIT` + * [ ] `RWAXYZ_A_OUTPUT_CONDUIT` + * [ ] Chainlog Bump + * [ ] Patch `x.x.1` + * [ ] Add Ilk to `IlkRegistry` + * [ ] `put` is used + * [ ] `class` is 3 + * [ ] `name` matches forum post (e.g. "RWA007-A: Monetalis Clydesdale") + * [ ] Ensure `DssExecLib` is used for the Onboarding (e.g. `DssExecLib.vat`) + * [ ] Test Coverage (Follow Previous Test Patterns) + * [ ] `testNewChainlogValues` + * [ ] `testNewIlkRegistryValues` + * [ ] `testRWAXYZ_INTEGRATION_CONDUITS_SETUP` + * [ ] `testRWAXYZ_INTEGRATION_BUMP` + * [ ] `testRWAXYZ_INTEGRATION_TELL` + * [ ] `testRWAXYZ_INTEGRATION_TELL_CURE_GOOD` + * [ ] `testFailRWAXYZ_INTEGRATION_CURE_BEFORE_TELL` + * [ ] `testRWAXYZ_INTEGRATION_TELL_CULL` + * [ ] `testRWAXYZ_PAUSE_PROXY_OWNS_RWAXYZ_TOKEN_BEFORE_SPELL` + * [ ] `testRWAXYZ_SPELL_LOCK_OPERATOR_DRAW_WIPE_FREE` + * [ ] `testFailRWAXYZ_DRAW_ABOVE_LINE` + * [ ] `testFailRWAXYZ_OUTPUT_CONDUIT_PUSH_ABOVE_BALANCE` + * [ ] `testRWAXYZ_OPERATOR_LOCK_DRAW_CAGE` + * [ ] `testRWAXYZ_SPELL_LOCK` + * [ ] `addresses_.sol` + * [ ] `config.sol` + +## RWA Update Checklist + +* IF `doc` is updated + * [ ] [`_updateDoc` helper](https://github.com/makerdao/spells-mainnet/blob/7400e91c4f211fc24bd4d3a95a86416afc4df9d1/archive/2023-09-27-DssSpell/DssSpell.sol#L76-L87) is copied one-to-one from the archive and defined above `actions` + * [ ] `_updateDoc(ilk, doc)` is called in the spell +* IF debt ceiling is updated + * IF AutoLine update is requested by the Exec Sheet + * [ ] Parameters are set via [`DssExecLib.setIlkAutoLineParameters(ilk, amount, gap, ttl)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L648) or [`DssExecLib.setIlkAutoLineDebtCeiling(ilk, amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L658) + * IF regular debt ceiling (`vat.ilk.line`) update is requested by the Exec Sheet + * [ ] Collateral type (`ilk`) have [`AutoLine`](https://github.com/makerdao/dss-auto-line/tree/master) disabled previously or in the spell + * [ ] Debt ceiling (`vat.ilk.line`) is updated, via EITHER: + * [`DssExecLib.increaseIlkDebtCeiling(ilk, amount, global)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L621C14-L621C36) + * [`DssExecLib.decreaseIlkDebtCeiling(ilk, amount, global)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L634) + * [`DssExecLib.setIlkDebtCeiling(ilk, amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L611) + * [ ] Global debt ceiling (`vat.Line`) is updated accordingly, UNLESS specifically instructed not to, via EITHER: + * `global` set to `true` in `increaseIlkDebtCeiling`/`decreaseIlkDebtCeiling` + * [`DssExecLib.setGlobalDebtCeiling(amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L428) + * [`DssExecLib.increaseGlobalDebtCeiling(amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L436) + * [`DssExecLib.decreaseGlobalDebtCeiling(amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L445C14-L445C39) + * [ ] Liquidation oracle price is bumped via `RwaLiquidationOracleLike(MIP21_LIQUIDATION_ORACLE).bump(ilk, val)` pattern + * [ ] Comment above `bump` explains `val` computation via `// Note: the formula is: "debt_ceiling * [ (1 + rwa_stability_fee ) ^ (minimum_deal_duration_in_years) ] * liquidation_ratio"` + * [ ] Comment above `bump` provides locally executable formula (e.g. `// bc -l <<< 'scale=18; 50000000 * e(l(1.07) * (3342/365)) * 1.00' | cast --to-wei`) + * [ ] The formula matches the example provided above + * [ ] `debt_ceiling` in the executable formula matches new debt ceiling set in the spell or the maximum possible debt ceiling in case of the enabled AutoLine + * [ ] `rwa_stability_fee` in the executable formula matches stability fee of the specified RWA found on chain + * [ ] `minimum_deal_duration_in_years` in the executable formula matches number found in the Exec Sheet of the spell containing relevant RWA onboarding + * [ ] `liquidation_ratio` in the executable formula matches liquidation ratio of the specified RWA found on chain + * [ ] Executing formula locally provides integer number that matches the `val` in the spell + * [ ] `val` makes sense in context of the [rate mechanism](https://github.com/makerdao/developerguides/blob/master/mcd/intro-rate-mechanism/intro-rate-mechanism.md) + * [ ] IF multiple RWA ilks are being combined into one, `val` calculation is done once per ilk and added to make the total, with separate executable formulas provided in comments. The existing `val` value can be retrieved by calling `read()` on `PIP_RWAXYZ` and converting the result into decimal + * [ ] Oracle price is updated via `DssExecLib.updateCollateralPrice(ilk)` + * IF soft liquidation explicitly requested to be triggered (via `.tell(ilk)`) AND debt ceiling (`vat.ilks(ilk).line`) is `0` (OR is being set to `0` in the current spell) + * [ ] `RwaLiquidationOracle.tell(ilk)` call is present + * [ ] IF `RWAXYZ_A_INPUT_CONDUIT` is an instance of [`TinlakeMgr`](https://github.com/centrifuge/tinlake-maker-lib/blob/master/src/mgr.sol) (it is a Centrifuge integration), additional `TinlakeMgr.tell()` call is present (in order to prevent further `TIN` redemptions in the Centrifuge pool) + +## RWA Offboarding Checklist + +* IF there is debt in the RWA Vault (`vat.urns(ilk, RWAXYZ_A_URN).art > 0`), proceed with the write-off (i.e.: vault is in default): + * IF soft liquidation `.tell(ilk)` has **NOT** been called for the ilk in a previous spell: + * [ ] The value of `RwaLiquidationOracle.ilks(ilk).tau` MUST be zero, OTHERWISE the offboarding can only happen in a future spell. + * [ ] The debt ceiling (`vat.ilks(ilk).line`) is `0` OR is currently being set to `0`. + * [ ] `RwaLiquidationOracle.tell(ilk)` call is present + * [ ] IF `RWAXYZ_A_INPUT_CONDUIT` is an instance of [`TinlakeMgr`](https://github.com/centrifuge/tinlake-maker-lib/blob/master/src/mgr.sol) (it is a Centrifuge integration), additional `TinlakeMgr.tell()` call is present (in order to prevent further `TIN` redemptions in the Centrifuge pool) + * [ ] IF the stability fee for the ilk is not zero (`jug.ilks(ilk).duty > 1 * RAY`), `jug.drip(ilk)` call is present + * [ ] `RwaLiquidationOracle.cull(ilk, RWAXYZ_A_URN)` call is present +* OTHERWISE IF there is no more debt remaining in the vault (`vat.urns(ilk, RWAXYZ_A_URN).art == 0`): + * [ ] The debt ceiling (`vat.ilks(ilk).line`) is currently being set to `0`. + diff --git a/spell/rwa-onboarding-checklist.md b/spell/rwa-onboarding-checklist.md deleted file mode 100644 index f538571..0000000 --- a/spell/rwa-onboarding-checklist.md +++ /dev/null @@ -1,137 +0,0 @@ -# RWA Onboarding Checklist - * [ ] Deployed Contracts - * [ ] `RwaToken` (Token Used as Collateral In Adapter) - * [ ] deployed via [`RwaTokenFactory`](https://github.com/makerdao/rwa-toolkit/blob/master/src/tokens/RwaTokenFactory.sol) - * [ ] Fab matches [chainlog](https://chainlog.makerdao.com/) - * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/blob/92c79aac24ef7645902ce4be57ba41b19e6c7dd5/src/tokens/RwaToken.sol) and it's consistent with previous RWA onboarding - * [ ] Rwa Token transferred to MCD Pause Proxy - * [ ] `createRwaToken` parameters are correct - * [ ] `name` is in `RWA-XXX` format - * [ ] `symbol` is in `RWAXXX` format - * [ ] `recipient` matches MCD Pause Proxy - * [ ] `AuthGemJoin` (Join Adapter) - * [ ] deployed via [JoinFab](https://github.com/makerdao/JoinFab/blob/master/src/JoinFab.sol) - * [ ] Fab matches [chainlog](https://chainlog.makerdao.com/) - * [ ] ensure source matches [GitHub code](https://github.com/makerdao/dss-gem-joins/blob/8ca0a7fdd5edc6ed3da68c3ffdfadfb9540c83f7/src/join-auth.sol) and it's consistent with previous RWA onboarding (NOTE: Etherscan may have a bug where it displays additional code for `AuthGemJoin`. In this case, using `cast interface` or otherwise, ensure that this code cannot be executed) - * [ ] `newAuthGemJoin` parameters are correct - * [ ] `owner` matches `PAUSE_PROXY` - * [ ] `ilk` is the `bytes32` representation of "RWAXXX-A" - * [ ] `cast --to-ascii ` matches ASCII Ilk - * [ ] `cast --to-bytes32 $(cast --from-ascii "RWAXXX-A")` matches `bytes32` (to check the amount of padding zeroes is correct) - * [ ] `gem` matches `RwaToken` deployed contract - * [ ] check `wards` - * [ ] `MCD_PAUSE_PROXY` is relied - * [ ] deployer is denied - * [ ] no other address has been relied - * [ ] `RwaUrn`/`RwaUrn2` - * [ ] contract is verified on etherscan - * [ ] ensure `0.6.12` solc version is used - * [ ] ensure optimizations are off - * [ ] ensure license is specified (SPDX in code or otherwise) - * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/tree/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/urns) and it's consistent with previous RWA onboardings - * [ ] constructor args are correct and match [Chainlog](https://chainlog.makerdao.com/) - * [ ] `vat` matches `MCD_VAT` - * [ ] `jug` matches `MCD_JUG` - * [ ] `gemJoin` matches `MCD_JOIN_RWAXXX_A` (Per spell code) - * [ ] `daiJoin` matches `MCD_JOIN_DAI` - * [ ] `outputConduit` matches `RwaOutputConduit<2,3>` (Per spell code) - * [ ] check `wards` - * [ ] `MCD_PAUSE_PROXY` is relied - * [ ] deployer is denied - * [ ] no other address has been relied - * [ ] `RwaJar` - * [ ] contract is verified on etherscan - * [ ] ensure `0.6.12` solc version is used - * [ ] ensure optimization are off - * [ ] ensure license is specified (SPDX in code or otherwise) - * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/blob/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/jars/RwaJar.sol) and it's consistent with previous RWA onboarding - * [ ] constructor arg matches [`ChainLog`](https://chainlog.makerdao.com/) - * [ ] `chainlog` - * [ ] no `wards` - * [ ] `RwaInputConduit<2>`/`RwaSwapInputConduit<2>` - * [ ] contract is verified on etherscan - * [ ] ensure `0.6.12` solc version is used - * [ ] ensure optimization are off - * [ ] ensure license is specified (SPDX in code or otherwise) - * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/tree/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/conduits) and it's consistent with previous RWA onboarding - * [ ] constructor args are correct and match [chainlog](https://chainlog.makerdao.com/) - * [ ] `dai` - * [ ] `to` (`RwaUrn`, `RwaJar`) - * [ ] `gov` (`v1`) - * [ ] `psm`, `gem` (`v3`) - * [ ] check `wards` - * [ ] `MCD_PAUSE_PROXY` is relied - * [ ] deployer is denied - * [ ] no other address has been relied - * [ ] `RwaOutputConduit<2>`/`RwaSwapOutputConduit` - * [ ] contract is verified on etherscan - * [ ] ensure `0.6.12` solc version is used - * [ ] ensure optimization are off - * [ ] ensure license is specified (SPDX in code or otherwise) - * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/tree/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/conduits) and it's consistent with previous RWA onboarding - * [ ] constructor args are correct and match [chainlog](https://chainlog.makerdao.com/) - * [ ] `dai` - * [ ] `gov` (`v1`) - * [ ] `psm`, `gem` (`v3`) - * [ ] check `wards` - * [ ] `MCD_PAUSE_PROXY` is relied - * [ ] deployer is denied - * [ ] no other address has been relied - * [ ] Risk Parameters Match Doc - * [ ] `duty`(stability fee) - * [ ] `line`(debt ceiling) - * [ ] `mat` (liquidation ratio) - * [ ] `val` (oracle price) - * [ ] `tau` (pre-agreed remediation period) - * [ ] `doc` (IPFS Hash) - * [ ] Onboarding Actions - * [ ] `ilk` matches the format `RWAXXX-A` - * [ ] Sanity Checks (constructor args, public vars, ... via `require` condition) - * [ ] `oracle.init` - * [ ] `vat.init.ilk` - * [ ] `jug.init.ilk` (this will set `duty` to `RAY` (zero pct) by default) - * [ ] `vat` rely `join` - * [ ] Increase Ilk Debt Ceiling (set DC + increase Global DC) - * [ ] File Ilk `pip` in the `spotter` - * [ ] File Ilk `mat` in the `spotter` - * [ ] Poke `spotter` to pull in the price - * [ ] `join` rely `urn` - * [ ] Access Control - * [ ] `hope` (operator, pause proxy) - * [ ] `mate` (operator, pause proxy as fallback if required) - * [ ] `kiss` (whitelist for `urn` destination address `who`) - * [ ] Filable (`RwaSwapOutputConduit` and `RwaSwapInputConduit`) - * [ ] `quitTo` (`file` the appropriate address for conduits per technical assessment) - * [ ] New Chainlog Entries - * [ ] `RWAXXX` - * [ ] `PIP_RWAXXX` precomputed via `cast compute-address $MIP21_LIQUIDATION_ORACLE` - * [ ] Note that a nonce change for `MIP21_LIQUIDATION_ORACLE` prior to casting will cause this to be incorrect - * [ ] `MCD_JOIN_RWAXXX_A` - * [ ] `RWAXXX_A_URN` - * [ ] `RWAXXX_A_JAR` - * [ ] `RWAXXX_A_INPUT_CONDUIT` - * [ ] `RWAXXX_A_OUTPUT_CONDUIT` - * [ ] Chainlog Bump - * [ ] Patch `x.x.1` - * [ ] Add Ilk to `IlkRegistry` - * [ ] `put` is used - * [ ] `class` is 3 - * [ ] `name` matches forum post (e.g. "RWA007-A: Monetalis Clydesdale") - * [ ] Ensure `DssExecLib` is used for the Onboarding (e.g. `DssExecLib.vat`) - * [ ] Test Coverage (Follow Previous Test Patterns) - * [ ] `testNewChainlogValues` - * [ ] `testNewIlkRegistryValues` - * [ ] `testRWAXXX_INTEGRATION_CONDUITS_SETUP` - * [ ] `testRWAXXX_INTEGRATION_BUMP` - * [ ] `testRWAXXX_INTEGRATION_TELL` - * [ ] `testRWAXXX_INTEGRATION_TELL_CURE_GOOD` - * [ ] `testFailRWAXXX_INTEGRATION_CURE_BEFORE_TELL` - * [ ] `testRWAXXX_INTEGRATION_TELL_CULL` - * [ ] `testRWAXXX_PAUSE_PROXY_OWNS_RWAXXX_TOKEN_BEFORE_SPELL` - * [ ] `testRWAXXX_SPELL_LOCK_OPERATOR_DRAW_WIPE_FREE` - * [ ] `testFailRWAXXX_DRAW_ABOVE_LINE` - * [ ] `testFailRWAXXX_OUTPUT_CONDUIT_PUSH_ABOVE_BALANCE` - * [ ] `testRWAXXX_OPERATOR_LOCK_DRAW_CAGE` - * [ ] `testRWAXXX_SPELL_LOCK` - * [ ] `addresses_.sol` - * [ ] `config.sol` diff --git a/spell/spell-reviewer-mainnet-checklist.md b/spell/spell-reviewer-mainnet-checklist.md index 3b2a52b..24914b9 100644 --- a/spell/spell-reviewer-mainnet-checklist.md +++ b/spell/spell-reviewer-mainnet-checklist.md @@ -142,13 +142,13 @@ * IF onboarding is present * [ ] Insert and follow the relevant checklists below: * [Collateral Onboarding](./collateral-onboarding-checklist.md) - * [RWA Onboarding](./rwa-onboarding-checklist.md) + * [RWA Onboarding](./rwa-checklists.md#rwa-onboarding-checklist) * [Teleport Onboarding](./teleport-onboarding-checklist.md) * 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 +* IF crypto 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 * [ ] Collateral debt ceiling (`vat.ilk.line`) is set to `0` @@ -178,38 +178,11 @@ * [ ] Spotter price is updated after all other actions * [ ] Offboarding is tested at least via [`_checkIlkClipper` helper](https://github.com/makerdao/spells-mainnet/blob/7400e91c4f211fc24bd4d3a95a86416afc4df9d1/src/DssSpell.t.base.sol#L856) * IF RWA updates are present - * IF `doc` is updated - * [ ] [`_updateDoc` helper](https://github.com/makerdao/spells-mainnet/blob/7400e91c4f211fc24bd4d3a95a86416afc4df9d1/archive/2023-09-27-DssSpell/DssSpell.sol#L76-L87) is copied one-to-one from the archive and defined above `actions` - * [ ] `_updateDoc(ilk, doc)` is called in the spell - * IF debt ceiling is updated - * IF AutoLine update is requested by the Exec Sheet - * [ ] Parameters are set via [`DssExecLib.setIlkAutoLineParameters(ilk, amount, gap, ttl)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L648) or [`DssExecLib.setIlkAutoLineDebtCeiling(ilk, amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L658) - * IF regular debt ceiling (`vat.ilk.line`) update is requested by the Exec Sheet - * [ ] Collateral type (`ilk`) have [`AutoLine`](https://github.com/makerdao/dss-auto-line/tree/master) disabled previously or in the spell - * [ ] Debt ceiling (`vat.ilk.line`) is updated, via EITHER: - * [`DssExecLib.increaseIlkDebtCeiling(ilk, amount, global)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L621C14-L621C36) - * [`DssExecLib.decreaseIlkDebtCeiling(ilk, amount, global)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L634) - * [`DssExecLib.setIlkDebtCeiling(ilk, amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L611) - * [ ] Global debt ceiling (`vat.Line`) is updated accordingly, UNLESS specifically instructed not to, via EITHER: - * `global` set to `true` in `increaseIlkDebtCeiling`/`decreaseIlkDebtCeiling` - * [`DssExecLib.setGlobalDebtCeiling(amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L428) - * [`DssExecLib.increaseGlobalDebtCeiling(amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L436) - * [`DssExecLib.decreaseGlobalDebtCeiling(amount)`](https://github.com/makerdao/dss-exec-lib/blob/v0.0.9/src/DssExecLib.sol#L445C14-L445C39) - * [ ] Liquidation oracle price is bumped via `RwaLiquidationOracleLike(MIP21_LIQUIDATION_ORACLE).bump(ilk, val)` pattern - * [ ] Comment above `bump` explains `val` computation via `// Note: the formula is: "debt_ceiling * [ (1 + rwa_stability_fee ) ^ (minimum_deal_duration_in_years) ] * liquidation_ratio"` - * [ ] Comment above `bump` provides locally executable formula (e.g. `// bc -l <<< 'scale=18; 50000000 * e(l(1.07) * (3342/365)) * 1.00' | cast --to-wei`) - * [ ] The formula matches the example provided above - * [ ] `debt_ceiling` in the executable formula matches new debt ceiling set in the spell or the maximum possible debt ceiling in case of the enabled AutoLine - * [ ] `rwa_stability_fee` in the executable formula matches stability fee of the specified RWA found on chain - * [ ] `minimum_deal_duration_in_years` in the executable formula matches number found in the Exec Sheet of the spell containing relevant RWA onboarding - * [ ] `liquidation_ratio` in the executable formula matches liquidation ratio of the specified RWA found on chain - * [ ] Executing formula locally provides integer number that matches the `val` in the spell - * [ ] `val` makes sense in context of the [rate mechanism](https://github.com/makerdao/developerguides/blob/master/mcd/intro-rate-mechanism/intro-rate-mechanism.md) - * [ ] IF multiple RWA ilks are being combined into one, `val` calculation is done once per ilk and added to make the total, with separate executable formulas provided in comments. The existing `val` value can be retrieved by calling `read()` on `PIP_RWAXX` and converting the result into decimal - * [ ] Oracle price is updated via `DssExecLib.updateCollateralPrice(ilk)` - * IF soft liquidation explicitly requested to be triggered (via `.tell(ilk)`) AND debt ceiling is `0` (OR is being set to `0` in the current spell) - * [ ] `RwaLiquidationOracle.tell(ilk)` call is present - * [ ] IF `RWAXX_A_INPUT_CONDUIT` is an instance of [`TinlakeMgr`](https://github.com/centrifuge/tinlake-maker-lib/blob/master/src/mgr.sol) (it is a Centrifuge integration), additional `TinlakeMgr.tell()` call is present (in order to prevent further `TIN` redemptions in the Centrifuge pool) + * [ ] Insert and follow the relevant checklists below: + * [RWA Update](./rwa-checklists.md#rwa-update-checklist) +* IF RWA offboardings are present + * [ ] Insert and follow the relevant checklists below: + * [RWA Offboarding](./rwa-checklists.md#rwa-offboarding-checklist) * IF payments are present in the spell * IF `MKR` transfers are present * [ ] Recipient address in the instruction is in the checksummed format From 1069a8ac98c6a450b95addabc31faf94cde3a2f8 Mon Sep 17 00:00:00 2001 From: amusingaxl <112016538+amusingaxl@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:55:45 -0300 Subject: [PATCH 2/4] chore: add exception to wordslist --- .wordlist.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.wordlist.txt b/.wordlist.txt index 40f45c3..926b3ff 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -23,6 +23,7 @@ configs Crafter cron CUs +crypto DAI Daiwanese DAO @@ -109,6 +110,7 @@ repos RPC RWA RWAXXX +RWAXYZ setIlkAutoLineDebtCeiling setIlkAutoLineParameters setIlkDebtCeiling From 4c1dd490af57472c7221db3b2d6d271619e73907 Mon Sep 17 00:00:00 2001 From: amusingaxl <112016538+amusingaxl@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:21:16 +0200 Subject: [PATCH 3/4] chore: apply suggestions from code review Co-authored-by: oddaf <106770775+oddaf@users.noreply.github.com> --- spell/rwa-checklists.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spell/rwa-checklists.md b/spell/rwa-checklists.md index 0dda0bb..6fd0bab 100644 --- a/spell/rwa-checklists.md +++ b/spell/rwa-checklists.md @@ -45,7 +45,7 @@ * [ ] `RwaJar` * [ ] contract is verified on etherscan * [ ] ensure `0.6.12` solc version is used - * [ ] ensure optimization are off + * [ ] ensure optimizations are off * [ ] ensure license is specified (SPDX in code or otherwise) * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/blob/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/jars/RwaJar.sol) and it's consistent with previous RWA onboarding * [ ] constructor arg matches [`ChainLog`](https://chainlog.makerdao.com/) @@ -54,7 +54,7 @@ * [ ] `RwaInputConduit<2>`/`RwaSwapInputConduit<2>` * [ ] contract is verified on etherscan * [ ] ensure `0.6.12` solc version is used - * [ ] ensure optimization are off + * [ ] ensure optimizations are off * [ ] ensure license is specified (SPDX in code or otherwise) * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/tree/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/conduits) and it's consistent with previous RWA onboarding * [ ] constructor args are correct and match [chainlog](https://chainlog.makerdao.com/) @@ -69,7 +69,7 @@ * [ ] `RwaOutputConduit<2>`/`RwaSwapOutputConduit` * [ ] contract is verified on etherscan * [ ] ensure `0.6.12` solc version is used - * [ ] ensure optimization are off + * [ ] ensure optimizations are off * [ ] ensure license is specified (SPDX in code or otherwise) * [ ] ensure source matches [GitHub code](https://github.com/makerdao/rwa-toolkit/tree/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/conduits) and it's consistent with previous RWA onboarding * [ ] constructor args are correct and match [chainlog](https://chainlog.makerdao.com/) @@ -103,7 +103,7 @@ * [ ] `hope` (operator, pause proxy) * [ ] `mate` (operator, pause proxy as fallback if required) * [ ] `kiss` (whitelist for `urn` destination address `who`) - * [ ] Filable (`RwaSwapOutputConduit` and `RwaSwapInputConduit`) + * [ ] Fileable (`RwaSwapOutputConduit` and `RwaSwapInputConduit`) * [ ] `quitTo` (`file` the appropriate address for conduits per technical assessment) * [ ] New Chainlog Entries * [ ] `RWAXYZ` From be5844185aa4c0aeb62ef409f381f648ebf87827 Mon Sep 17 00:00:00 2001 From: amusingaxl <112016538+amusingaxl@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:33:00 -0300 Subject: [PATCH 4/4] feat: add check for oracle price calculation when onboarding a new RWA vault --- spell/rwa-checklists.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spell/rwa-checklists.md b/spell/rwa-checklists.md index 6fd0bab..81cc72d 100644 --- a/spell/rwa-checklists.md +++ b/spell/rwa-checklists.md @@ -85,12 +85,14 @@ * [ ] `line`(debt ceiling) * [ ] `mat` (liquidation ratio) * [ ] `val` (oracle price) + * [ ] `val` is computed as `"debt_ceiling * [ (1 + rwa_stability_fee ) ^ (minimum_deal_duration_in_years) ] * liquidation_ratio"` + * [ ] `val` matches locally executable formula (e.g. `// bc -l <<< 'scale=18; 50000000 * e(l(1.07) * (3342/365)) * 1.00' | cast --to-wei`) * [ ] `tau` (pre-agreed remediation period) * [ ] `doc` (IPFS Hash) * [ ] Onboarding Actions * [ ] `ilk` matches the format `RWAXYZ-A` * [ ] Sanity Checks (constructor args, public vars, ... via `require` condition) - * [ ] `oracle.init` + * [ ] `MIP21_LIQUIDATION_ORACLE.init` * [ ] `vat.init.ilk` * [ ] `jug.init.ilk` (this will set `duty` to `RAY` (zero pct) by default) * [ ] `vat` rely `join`