Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pre-deployed gas token workflow #403

Merged
merged 4 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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