This repo contains execution code and artifacts related to Base contract deployments, upgrades, and calls. 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:
make install-foundry
to install Foundry
.To execute a new task, run one of the following commands (depending on the type of change you're making):
make setup-incident network=<network> incident=<incident-name>
make setup-deploy network=<network>
make setup-task network=<network> task=<task-name>
Next, cd
into the directory that was created for you and follow the steps listed below for the relevant template.
Each task will have a directory structure similar to the following:
This template contains scripts that will help us respond to incidents efficiently.
To use the template during an incident:
.env
file with dependency commit numbers and any variables that need to be defined for the script you're running.To add new incident response scripts:
This template is used for deploying the L1 contracts in the OP stack to set up a new network.
setup
.env
filemake deps
inputs/deploy-config.json
and inputs/misc-config.json
files with the input variables for the deployment.make deploy
command. Modifications may need to be made if you're using a key for deployment that you do not have the private key for (e.g. a hardware wallet)make deploy
command.gitignore
, so you should be able to check in everything.This template can be used to do contract calls, upgrades, or one-off deployments.
.env
filemake deps
scripts
directory (see examples that are part of the template, for example, there is a file TransferOwner.s.sol
, which can be used to set up the ownership transfer task). See note below if running a task that requires a multisig to sign.Note: If using a multisig as a signer, you can leverage the MultisigBuilder
for standard multisigs or the NestedMultisigBuilder
scripts in the base contracts repo for multisigs that contain other multisigs as signers. For these scripts, you need to implement the virtual functions that are provided, which will allow you to configure the task you'd like to run, the address of the multisig you're running it from, and any post-execution checks. See the files themselves for more details. It is recommended to add any configured addresses as constants at the top of the file and provide links to Etherscan, etc., as needed for reviewers to more accurately review the PR.