diff --git a/setup-templates/template-pause-bridge-base/.env b/setup-templates/template-pause-bridge-base/.env index fd9b2971..792e1701 100644 --- a/setup-templates/template-pause-bridge-base/.env +++ b/setup-templates/template-pause-bridge-base/.env @@ -6,11 +6,7 @@ OWNER_SAFE=0x14536667Cd30e52C0b458BaACcB9faDA7046E056 L1_PORTAL=0x49048044D57e1C92A77f79988d21Fa8fAF74E97e L2_BRIDGE= -IS_PAUSED= # true or false - # # Sepolia # OWNER_SAFE=0x5dfEB066334B67355A15dc9b67317fD2a2e1f77f # L1_PORTAL=0x49f53e41452C74589E85cA1677426Ba426459e85 # L2_BRIDGE= - -# IS_PAUSED= # true or false \ No newline at end of file diff --git a/setup-templates/template-pause-bridge-base/FACILITATOR.md b/setup-templates/template-pause-bridge-base/FACILITATOR.md index 02f4befd..87753cc6 100644 --- a/setup-templates/template-pause-bridge-base/FACILITATOR.md +++ b/setup-templates/template-pause-bridge-base/FACILITATOR.md @@ -11,8 +11,14 @@ cd / make deps ``` -### 2. Execute the transaction +### 2. Execute pause ```bash -SIGNATURES=AAABBBCCC make execute +SIGNATURES=AAABBBCCC make execute-pause +``` + +### 3. (When ready) Execute un-pause + +```bash +SIGNATURES=AAABBBCCC make execute-unpause ``` diff --git a/setup-templates/template-pause-bridge-base/Makefile b/setup-templates/template-pause-bridge-base/Makefile index 127207ad..b2b7e441 100644 --- a/setup-templates/template-pause-bridge-base/Makefile +++ b/setup-templates/template-pause-bridge-base/Makefile @@ -6,15 +6,47 @@ ifndef LEDGER_ACCOUNT override LEDGER_ACCOUNT = 0 endif +# TODO: ensure `SAFE_NONCE` matches the real `OWNER_SAFE` nonce +SAFE_NONCE=6 # TODO: ensure `sender` is a signer for `OWNER_SAFE` +SENDER=0xb2d9a52e76841279EF0372c534C539a4f68f8C0B + +SCRIPT_NAME=PauseBridge + .PHONY: gen-validation -gen-validation: - $(GOPATH)/bin/state-diff --rpc $(L1_RPC_URL) -o validations/signer.json \ - -- forge script --rpc-url $(L1_RPC_URL) PauseBridge \ - --sig "sign(address[])" "[$(OWNER_SAFE)]" \ - --sender 0xb2d9a52e76841279EF0372c534C539a4f68f8C0B +gen-validation: checkout-signer-tool run-script + +.PHONY: run-script +run-script: + cd $(SIGNER_TOOL_PATH); \ + npm ci; \ + bun run scripts/genValidationFile.ts --rpc-url $(L1_RPC_URL) \ + --workdir .. --forge-cmd 'forge script --rpc-url $(L1_RPC_URL) \ + $(SCRIPT_NAME) --sig "sign(address[])" [] --sender $(SENDER)' --out ../validations/base-signer.json; + +.PHONY: sign-pause +sign-pause: + IS_PAUSED=true SAFE_NONCE=$(SAFE_NONCE) $(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ + forge script --rpc-url $(L1_RPC_URL) $(SCRIPT_NAME) \ + --sig "sign(address[])" "[]" --sender $(SENDER) + +.PHONY: sign-unpause +sign-unpause: + IS_PAUSED=false SAFE_NONCE=$(SAFE_NONCE) $(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ + forge script --rpc-url $(L1_RPC_URL) $(SCRIPT_NAME) \ + --sig "sign(address[])" "[]" --sender $(SENDER) # Execute -.PHONY: execute -execute: - $(call MULTISIG_EXECUTE,$(SIGNATURES)) +.PHONY: execute-pause +execute-pause: + IS_PAUSED=true forge script --rpc-url $(L1_RPC_URL) $(SCRIPT_NAME) \ + --sig "run(bytes)" $(SIGNATURES) --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" --broadcast -vvvv + +.PHONY: execute-unpause +execute-unpause: + IS_PAUSED=false forge script --rpc-url $(L1_RPC_URL) $(SCRIPT_NAME) \ + --sig "run(bytes)" $(SIGNATURES) --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" --broadcast -vvvv + +.PHONY: check-status +check-status: + cast call $(L2_BRIDGE) "paused()" --rpc-url $(L2_RPC_URL) diff --git a/setup-templates/template-pause-bridge-base/README.md b/setup-templates/template-pause-bridge-base/README.md index d41f1f92..9a03b6cf 100644 --- a/setup-templates/template-pause-bridge-base/README.md +++ b/setup-templates/template-pause-bridge-base/README.md @@ -8,7 +8,13 @@ Pauses the Base side of [Base Bridge](https://github.com/base/bridge). ## Install dependencies -### 1. Install Node.js +### 1. Update foundry + +```bash +foundryup +``` + +### 2. Install Node.js if needed First, check if you have node installed @@ -22,28 +28,21 @@ If you see a version output from the above command, you can move on. Otherwise, brew install node ``` -### 2. Install bun +## Sign Task -First, check if you have bun installed +### 1. Update repo: ```bash -bun --version +cd contract-deployments +git pull ``` -If you see a version output from the above command, you can move on. Otherwise, install bun - -```bash -curl -fsSL https://bun.sh/install | bash -``` - -## Signing Steps - -### 1. Run the signer tool +### 2. Run the signing tool (NOTE: do not enter the task directory. Run this command from the project's root). ```bash make sign-task ``` -### 2. Open the UI at [http://localhost:3000](http://localhost:3000) +### 3. Open the UI at [http://localhost:3000](http://localhost:3000) -### 3. Send signature to facilitator +### 4. Send signature to facilitator