You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-12
Original file line number
Diff line number
Diff line change
@@ -1,43 +1,70 @@
1
+

2
+
1
3
# contract-deployments
2
4
3
5
This repo contains execution code and artifacts related to Base contract deployments, upgrades and calls. For actual contract implementations, see [base-org/contracts](https://github.com/base-org/contracts).
4
6
5
7
This repo is structured with each network having a high level directory which contains sub directories of any "tasks" (contract deployments/calls) that have happened for that network.
* Run `make install-foundry` to install [`Foundry`](https://github.com/foundry-rs/foundry/commit/3b1129b5bc43ba22a9bcf4e4323c5a9df0023140).
33
+
34
+
- Run `make install-foundry` to install [`Foundry`](https://github.com/foundry-rs/foundry/commit/3b1129b5bc43ba22a9bcf4e4323c5a9df0023140).
11
35
12
36
To execute a new task run one of the following commands (depending on the type of change you're making):
13
-
* For incident response commands: `make setup-incident network=<network> incident=<incident-name>`
14
-
* For full new deployment (of L1 contracts related to Base): `make setup-deploy network=<network>`
15
-
* For contract calls, upgrades, or one-off contract deployments: `make setup-task network=<network> task=<task-name>`
37
+
38
+
- For incident response commands: `make setup-incident network=<network> incident=<incident-name>`
39
+
- For full new deployment (of L1 contracts related to Base): `make setup-deploy network=<network>`
40
+
- For contract calls, upgrades, or one-off contract deployments: `make setup-task network=<network> task=<task-name>`
16
41
17
42
Next, `cd` into the directory that was created for you and follow the steps listed below for the relevant template.
18
43
19
44
## Directory structure
20
45
21
46
Each task will have a directory structure similar to the following:
22
47
23
-
***[inputs/](/inputs)** any input json files
24
-
***[records/](/records)** foundry will autogenerate files here from running commands
25
-
***[script/](/script)** place to store any one-off foundry scripts
26
-
***[src/](/src)** place to store any one-off smart contracts (long lived contracts should go in [base-org/contracts](https://github.com/base-org/contracts))
27
-
***.env** place to store env variables specific to this task
48
+
-**[inputs/](/inputs)** any input json files
49
+
-**[records/](/records)** foundry will autogenerate files here from running commands
50
+
-**[script/](/script)** place to store any one-off foundry scripts
51
+
-**[src/](/src)** place to store any one-off smart contracts (long lived contracts should go in [base-org/contracts](https://github.com/base-org/contracts))
52
+
-**.env** place to store env variables specific to this task
28
53
29
54
## Using the incident response template
30
55
31
56
This template contains scripts that will help us respond to incidents efficiently.
32
57
33
58
To use template during an incident:
59
+
34
60
1. Fill in TODOs in the relevant script.
35
61
1. Fill in dependency commit values in the `.env` file.
36
62
1. Delete the other scripts that are not being used so that you don't run into build issues.
37
63
1. Check in code once addresses have been filled in.
38
64
1. Have each signer pull the branch, and run relevant signing command from the Makefile.
39
65
40
66
To add new incident response scripts:
67
+
41
68
1. 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.
42
69
1. Add the relevant make commands that would need to be run for the script to the template Makefile
43
70
1. Add relevant mainnet addresses in comments to increase efficiency responding to an incident.
@@ -46,19 +73,18 @@ To add new incident response scripts:
46
73
47
74
This template is used for deploying the L1 contracts in the OP stack to set up a new network.
48
75
49
-
1. Specify the commit of [Optimism code](https://github.com/ethereum-optimism/optimism) and [Base contracts code](https://github.com/base-org/contracts)you intend to use in the `.env` file
76
+
1. Specify the commit of [Optimism code](https://github.com/ethereum-optimism/optimism) and [Base contracts code](https://github.com/base-org/contracts) you intend to use in the `.env` file
50
77
1. Run `make deps`
51
78
1. Fill in the `inputs/deploy-config.json` and `inputs/misc-config.json` files with the input variables for the deployment.
52
79
1. See the example `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)
53
80
1. Run `make deploy` command
54
81
1. Check in files to github. The files to ignore should already have been specified in the `.gitignore`, so you should be able to check in everything.
55
82
56
-
57
83
## Using the generic template
58
84
59
85
This template can be used to do contract calls, upgrades or one-off deployments.
60
86
61
-
1. Specify the commit of [Optimism code](https://github.com/ethereum-optimism/optimism) and [Base contracts code](https://github.com/base-org/contracts)you intend to use in the `.env` file
87
+
1. Specify the commit of [Optimism code](https://github.com/ethereum-optimism/optimism) and [Base contracts code](https://github.com/base-org/contracts) you intend to use in the `.env` file
62
88
1. Run `make deps`
63
89
1. Put scripts in the `scripts` directory (see examples that are part of the template, for example there is a file `TransferOwner.s.sol`, which can be used to setup the ownership transfer task). See note below if running a task that requires a multisig to sign.
64
90
1. Call scripts from the Makefile (see examples in the template Makefile that's copied over).
0 commit comments