Closed SidestreamSweatyPumpkin closed 8 months ago
TLDR: ready to deploy after two nits from above are addressed
Spell Actions (Per Exec Doc):
MCD_PSM_GUSD_A_JAR
MCD_PSM_GUSD_A_INPUT_CONDUIT_JAR
MCD_PSM_PAX_A_JAR
MCD_PSM_PAX_A_INPUT_CONDUIT_JAR
Further, <conduit>.rely(MCD_ESM)
will be called on the SwapInputConduit contracts to allow the ESM module to deny
the pause proxy. In the event of a successful governance attack, this prevents funds from being stolen from the SwapInputConduit contracts. block.timestamp + 30 days
)Executive vote - Month DD, YYYY.md
make exec-hash $URL
cast keccak -- "$(curl '$URL' -o - 2>/dev/null)"
Insert your Exec Doc Hash here
0x7bd6e83fdbc0f2eef6beea87f626af067630a8e3a375dca68fb2bf2df19cec62
TARGET_DATE MakerDAO Executive Spell | Hash: EXEC_DOC_HASH)
description
// Hash: cast keccak -- "$(wget 'EXEC_DOC_URL' -q -O - 2>/dev/null)"
foundryup
lib
foldergit submodule update --init --recursive
Insert checked out submodule paths here
Submodule path 'lib/dss-exec-lib': checked out '69b658f35d8618272cd139dfc18c5713caf6b96b'
Submodule path 'lib/dss-test': checked out '4ad127cf53eeaddfb7b8ad56dd4b13e57d6a0067'
dss-exec-lib
dss-exec-lib
is synced as wellgit submodule status
) matches the latest release version or newer (NOTE: dss-exec-lib
as installed locally will use GitHub code more recent than the 0.0.9 release)dss-test
dss-interfaces
dss-test
(Non-critical)forge-std
dss-test
(Non-critical)
⚠️ Doesn't match: forge-std
used by linked dss-test
is at aea0b26
commit, while forge-std
used by linked dss-exec-lib
is at 0aa99eb
commitdss-interfaces
import "dss-interfaces/dss/VatAbstract.sol";
)dss-interfaces
(Where there is a mismatch, use cast interface
as the source of truth)cast interface <contract_address>
to ensure correctnessLike
suffix (e.g. VatLike
), with some exceptionsmake rates pct=<pct>
(e.g. pct=0.75, for 0.75%)X_PT_Y_Z_PCT_RATE
(e.g. ZERO_PT_SEVEN_FIVE_PCT_RATE
for 0.75%)internal
constant
WAD = 10 ** 18
RAY = 10 ** 27
RAD = 10 ** 45
internal
constant
HUNDRED = 10 ** 2
THOUSAND = 10 ** 3
MILLION = 10 ** 6
BILLION = 10 ** 9
internal
constant
MONTH_DD_YYYY
(e.g. MAY_01_2023
for 2023-05-01)23:59:59
for the final day of something, 00:00:00
for the first day of something) in the context of timestamp usageinternal
constant
MCD_PSM_GUSD_A_JAR
GNU AGPLv3
licensevat
, dai
, dog
, ...)
chainlog
is correctMCD_ESM
is already relied / being relied in this spell (as approved by Governance Facilitators) in order to allow de-authing the pause proxy during Emergency Shutdown, via denyProxy
.code --diff etherscan.sol github.sol
)
https://github.com/makerdao/rwa-toolkit/blob/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/jars/RwaJar.soladdresses_deployers.sol
(to keep up to date)
Matches existing 0x45Ea4FADf8Db54DF5a96774167547893e0b4D6A5, // CES from 2022-10-26
MCD_PSM_GUSD_A_INPUT_CONDUIT_JAR
GNU AGPLv3
licensevat
, dai
, dog
, ...)
dai
matches MCD_DAI
gem
matches GUSD
as in the namepsm
matches MCD_PSM_GUSD_A
to
matches MCD_PSM_GUSD_A_JAR
from aboveMCD_ESM
is already relied / being relied in this spell (as approved by Governance Facilitators) in order to allow de-authing the pause proxy during Emergency Shutdown, via denyProxy
.code --diff etherscan.sol github.sol
)
https://github.com/makerdao/rwa-toolkit/blob/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/conduits/RwaSwapInputConduit2.soladdresses_deployers.sol
(to keep up to date)
Matches existing 0x45Ea4FADf8Db54DF5a96774167547893e0b4D6A5, // CES from 2022-10-26
MCD_PSM_PAX_A_JAR
GNU AGPLv3
licensevat
, dai
, dog
, ...)
chainlog
is correctMCD_ESM
is already relied / being relied in this spell (as approved by Governance Facilitators) in order to allow de-authing the pause proxy during Emergency Shutdown, via denyProxy
.code --diff etherscan.sol github.sol
)
https://github.com/makerdao/rwa-toolkit/blob/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/jars/RwaJar.soladdresses_deployers.sol
(to keep up to date)
Matches existing 0xb27B6fa77D7FBf3C1BD34B0f7DA59b39D3DB0f7e, // CES
MCD_PSM_PAX_A_INPUT_CONDUIT_JAR
GNU AGPLv3
licensevat
, dai
, dog
, ...)
dai
matches MCD_DAI
gem
matches PAX
as in the namepsm
matches MCD_PSM_PAX_A
to
matches MCD_PSM_PAX_A_JAR
from aboveMCD_ESM
is already relied / being relied in this spell (as approved by Governance Facilitators) in order to allow de-authing the pause proxy during Emergency Shutdown, via denyProxy
.code --diff etherscan.sol github.sol
)
https://github.com/makerdao/rwa-toolkit/blob/8d30ed2cb657641253d45b57c894613e26b4ae1b/src/conduits/RwaSwapInputConduit2.soladdresses_deployers.sol
(to keep up to date)
Matches existing 0xb27B6fa77D7FBf3C1BD34B0f7DA59b39D3DB0f7e, // CES
jug.ilk.duty
(setIlkStabilityFee)// Increase ILK-A Stability Fee by X.XX% from X.XX% to X.XX%.
pot.dsr
(setDSR
)PCT_RATE
is correctmake rates pct=<pct>
(e.g. pct=0.75, for 0.75%)spotter.ilk.mat
(liquidationRatio)dog.ilk.hole
(setIlkMaxLiquidationAmount)vat.ilk.dust
(setIlkMinVaultAmount)dog.ilk.chop
(liquidationPenalty)clip.buf
(startingPriceFactor)clipperMom.clip.tolerance
(setLiquidationBreakerPriceTolerance)clip.tail
(auctionDuration)clip.cusp
(permittedDrop)clip.chip
(kprPctReward)clip.tip
(kprFlatReward)calc.tau
(setLinearDecrease)calc.cut
calc.step
vat.ilk.line
changes (per ilk)setIlkDebtCeiling
ilk
line
increaseIlkDebtCeiling
ilk
amount
global
decreaseIlkDebtCeiling
ilk
amount
global
vat.Line
changes (Global Line)setGlobalDebtCeiling
amount
increaseGlobalDebtCeiling
amount
decreaseGlobalDebtCeiling
amount
ilk
line
ilk
line
gap
ttl
mat
)0
line
to Reduce in the Global Debt Ceilingline
Cachedchop
to 0
tip
to 0
chip
is required to be adjusted as wellDssExecLib.linearInterpolation
name
Format matches "XXX-A Offboarding"target
matches spotter
ilk
Format matches "XXX-A"what
matches mat
startTime
matches block.timestamp
start
matches Var CURRENT_XXX_A_MAT
end
matches Var TARGET_XXX_A_MAT
(Match Exec Doc & Risk Computations)mat
Covers All Remaining Vaults CR times Risk Multiplier Factorduration
matches Exec Docdoc
(Using the _updateDoc
helper or otherwise)init
the RwaLiquidationOracle
to reset the doc
pip
must be set (not the zero address)ilk
follows format "RWAXXX-A"val
price ignored (0
) if init
has already been calleddoc
new legal document (IPFS HASH) matches Exec Doctau
parameter used is the old tau
valueline
)line
) + Liquidation Oracle Price Bump (val
)ilk
follows format "RWAXXX-A"line
(max debt ceiling)gap
ttl
line
) + Liquidation Oracle Price Bump (val
)bump
RwaLiquidationOracle
with new computed increased price (val
)val
is set accordingly with autoline max debt ceiling (line
)val
should enable DAI to be drawn over the loan period while taking into account the configured ink
amount, interest rate and liquidation ratio (see below)val
is calculated with line * [(1 + duty) ** years] * mat
- rounded up - and makes sense in context of the rate mechanism. Minimum duration is usually in the Exec Doc of the spell with the RWAXXX ilk onboarding.val
formula (Debt ceiling * [ (1 + RWA stability fee ) ^ (minimum deal duration in years) ] * liquidation ratio
) is presentbump
line in format // XXM * 1.XX^X * X.XX as a WAD
corresponding to the val
calculation formula (e.g. // 15M * 1.03^2 * 1.00 as a WAD
) is present along with the calculation formula on the line aboveval
of multiple RWA ilks being combined, val
calculation is done once per ilk and added to make the total, with workings provided in code comments. The existing val
value can be retrieved by calling read()
on PIP_RWAXX
and converting the result into decimal.spotter
to pull in the new pricetell
)RwaLiquidationOracle.tell(ilk)
RWAXX_A_INPUT_CONDUIT
is an instance of TinlakeMgr
(it is a Centrifuge integration)TinlakeMgr.tell()
to prevent further TIN
redemptions in the Centrifuge pool.DssVest
)DssVestLike
interface is correctrestrict
is used for each stream unless otherwise stated in the Exec Docusr
(Vest recipient address) matches Exec Doctot
(Total stream amount) matches Exec Docether
to express decimal (non-integer) values of tot
bgn
(Vest start timestamp) matches Exec Doctau
(Vest total duration) matches Exec Doctau
is expressed as 'bgn
- fin
' (i.e. MONTH_DD_YYYY - MONTH_DD_YYYY
)fin
(Vest end timestamp) matches Exec Doceta
(Vest cliff duration) matches Exec Docclf
), eta
is 0clf
(Cliff end timestamp) matches Exec Docclf <= bgn
, eta
is 0clf > bgn
eta
is expressed as 'clf
- bgn
' (i.e. MONTH_DD_YYYY - MONTH_DD_YYYY
)mgr
(Vest manager address) matches Exec Docmgr
is address(0)
cap
) check (MKR, DAI)tot
divided by tau
) <=
the maximum vest streaming rate (cap
)tot
divided by tau
) >
the maximum vest streaming rate (cap
)cap
value equal to 10% greater than the new maximum vesting ratecap
up with 2 significant figure precision (i.e. 2446 becomes 2500)cap
change is noted in the Exec Doccap
value matches Exec Doctot
(total of new MKR vest amounts)Yank
)MCD_VEST_MKR_TREASURY
for MKR yank
MCD_VEST_DAI
for DAI yank
addresses_wallets.sol
addresses_deployers.sol
as an entryProxyLike(SUBDAO_PROXY).exec(SUBDAO_SPELL, abi.encodeWithSignature("execute()"));
cast
execution. (Also note that low level call gas estimation is not done by our scripts)DelegateCall
context)PAUSE_PROXY
as their admin
(i.e. the party that can upgrade)admin
that is not PAUSE_PROXY
are not authed on any core contracts (Blocking)CREATE2
(e.g. if it looks like a vanity address) do not have selfdestruct
in their codeaddresses_mainnet.sol
matches spell codepublic
/internal
immutable
visibility is only used when fetching addresses from the ChainLog
via DssExecLib.getChangelogAddress
and constant
is used instead for static addresses
address
and wrap with Like
suffix interfaces inline (when making calls) unless archive patterns permit otherwise (Such as MKR
)DssExecLib.vat()
)ChainLog
, the variable name must match the value of the ChainLog key for that address (e.g. MCD_VAT
rather than vat
), except where the archive pattern differs from this pattern (e.g. MKR)DssExecLib.address
file is not being modified by the spell PRmake test
ETH_RPC_URL
is being used from env (i.e. no match
, block
or similar are active in your env)_Insert your passing local tests here_
./scripts/test-dssspell-forge.sh no-match="" match="" block=""
Using DssExecLib at: 0x8De6DDbCd5053d32292AAA0D2105A32d108484a6
[⠃] Compiling...
No files changed, compilation skipped
Running 2 tests for src/test/starknet.t.sol:StarknetTests
[PASS] testStarknet() (gas: 1012566)
[PASS] testStarknetSpell() (gas: 2346)
Test result: ok. 2 passed; 0 failed; 0 skipped; finished in 42.83s
Running 21 tests for src/DssSpell.t.sol:DssSpellTest
[PASS] testAuth() (gas: 9223371487106283535)
[PASS] testAuthInSources() (gas: 9223371487099524853)
[PASS] testBytecodeMatches() (gas: 1778782)
[PASS] testCastCost() (gas: 860503)
[PASS] testChainlogValues() (gas: 9791059)
[PASS] testChainlogVersionBump() (gas: 3494415)
[PASS] testContractSize() (gas: 8984)
[PASS] testDeployCost() (gas: 1766070)
[PASS] testEsmAuth() (gas: 875495)
[PASS] testFailNotScheduled() (gas: 14375)
[PASS] testFailTooEarly() (gas: 13607)
[PASS] testFailTooLate() (gas: 13584)
[PASS] testFailWrongDay() (gas: 13607)
[PASS] testGeneral() (gas: 35793958)
[PASS] testMKRPayments() (gas: 877486)
[PASS] testNewChainlogValues() (gas: 925619)
[PASS] testNextCastTime() (gas: 353659)
[PASS] testOnTime() (gas: 856165)
[PASS] testPSMs() (gas: 2204183)
[PASS] testPayments() (gas: 928311)
[PASS] testUseEta() (gas: 352346)
Test result: ok. 21 passed; 0 failed; 0 skipped; finished in 962.98s
Ran 2 test suites: 23 tests passed, 0 failed, 0 skipped (23 total tests)
@0xp3th1um regarding your review. You've crossed out this section:
- [ ]
Deployed Contracts (not yet on chainlog or new to chainlog)
But it's actually applicable to this spell: we have contracts that are "new to chainlog" and the reviewer need to follow those checks for each of the new contracts.
✅ requested changes are applied ✅ no other content is changed since last review ✅ CI tests pass on 374473f ✅ local tests pass
./scripts/test-dssspell-forge.sh no-match="" match="" block=""
Using DssExecLib at: 0x8De6DDbCd5053d32292AAA0D2105A32d108484a6
[⠃] Compiling...
[⠊] Compiling 6 files with 0.8.16
[⠒] Solc 0.8.16 finished in 2.09s
Compiler run successful!
Running 2 tests for src/test/starknet.t.sol:StarknetTests
[PASS] testStarknet() (gas: 1012566)
[PASS] testStarknetSpell() (gas: 2346)
Test result: ok. 2 passed; 0 failed; 0 skipped; finished in 968.63s
Running 21 tests for src/DssSpell.t.sol:DssSpellTest
[PASS] testAuth() (gas: 9223371487106283535)
[PASS] testAuthInSources() (gas: 9223371487099524853)
[PASS] testBytecodeMatches() (gas: 1778782)
[PASS] testCastCost() (gas: 860503)
[PASS] testChainlogValues() (gas: 9791059)
[PASS] testChainlogVersionBump() (gas: 3494415)
[PASS] testContractSize() (gas: 8984)
[PASS] testDeployCost() (gas: 1766070)
[PASS] testEsmAuth() (gas: 875495)
[PASS] testFailNotScheduled() (gas: 14375)
[PASS] testFailTooEarly() (gas: 13607)
[PASS] testFailTooLate() (gas: 13584)
[PASS] testFailWrongDay() (gas: 13607)
[PASS] testGeneral() (gas: 35793958)
[PASS] testMKRPayments() (gas: 877486)
[PASS] testNewChainlogValues() (gas: 925619)
[PASS] testNextCastTime() (gas: 353659)
[PASS] testOnTime() (gas: 856165)
[PASS] testPSMs() (gas: 2204183)
[PASS] testPayments() (gas: 928656)
[PASS] testUseEta() (gas: 352346)
Test result: ok. 21 passed; 0 failed; 0 skipped; finished in 968.63s
Ran 2 test suites: 23 tests passed, 0 failed, 0 skipped (23 total tests)
Good to deploy from my side 👍
Ready to deploy!
TLDR: good to handover 👍
make diff-deployed-spell
)
⚠️ Part of the verified code is different as in many previous spells: part of the DssExecLib is replaced by /* WARNING
by the verification script, but it's expectedmake check-deployed-spell
DssExecLib.address
file
DssExecLib.address
file (e.g. look under the 'Files Changed' PR tab, etc.)deployed_spell_created
matches deployment timestampdeployed_spell_block
matches deployment block numbermake deploy-info tx=<tx>
matches config
⚠️ The link in the check is misleading as it's pointing to the master
branch, but the checks should be done against current spell branchdeployed_spell_created
timestampdeployed_spell_block
block numberLibraries Used
matches DssExecLib Latest Releasec0d3c6c
made on Feb 1, 2022, while git submodule of lib/dss-exec-lib
is set to track the latest commit 69b658f
made on Jan 23, 2023src
make diff-archive-spell
for current date or or date="YYYY-MM-DD" make diff-archive-spell
(date as per target Exec Doc date)DssExecLib.address
file is not being modified by the spell PRmake test
ETH_RPC_URL
is being used from env (i.e. no match
, block
or similar are active in your env)_Insert your passing local tests here_
./scripts/test-dssspell-forge.sh no-match="" match="" block=""
Using DssExecLib at: 0x8De6DDbCd5053d32292AAA0D2105A32d108484a6
[⠘] Compiling...
[⠑] Compiling 4 files with 0.8.16
[⠒] Solc 0.8.16 finished in 1.85s
Compiler run successful!
Running 2 tests for src/test/starknet.t.sol:StarknetTests
[PASS] testStarknet() (gas: 1012566)
[PASS] testStarknetSpell() (gas: 2346)
Test result: ok. 2 passed; 0 failed; 0 skipped; finished in 42.97s
Running 21 tests for src/DssSpell.t.sol:DssSpellTest
[PASS] testAuth() (gas: 9223371487106283535)
[PASS] testAuthInSources() (gas: 9223371487099524853)
[PASS] testBytecodeMatches() (gas: 1778782)
[PASS] testCastCost() (gas: 860503)
[PASS] testChainlogValues() (gas: 9791059)
[PASS] testChainlogVersionBump() (gas: 3494415)
[PASS] testContractSize() (gas: 8984)
[PASS] testDeployCost() (gas: 1766070)
[PASS] testEsmAuth() (gas: 875495)
[PASS] testFailNotScheduled() (gas: 14375)
[PASS] testFailTooEarly() (gas: 13607)
[PASS] testFailTooLate() (gas: 13584)
[PASS] testFailWrongDay() (gas: 13607)
[PASS] testGeneral() (gas: 35796055)
[PASS] testMKRPayments() (gas: 877486)
[PASS] testNewChainlogValues() (gas: 925619)
[PASS] testNextCastTime() (gas: 353659)
[PASS] testOnTime() (gas: 856165)
[PASS] testPSMs() (gas: 2204183)
[PASS] testPayments() (gas: 928541)
[PASS] testUseEta() (gas: 352346)
Test result: ok. 21 passed; 0 failed; 0 skipped; finished in 955.21s
Ran 2 test suites: 23 tests passed, 0 failed, 0 skipped (23 total tests)
Good to handover!
make diff-deployed-spell
)DssExecLib
code is replacedmake check-deployed-spell
DssExecLib.address
file
DssExecLib.address
file (e.g. look under the 'Files Changed' PR tab, etc.)deployed_spell_created
matches deployment timestamp
deployed_spell_block
matches deployment block number
make deploy-info tx=<tx>
matches config
deployed_spell_created
timestampdeployed_spell_block
block numberLibraries Used
matches DssExecLib Latest Releasesrc
make diff-archive-spell
for current date or or date="YYYY-MM-DD" make diff-archive-spell
(date as per target Exec Doc date)[x] Tests
DssExecLib.address
file is not being modified by the spell PRmake test
ETH_RPC_URL
is being used from env (i.e. no match
, block
or similar are active in your env)./scripts/test-dssspell-forge.sh no-match="" match="" block=""
Using DssExecLib at: 0x8De6DDbCd5053d32292AAA0D2105A32d108484a6
[⠑] Compiling...
No files changed, compilation skipped
Running 2 tests for src/test/starknet.t.sol:StarknetTests
[PASS] testStarknet() (gas: 1012566)
[PASS] testStarknetSpell() (gas: 2346)
Test result: ok. 2 passed; 0 failed; 0 skipped; finished in 33.32s
Running 21 tests for src/DssSpell.t.sol:DssSpellTest
[PASS] testAuth() (gas: 9223371487106283535)
[PASS] testAuthInSources() (gas: 9223371487099524853)
[PASS] testBytecodeMatches() (gas: 1778782)
[PASS] testCastCost() (gas: 860503)
[PASS] testChainlogValues() (gas: 9791059)
[PASS] testChainlogVersionBump() (gas: 3494415)
[PASS] testContractSize() (gas: 8984)
[PASS] testDeployCost() (gas: 1766070)
[PASS] testEsmAuth() (gas: 875495)
[PASS] testFailNotScheduled() (gas: 14375)
[PASS] testFailTooEarly() (gas: 13607)
[PASS] testFailTooLate() (gas: 13584)
[PASS] testFailWrongDay() (gas: 13607)
[PASS] testGeneral() (gas: 35796055)
[PASS] testMKRPayments() (gas: 877486)
[PASS] testNewChainlogValues() (gas: 925619)
[PASS] testNextCastTime() (gas: 353659)
[PASS] testOnTime() (gas: 856165)
[PASS] testPSMs() (gas: 2216245)
[PASS] testPayments() (gas: 928656)
[PASS] testUseEta() (gas: 352346)
Test result: ok. 21 passed; 0 failed; 0 skipped; finished in 1439.58s
Ran 2 test suites: 23 tests passed, 0 failed, 0 skipped (23 total tests)
Notified the public.
Description
Contribution Checklist
(PE-<TICKET_NUMBER>)
Checklist
officeHours
modifier override30 days
unless otherwise specified)ETH_GAS_LIMIT="XXX" ETH_GAS_PRICE="YYY" make deploy
mainnet
contract on etherscanmake archive-spell
ormake date="YYYY-MM-DD" archive-spell
to make an archive directory and copyDssSpell.sol
,DssSpell.t.sol
,DssSpell.t.base.sol
, andDssSpellCollateralOnboarding.sol
squash and merge
this PR