Skip to content

Commit

Permalink
fix: shellcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Mar 13, 2024
1 parent deb65fa commit 44f259d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions templates/run-contract-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ fi
apt update
apt-get -y install socat jq yq
curl -s -L https://foundry.paradigm.xyz | bash
# shellcheck disable=SC1091
source /root/.bashrc
foundryup &> /dev/null

Expand All @@ -32,14 +33,14 @@ popd
2>&1 echo "Funding important accounts on l1"

# FIXME this look might never finish.. Add a counter
until cast send --rpc-url {{.l1_rpc_url}} --mnemonic "{{.l1_preallocated_mnemonic}}" --value 0 {{.zkevm_l2_sequencer_address}}; do
until cast send --rpc-url "{{.l1_rpc_url}}" --mnemonic "{{.l1_preallocated_mnemonic}}" --value 0 "{{.zkevm_l2_sequencer_address}}"; do
2>&1 echo "l1 rpc might nto be ready"
sleep 5
done

cast send --rpc-url {{.l1_rpc_url}} --mnemonic "{{.l1_preallocated_mnemonic}}" --value 100ether {{.zkevm_l2_sequencer_address}}
cast send --rpc-url {{.l1_rpc_url}} --mnemonic "{{.l1_preallocated_mnemonic}}" --value 100ether {{.zkevm_l2_aggregator_address}}
cast send --rpc-url {{.l1_rpc_url}} --mnemonic "{{.l1_preallocated_mnemonic}}" --value 100ether {{.zkevm_l2_admin_address}}
cast send --rpc-url "{{.l1_rpc_url}}" --mnemonic "{{.l1_preallocated_mnemonic}}" --value 100ether "{{.zkevm_l2_sequencer_address}}"
cast send --rpc-url "{{.l1_rpc_url}}" --mnemonic "{{.l1_preallocated_mnemonic}}" --value 100ether "{{.zkevm_l2_aggregator_address}}"
cast send --rpc-url "{{.l1_rpc_url}}" --mnemonic "{{.l1_preallocated_mnemonic}}" --value 100ether "{{.zkevm_l2_admin_address}}"


cp /opt/contract-deploy/deploy_parameters.json /opt/zkevm-contracts/deployment/v2/deploy_parameters.json
Expand Down Expand Up @@ -97,19 +98,19 @@ tomlq --slurpfile c combined.json -t '.NetworkConfig.PolygonRollupManagerAddress
tomlq --slurpfile c combined.json -t '.NetworkConfig.PolygonZkEVMAddress = $c[0].rollupAddress' bridge-config.toml > b.json; mv b.json bridge-config.toml
tomlq --slurpfile c combined.json -t '.NetworkConfig.L2PolygonBridgeAddresses = [$c[0].polygonZkEVMBridgeAddress]' bridge-config.toml > b.json; mv b.json bridge-config.toml

cast send --private-key {{.zkevm_l2_sequencer_private_key}} --legacy --rpc-url {{.l1_rpc_url}} "$(jq -r '.polTokenAddress' combined.json)" 'approve(address,uint256)(bool)' "$(jq -r '.rollupAddress' combined.json)" 1000000000000000000000000000 &> approval.out
cast send --private-key "{{.zkevm_l2_sequencer_private_key}}" --legacy --rpc-url "{{.l1_rpc_url}}" "$(jq -r '.polTokenAddress' combined.json)" "approve(address,uint256)(bool)" "$(jq -r '.rollupAddress' combined.json)" 1000000000000000000000000000 &> approval.out

polycli parseethwallet --hexkey {{.zkevm_l2_sequencer_private_key}} --password {{.zkevm_l2_keystore_password}} --keystore tmp.keys
polycli parseethwallet --hexkey "{{.zkevm_l2_sequencer_private_key}}" --password "{{.zkevm_l2_keystore_password}}" --keystore tmp.keys
mv tmp.keys/UTC* sequencer.keystore
chmod a+r sequencer.keystore
rm -rf tmp.keys

polycli parseethwallet --hexkey {{.zkevm_l2_aggregator_private_key}} --password {{.zkevm_l2_keystore_password}} --keystore tmp.keys
polycli parseethwallet --hexkey "{{.zkevm_l2_aggregator_private_key}}" --password "{{.zkevm_l2_keystore_password}}" --keystore tmp.keys
mv tmp.keys/UTC* aggregator.keystore
chmod a+r aggregator.keystore
rm -rf tmp.keys

polycli parseethwallet --hexkey {{.zkevm_l2_claimtxmanager_private_key}} --password {{.zkevm_l2_keystore_password}} --keystore tmp.keys
polycli parseethwallet --hexkey "{{.zkevm_l2_claimtxmanager_private_key}}" --password "{{.zkevm_l2_keystore_password}}" --keystore tmp.keys
mv tmp.keys/UTC* claimtxmanager.keystore
chmod a+r claimtxmanager.keystore
rm -rf tmp.keys
Expand Down

0 comments on commit 44f259d

Please sign in to comment.