Skip to content

Commit

Permalink
fix: pre-deployed gas token workflow (#403)
Browse files Browse the repository at this point in the history
* fix: pre-deployed gas token workflow

* chore: nit

* fix: add `--broadcast` to `forge create` to deploy contracts

* chore: nit
  • Loading branch information
leovct authored Nov 28, 2024
1 parent 03fe6a9 commit 019f7e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/migrate/forkid-7-to-9.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
3 changes: 2 additions & 1 deletion templates/contract-deploy/run-contract-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 019f7e9

Please sign in to comment.