PR: https://github.com/makerdao/spells-goerli/pull/
- Create a new branch on the
spells-goerli
repo namedYYYY-MM-DD
using the initial target date of the spell- Ensure the same target date is used as the corresponding
spells-mainnet
spell branch
- Ensure the same target date is used as the corresponding
- Pull
master
Locally and Checkout Branch (IF Branch is created via GitHub) - Pull
master
Locally, Create and Checkout Branch (IF Branch was not created via GitHub) - Cleanup Previous Spell's Actions in
DssSpell.sol
- Check previous spells in the
archive
folder for cleanup patterns - Delete unused dependencies in the
src/dependencies
folder where applicable
- Check previous spells in the
- Cleanup
src/test/config.sol
- Set
deployed_spell
toaddress(0)
- Set
deployed_spell_created
to0
- Set
deployed_spell_block
to0
- Set
- Cleanup Specific Tests in
DssSpell.t.sol
- Check previous spells in the
archive
folder for cleanup patterns - Disable specific tests IF Not Used (e.g.
testCollateralIntegrations
,testNewChainlogValues
,testNewIlkRegistryValues
, ...)- Remove spell-specific part
- Keep setup
- Disable by setting visibility to
private
- Add commented notes
- e.g.
// Insert new collateral integration tests here
- e.g.
- Keep commented tests (e.g.
testOSMs
,testMedianizers
)
- Check previous spells in the
- Add comments to the spell:
- Copy every Section text from the Exec Sheet as comment to the spell code (above the code segment that implements the action)
- Surround the comment by the set of dashes (E.g.
// ----- Section text -----
)
- Surround the comment by the set of dashes (E.g.
- For every Instruction text Exec Sheet:
- copy to the spell code as
// Instruction text
- add newline above it
- copy to the spell code as
- For every
Reasoning URL
andAuthority URL
from the Exec Sheet add comment with it under relevant section or instruction in the spell code (depending on which row the link is present)- For every
Reasoning URL
andAuthority URL
add prefix derived from the url itself-
// Executive Vote:
if URL starts withhttps://vote.makerdao.com/executive/
-
// Poll:
if URL starts withhttps://vote.makerdao.com/polling/
-
// Forum:
if URL starts withhttps://forum.makerdao.com/t/
-
// MIP:
if URL starts withhttps://mips.makerdao.com/mips/details/
-
- For every
- If action in the spell doesn't have relevant instruction (e.g.:
chainlog
version bump), add the explanation prefixed with// Note:
- If an instruction can not be taken, add a comment under the instruction prefixed with
// Note:
(e.g.:// Note: Payments are skipped on goerli
)
- Copy every Section text from the Exec Sheet as comment to the spell code (above the code segment that implements the action)
- Run Tests
make test
ormake test match=<test_name>
to inspect debug traces- Ensure to use latest
foundry
stable version- Run
foundryup
- Run
- Ensure to use latest
- Tests PASS via
make test
- Commit & Push
Base spell
- CI Tests PASS
- Open Draft PR on
spells-goerli
titledYYYY-MM-DD Goerli Spell
whereYYYY-MM-DD
is the target date of the spell - Assign to yourself
- BECAUSE corresponding Exec Doc is NOT ready
- Add Spell Actions as per Exec Sheet - Polls
- Polls starts on Monday and ends on Thursday
- Ensure spell actions match polls details and links (forum posts, MIPs portal, ...)
- Add a comment for the polling detail URL
// https://vote.makerdao.com/polling/<hash>
- Add a comment for the forum post URL
// https://forum.makerdao.com/t/<title>/<number>
- Check on
new-spells
discord channel when Exec Doc is ready - Pragma
- Current solc version
0.8.16
- Current solc version
- Interfaces
- Consider using
DssExecLib
actions where possible (to avoid introducing interfaces where not required) - Avoid
dss-interfaces
multi-import layout (see issue #69) - Prefer single import layout
-
import { VatAbstract } from "dss-interfaces/dss/VatAbstract.sol";
-
- Consider static interfaces
- IF not present in
dss-interfaces
- IF present in
dss-interfaces
but TOFIX - IF only a few function interfaces are needed
- IF not present in
- Consider using
- Office Hours (OFF by Default on Goerli)
- Ensure
officeHours
modifier is overridden to returnfalse
- Ensure
- Deploy New Join, Clip and Calc (Onboarding)
-
Join
(check which one is required)- Use JoinFab to deploy
- Etherscan Verification
- Make sure AGPLv3 is specified and used
- IF Flatten, consider removing
HEVM
interface artifacts
-
Clip
- Use ClipFab to deploy
- Etherscan Verification
- Make sure AGPLv3 is specified and used
-
Calc
(check which one is required)- Use CalcFab to deploy
- Note: automatically verified on etherscan
- Check with Oracle CU
- Check IF oracle deployment is required (e.g. univ3-lp-oracle, new ilk pip, ...)
-
- Ensure every spell variable is declared as public/internal
- Consider
immutable
visibility when fetching addresses from theChainLog
viaDssExecLib.getChangelogAddress
and useconstant
for static addresses- Fetch addresses as type
address
and wrap withLike
suffix interfaces inline (when making calls) unless archive patterns permit otherwise (Such asMKR
) - Use the DssExecLib Core Address Helpers where possible (e.g.
DssExecLib.vat()
) - Where addresses are fetched from the
ChainLog
, the variable name must match the value of the ChainLog key for that address (e.g.MCD_VAT
rather thanvat
), except where the archive pattern differs from this pattern (e.g. MKR)
- Fetch addresses as type
- Add New Addresses in the ChainLog
- Bump ChainLog, accordingly with spec (
major
,minor
,patch
)- MAJOR -> New Vat
- MINOR -> Core Module (DSS) Update (e.g. Flapper)
- PATCH -> Collateral addition or addition/modification
- Use DssExecLib Functions
- Ensure
DssExecLib
address used in current spell (DssExecLib.address
) matchesdss-exec-lib
Latest Release Tag - Check previous spells for common patterns
- Ensure
- Adjust System Values, Collateral Values in
config.sol
(i.e. diffcheck via vscodecode --diff config1.sol config2.sol
) withspells-mainnet
) - Add Specific Tests in
DssSpell.t.sol
(i.e. diffcheck via vscodecode --diff source1.sol source2.sol
) withspells-mainnet
)- Add new collateral tests
- Add new chainLog value tests
- Add new ilk registry value tests
- Add specific tests (DAI/MKR Streams/Payments, Lerps, ...)
- Add new ChainLog Address in
addresses_goerli.sol
(e.g. Collateral Onboarding) - Run Tests
make test
ormake test match=<test_name>
to inspect debug traces- Ensure Good Coverage
- Ensure every test function is declared as public if enabled or private if disabled
- Tests PASS via
make test
- Open PR & Add Reviewers
- Iterate until polls are ended and exec doc is confirmed
- Make sure CI PASS
- Wait for at Least Two Approvals with local tests to deploy
- Pre-Deploy Setup and Checks (currently via
dapptools
)- Set local env (
.sethrc
)- Deployer
- Avoid using the same deployer for mainnet and testnet (to avoid deploying contracts with the same address but different sources)
-
export ETH_PASSWORD=~/.env/password.txt
-
export ETH_KEYSTORE=~/.ethereum/keystore
-
export ETH_FROM=<address>
- Goerli EIP1559
-
export ETH_GAS=X
- Run
make estimate
and adjustETH_GAS
accordingly (e.g. 6000000)
- Run
-
export ETH_GAS_PRICE=$(seth --to-wei X gwei)
- Check current gas price using
seth gas-price
and SetETH_GAS_PRICE
accordingly (e.g. 40 gwei)
- Check current gas price using
-
export ETH_PRIO_FEE=$(seth --to-wei X gwei)
- Check current gas priority fee and set
ETH_PRIO_FEE
accordingly (e.g. 2 gwei)
- Check current gas priority fee and set
-
- Goerli RPC URL
-
export ETH_RPC_URL=<url>
-
- Etherscan API KEY
-
export ETHERSCAN_API_KEY=<key>
-
- Ensure to
source
the.sethrc
file to make env vars available
- Deployer
- Check local env
-
seth ls
-
seth chain
-
- Set local env (
- Deploy spell on Goerli via
make deploy
- Ensure
src/test/config.sol
is edited correctly-
deployed_spell: address(<deployed_spell_address>)
-
deployed_spell_created: <timestamp>
-
deployed_spell_block: <block number>
- validate the above values via
make deploy-info tx=<tx_hash>
-
- Ensure spell is verified on etherscan
- Ensure local tests PASS against deployed spell run via the deploy script
- Push auto-generated commit
- Ensure
- Archive Spell via
make archive-spell
for current date ordate="YYYY-MM-DD" make archive-spell
(date as per cast timestamp) - Commit & Push for Review
- Wait for CI to PASS
- Wait for at Least Two Approvals
- Cast Spell via
make cast-spell
(ONLY ON GOERLI) - Check
cast()
trace (via EthTx)- Ensure no reverts are present that block execution
- Inspect low level call reverts if expected
- Ensure all actions are executed and not out-of-gas errors are present
- Ensure no reverts are present that block execution
- Pre-Merge Target Branch Pull Attack Checks
- Ensure that the latest commit to the spells-mainnet repo was not a maintenance PR
- Ensure that there was not a maintenance PR within the last THREE spells (i.e. 6 weeks)
- If maintenance PR is present:
- PR Name / Description?
- PR Actions match description and look safe?
- PR Did not modify files unrelated to name / description?
- PR Did not modify test script (including CI)?
- Run old test script to ensure the test results are the same (use --block flag if spell is already
cast
for Goerli) - Obtain unanimous approval of the safety of the new deploy script
- Run old test script to ensure the test results are the same (use --block flag if spell is already
- PR Did not modify DssExecLib.address?
- If it did, flag with Governance Facilitators
- PR Did not affect deploy script?
- If it did, flag internally with reviewers and investigate prior to merging
- Run old deploy script to ensure the output results are the same
- If different, flag with Governance Facilitators (this may affect external scripts or third party reviews)
- Obtain unanimous approval of the safety of the new deploy script
- If maintenance PR is present:
- Squash & Merge