This repo contains execution code and artifacts related to Base contract deployments, upgrades, and calls. It also includes validation tools and a signing interface that helps signers easily perform transaction signing through a user-friendly web interface. For actual contract implementations, see base-org/contracts.
This repo is structured with each network having a high-level directory which contains subdirectories of any "tasks" (contract deployments/calls) that have happened for that network.
First, install forge if you don't have it already:
- Run
make install-foundry
to installFoundry
.
To execute a new task, run one of the following commands (depending on the type of change you're making):
- For a generic task:
make setup-task network=<network> task=<task-name>
- For gas increase tasks:
make setup-gas-increase network=<network>
- For funding:
make setup-funding network=<network>
- For fault proof upgrade:
make setup-upgrade-fault-proofs network=<network>
- For safe management tasks:
make setup-safe-management network=<network>
- For funding tasks:
make setup-funding network=<network>
Next, cd
into the directory that was created for you and follow the steps listed below for the relevant template.
👥 For Signers: Please read the Signer Guide for step-by-step instructions on using the validation UI.
Each task will have a directory structure similar to the following:
- inputs/ any input JSON files
- records/ Foundry will autogenerate files here from running commands
- script/ place to store any one-off Foundry scripts
- src/ place to store any one-off smart contracts (long-lived contracts should go in base-org/contracts)
- .env place to store environment variables specific to this task
📝 Note: Before continuing with the templates below, please review the setup guide for valid upgrade folders to ensure your task is compatible with the new validation tool.
This template contains scripts that will help us respond to incidents efficiently.
To use the template during an incident:
- Fill in the
.env
file with dependency commit numbers and any variables that need to be defined for the script you're running. - Delete the other scripts that are not being used so that you don't run into build issues.
- Make sure the code compiles and check in the code.
- Have each signer pull the branch, and run the relevant signing command from the Makefile.
To add new incident response scripts:
- Any incident response-related scripts should be included in this template (should be generic, not specific to network), with specific TODOs wherever addresses or other details need to be filled in.
- Add the relevant make commands that would need to be run for the script to the template Makefile
- Add relevant mainnet addresses in comments to increase efficiency responding to an incident.
This template can be used to do contract calls, upgrades, or one-off deployments.
- Specify the commit of Optimism code and Base contracts code you intend to use in the
.env
file - Run
make deps
- Put scripts in the
script
directory (see examples that are part of the template, for example, there is a fileBasicScript.s.sol
). See note below if running a task that requires a multisig to sign. - Call scripts from the Makefile (see examples in the template Makefile that's copied over).
This template is increasing the throughput on Base Chain.
- Ensure you have followed the instructions above in
setup
- Go to the folder that was created using the
make setup-gas-increase network=<network>
step - Fill in all TODOs (search for "TODO" in the folder) in the
.env
andREADME
files. Tip: you can runmake deps
followed bymake sign-upgrade
to produce a Tenderly simulation which will help fill in several of the TODOs in the README (and alsomake sign-rollback
). - Check in the task when it's ready to sign and collect signatures from signers
- Once executed, check in the records files and mark the task
DONE
in the README.
This template is used to upgrade the fault proof contracts. This is commonly done in conjunction with a hard fork.
- Ensure you have followed the instructions above in
setup
- Go to the folder that was created using the
make setup-upgrade-fault-proofs network=<network>
step - Specify the commit of Optimism code and Base contracts code you intend to use in the
.env
file - Run
make deps
- Add the new absolute prestate to the
.env
file. This can be found in the op-program prestates releases.json file. - NOTE: If this task is for mainnet, the directory should work as-is. If this task is for testnet, you will need to follow the following steps:
- Comment out the mainnet environment variables and uncomment the testnet vars in
.env
- Comment out the mainnet environment variables and uncomment the testnet vars in
- Build the contracts with
forge build
- Remove the unneeded validations from
VALIDATION.md
and update the relevant validations accordingly - Check in the task when it's ready to sign and collect signatures from signers
- Once executed, check in the records files and mark the task
DONE
in the README.
This template is used to perform ownership management on a Gnosis Safe multisig, specifically it can swap owners on the multisig.
- Ensure you have followed the instructions above in
setup
. - Run
make setup-safe-management network=<network>
and go to the folder that was created by this command. - Specify the commit of Optimism code and Base contracts code you intend to use in the
.env
file. - Run
make deps
. - Specify the
OWNER_SAFE
, which is the safe multisig where an owner will be replaced, theOLD_SIGNER
(current owner) to remove, and theNEW_SIGNER
(new owner) to be added in the.env
file. - Build the contracts with
forge build
. - Simulate the task with
make sign
and update the generic validations inVALIDATION.md
with the real values. - Check in the task when it's ready to sign and request the facilitators to collect signatures from signers.
- Once executed, check in the records files and mark the task
DONE
in the README.
This template is used to fund addresses from a Gnosis Safe.
- Ensure you have followed the instructions above in
setup
. - Run
make setup-funding network=<network>
and go to the folder that was created by this command. - Specify the commit of Optimism code and Base contracts code you intend to use in the
.env
file. - Run
make deps
. - Specify the
SAFE
, which is the safe that will fund the addresses in the.env
file. - Specify the
recipients
andfunds
arrays (in 1e18 units) in thefunding.json
file. - Build the contracts with
forge build
. - Simulate the task with
make sign
and update the generic validations inVALIDATION.md
with the real values. - Check in the task when it's ready to sign and request the facilitators to collect signatures from signers.
- Once executed, check in the records files and mark the task
DONE
in the README.