From 019f7e9bd628c1d59ad9b59b3febb69adec3a08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Vincent?= <28714795+leovct@users.noreply.github.com> Date: Thu, 28 Nov 2024 11:03:53 +0100 Subject: [PATCH] fix: pre-deployed gas token workflow (#403) * fix: pre-deployed gas token workflow * chore: nit * fix: add `--broadcast` to `forge create` to deploy contracts * chore: nit --- .github/workflows/deploy.yml | 10 ++++++---- docs/migrate/forkid-7-to-9.md | 2 ++ templates/contract-deploy/run-contract-setup.sh | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cccc7bf45..826688d8c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -229,14 +229,16 @@ jobs: echo "Deploying gas token to L1..." l1_rpc_url=$(kurtosis port print ${{ env.ENCLAVE_NAME }} el-1-geth-lighthouse rpc) - gas_token_address=$(forge create \ + forge create \ + --broadcast \ --json \ --rpc-url $l1_rpc_url \ --mnemonic "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete" \ contracts/mocks/ERC20PermitMock.sol:ERC20PermitMock \ - --constructor-args "CDK Gas Token" "CDK" "0xE34aaF64b29273B7D567FCFc40544c014EEe9970" "1000000000000000000000000" \ - | jq --raw-output '.deployedTo') - if [[ -z "$gas_token_address" ]]; then + --constructor-args "CDK Gas Token" "CDK" "0xE34aaF64b29273B7D567FCFc40544c014EEe9970" "1000000000000000000000000" \ + > gasToken-erc20.json + gas_token_address=$(jq --raw-output '.deployedTo' gasToken-erc20.json) + if [[ -z "$gas_token_address" || "$gas_token_address" == "null" ]]; then echo "Unable to deploy gas token" exit 1 fi diff --git a/docs/migrate/forkid-7-to-9.md b/docs/migrate/forkid-7-to-9.md index da04edd20..c450a7225 100644 --- a/docs/migrate/forkid-7-to-9.md +++ b/docs/migrate/forkid-7-to-9.md @@ -156,6 +156,7 @@ After a few minutes, the number of verified batches should increase (the first b ```sh forge create \ + --broadcast \ --json \ --rpc-url "$(kurtosis port print cdk-v1 el-1-geth-lighthouse rpc)" \ --private-key 0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625 \ @@ -171,6 +172,7 @@ After a few minutes, the number of verified batches should increase (the first b bridge="$(kurtosis service exec cdk-v1 contracts-001 "jq -r .polygonZkEVMBridgeAddress /opt/zkevm/combined.json" | tail -n +2)" mngr="$(kurtosis service exec cdk-v1 contracts-001 "jq -r .polygonRollupManager /opt/zkevm/combined.json" | tail -n +2)" forge create \ + --broadcast \ --json \ --private-key 0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625 \ contracts/v2/consensus/validium/migration/PolygonValidiumStorageMigration.sol:PolygonValidiumStorageMigration \ diff --git a/templates/contract-deploy/run-contract-setup.sh b/templates/contract-deploy/run-contract-setup.sh index 81d28980f..63fdec691 100755 --- a/templates/contract-deploy/run-contract-setup.sh +++ b/templates/contract-deploy/run-contract-setup.sh @@ -121,11 +121,12 @@ printf "[profile.default]\nsrc = 'contracts'\nout = 'out'\nlibs = ['node_modules # {{if eq .gas_token_address ""}} echo_ts "Deploying gas token to L1" forge create \ + --broadcast \ --json \ --rpc-url "{{.l1_rpc_url}}" \ --mnemonic "{{.l1_preallocated_mnemonic}}" \ contracts/mocks/ERC20PermitMock.sol:ERC20PermitMock \ - --constructor-args "CDK Gas Token" "CDK" "{{.zkevm_l2_admin_address}}" "1000000000000000000000000" \ + --constructor-args "CDK Gas Token" "CDK" "{{.zkevm_l2_admin_address}}" "1000000000000000000000000" \ > gasToken-erc20.json jq \ --slurpfile c gasToken-erc20.json \