This repo contains execution code and artifacts related to Base contract deployments, upgrades, and calls. For actual contract implementations, see base/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. Supported networks are mainnet, sepolia, and sepolia-alpha.
First, install forge if you don't have it already:
- Run
make install-foundryto 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 combined gas, elasticity, and DA footprint gas scalar tasks:
make setup-gas-and-elasticity-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> - For updating the partner threshold in Base Bridge:
make setup-bridge-partner-threshold network=<network> - For pausing / un-pausing Base Bridge:
make setup-bridge-pause network=<network> - For switching to a permissioned game and retiring dispute games:
make setup-switch-to-permissioned-game network=<network> - For pausing SuperchainConfig:
make setup-superchain-config-pause 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.
Please note, for some older tasks (that have not yet been adapted to use the signer tool) you will need to manually create validation file(s) for your task as they are bespoke to each task and therefore not created automatically as a part of the templates. We use one validation Markdown file per multisig involved in the task, so if there's only one multisig involved in your task, then you can simply create a VALIDATION.md file at the root of your task containing the validation instructions, while if there are multiple multisigs involved in the task, then create a validations/ sub-directory at the root of your task containing the corresponding validation Markdown files. If you need examples to work from, you can browse through similar past tasks in this repo and adapt them to your specific task. Also, please note that we have tooling to generate these files (like the task-signer-tool) which removes the manual aspect of creating these validation files, we will soon update these instructions to reflect how this process can be automated.
Each network directory (mainnet/, sepolia/, sepolia-alpha/) contains a .env file that defines all contract addresses and network metadata for that chain. These variables are automatically available to every task via the include ../.env directive in each task's Makefile, so there is no need to manually load addresses in individual tasks or templates.
The network .env files contain:
- Network metadata β
NETWORK,L1_RPC_URL,L2_RPC_URL,L1_CHAIN_ID,L2_CHAIN_ID,LEDGER_ACCOUNT - Admin addresses β multisig addresses, proposer, challenger, batch sender, etc.
- L1 contract addresses β proxy admin, bridges, dispute game factories, system config, etc.
- L2 contract addresses β fee vaults, cross-domain messenger, standard bridge, etc.
All address variables are prefixed with export so they are available to child shell processes (Forge scripts, shell commands, etc.). Foundry scripts can access them via vm.envAddress("VARIABLE_NAME").
Note: If you need to add or update a contract address, edit the corresponding
{network}/.envfile directly. Do not create per-task address definitions unless they are truly task-specific.
Each task will have a directory structure similar to the following:
- 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/contracts)
- .env place to store task-specific environment variables (contract addresses are inherited from the network-level
.env)
A GitHub Actions workflow automatically validates all 10 setup-templates on every pull request and on pushes to main.
What CI checks for each template:
- Solidity formatting β
forge fmt --check script/ensures formatting consistency. - Compilation β
forge buildverifies that imports resolve, types are correct, and all dependencies are present.
Templates are validated in parallel using a matrix strategy, so failures are isolated per-template with clear error messages identifying the template and failure type.
How it works:
- Foundry stable is installed via the
foundry-rs/foundry-toolchainGitHub Action. - For each template, the corresponding
make setup-*target creates a task directory from the template. make depsinstalls all dependencies (including base-contracts at the commit pinned in the template's.env).
What CI does NOT do:
- Does not run
forge script(requires RPC URLs, env vars, and hardware wallets). - Does not run
forge test(no test files exist in templates). - Does not run signing or execution targets (they depend on network state and hardware wallets).
See
.github/workflows/validate-templates.ymlfor the full workflow definition.
This template contains scripts that will help us respond to incidents efficiently.
To use the template during an incident:
- Fill in the
.envfile 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 Base contracts code you intend to use in the
.envfile - Run
make deps - Put scripts in the
scriptdirectory (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
.envandREADMEfiles. Tip: you can runmake depsfollowed bymake sign-upgradeto 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
EXECUTEDin the README.
This template is used to update the gas limit, elasticity, and DA footprint gas scalar, or roll back the changes (if needed).
- Ensure you have followed the instructions above in
setup, including runningmake setup-gas-and-elasticity-increase network=<network>and then go to the folder that was created by this command. - Specify the commit of Base contracts code in the
.envfile. - Run
make deps. - Fill in any task-specific variables in the
.envfile that have per-network comments (e.g.,OWNER_SAFE,SENDER), using the value for your target network. - Ensure the
SENDERvariable in the.envfile is set to a signer ofOWNER_SAFE. - Set the
FROM_*andTO_*values for gas limit and elasticity in the.envfile. - Calculate the DA footprint gas scalar with
make da-scalar TARGET_BLOB_COUNT=<value>and set theFROM_DA_FOOTPRINT_GAS_SCALARandTO_DA_FOOTPRINT_GAS_SCALARvalues in the.envfile. - Build the contracts with
forge build. - Generate the validation file for signers with
make gen-validation. - Generate the rollback validation file for signers with
make gen-validation-rollback. - Double check the
cmdfield at the top of both of the generated validation files and ensure that the value passed to the--senderflag matches theSENDERenv var already defined in the.envfile. - Ensure that all of the fields marked as
TODOin the tasks'sREADME.mdhave been properly filled out. - 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
EXECUTEDin 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 Base contracts code you intend to use in the
.envfile - Run
make deps - Add the new absolute prestate to the
.envfile. This can be found in the op-program prestates releases.json file. - Network-specific contract addresses are loaded automatically from the network
.envfile. Fill in any remaining task-specific variables in the task's.envfile. - Build the contracts with
forge build - Remove the unneeded validations from
VALIDATION.mdand 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
EXECUTEDin the README.
This template is used to perform ownership management on a Gnosis Safe, like the incident multisig, specifically it can be used to change the owners of the multisig.
- Ensure you have followed the instructions above in
setup, including runningmake setup-safe-management network=<network>and go to the folder that was created by this command. - Specify the commit of Base contracts code you intend to use in the
.envfile. - Enter the directory that was generated for the task (in the first step) and then run
make deps. - Specify the
OWNER_SAFE, which is the safe multisig where an owner will be replaced and theSENDERwhich should be the address of a current signer of the multisig. - Fill in the
OwnerDiff.jsoninside the task's directory with the addresses to add to, and remove from, the multisig in their respective fields. - Ensure that the
EXISTING_OWNERS_LENGTHconstant value inside thescript/UpdateSigners.s.solscript is set appropriately, in particular that it equals the exact number of current members of the Incident Multisig Safe (prior to running the task). - Build the contracts with
forge build. - Generate the validation file for signers with
make gen-validation. - Double check the
cmdfield at the top of the generated validation file atvalidations/base-signer.jsonand ensure that the value passed to the--senderflag matches theSENDERenv var already defined in the.envfile. - 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
EXECUTEDin 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 Base contracts code you intend to use in the
.envfile. - Run
make deps. - Specify the
SAFE, which is the safe that will fund the addresses in the.envfile. - Specify the
recipientsandfundsarrays (in 1e18 units) in thefunding.jsonfile. - Build the contracts with
forge build. - Simulate the task with
make signand update the generic validations inVALIDATION.mdwith 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
EXECUTEDin the README.
This template is used to update the partner threshold in Base Bridge, affecting the amount of required partner signatures to approve bridge messages.
- Ensure you have followed the instructions above in
setup. - Run
make setup-bridge-partner-threshold network=<network>and go to the folder that was created by this command. - Specify the commit of Base contracts code you intend to use in the
.envfile. - Run
make deps. - Fill in any task-specific variables in the
.envfile that have per-network comments, using the value for your target network. - Set the
NEW_THRESHOLDvariable in the.envfile. - Ensure the
--senderflag in themake gen-validationcommand in theMakefilefile is set to a signer forOWNER_SAFEin.env. - Build the contracts with
forge build. - Generate the validation file for signers with
make gen-validation. - 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
EXECUTEDin the README.
This template is used to pause or un-pause Base Bridge.
- Ensure you have followed the instructions above in
setup. - Run
make setup-bridge-pause network=<network>and go to the folder that was created by this command. - Specify the commit of Base contracts code you intend to use in the
.envfile. - Run
make deps. - Fill in any task-specific variables in the
.envfile that have per-network comments (e.g.,L2_BRIDGE), using the value for your target network. - Set the
IS_PAUSEDvariable totrueorfalsein the.envfile depending on if you intend to pause or unpause the bridge. - Ensure the
--senderflag in themake gen-validationcommand in theMakefilefile is set to a signer forOWNER_SAFEin.env. - Build the contracts with
forge build. - Generate the validation file for signers with
make gen-validation. - 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
EXECUTEDin the README.
This template is used to switch Base to a Permissioned Game.
- Ensure you have followed the instructions above in
setup. - Run
make setup-switch-to-permissioned-game network=<network>and go to the folder that was created by this command. - Specify the commit of Base contracts code you intend to use in the
.envfile. - Run
make deps. - Fill in any task-specific variables in the
.envfile that have per-network comments (e.g.,OWNER_SAFE,OP_SECURITY_COUNCIL_SAFE,SENDER), using the value for your target network. - Build the contracts with
forge build. - Generate the validation file for signers with
make gen-validation. - 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
EXECUTEDin the README.
This template is used to pause or un-pause the L1 SuperchainConfig contract.
- Ensure you have followed the instructions above in
setup. - Run
make setup-superchain-config-pause 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
.envfile. - Run
make deps. - Fill in any task-specific variables in the
.envfile that have per-network comments, using the value for your target network. - Build the contracts with
forge build. - Sign the pause transaction with
make sign-pauseor generate the validation file for un-pausing withmake gen-validation-unpause. - 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
EXECUTEDin the README.
