From 51bc39645be15c44d36b705657d006885822fc5b Mon Sep 17 00:00:00 2001 From: Adw8 Date: Fri, 30 Aug 2024 10:48:13 +0530 Subject: [PATCH] Make funding amount for proposer and batcher on l2 configurable --- compose/docker-compose-fixturenet-optimism.yml | 2 ++ config/fixturenet-optimism/l1-params.env | 2 ++ .../optimism-contracts/deploy-contracts.sh | 8 +++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/compose/docker-compose-fixturenet-optimism.yml b/compose/docker-compose-fixturenet-optimism.yml index b260900..460b9db 100644 --- a/compose/docker-compose-fixturenet-optimism.yml +++ b/compose/docker-compose-fixturenet-optimism.yml @@ -17,6 +17,8 @@ services: CERC_L1_ACCOUNTS_CSV_URL: ${CERC_L1_ACCOUNTS_CSV_URL} CERC_L1_ADDRESS: ${CERC_L1_ADDRESS} CERC_L1_PRIV_KEY: ${CERC_L1_PRIV_KEY} + CERC_L2_PROPOSER_AMOUNT: ${CERC_L2_PROPOSER_AMOUNT} + CERC_L2_BATCHER_AMOUNT: ${CERC_L2_BATCHER_AMOUNT} volumes: - ../config/network/wait-for-it.sh:/app/packages/contracts-bedrock/wait-for-it.sh - ../config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh:/app/packages/contracts-bedrock/deploy-contracts.sh diff --git a/config/fixturenet-optimism/l1-params.env b/config/fixturenet-optimism/l1-params.env index 5353e62..ae3b03b 100644 --- a/config/fixturenet-optimism/l1-params.env +++ b/config/fixturenet-optimism/l1-params.env @@ -10,3 +10,5 @@ DEFAULT_CERC_L1_PORT=8545 # that are used to send balance to Optimism Proxy contract # (enables them to do transactions on L2) DEFAULT_CERC_L1_ACCOUNTS_CSV_URL="http://fixturenet-eth-bootnode-geth:9898/accounts.csv" +DEFAULT_CERC_L2_PROPOSER_AMOUNT="0.2ether" +DEFAULT_CERC_L2_BATCHER_AMOUNT="0.1ether" diff --git a/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh b/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh index 5146141..d2fb9e1 100755 --- a/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh +++ b/config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh @@ -9,6 +9,9 @@ CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}" CERC_L1_ACCOUNTS_CSV_URL="${CERC_L1_ACCOUNTS_CSV_URL:-${DEFAULT_CERC_L1_ACCOUNTS_CSV_URL}}" +CERC_L2_PROPOSER_AMOUNT="${CERC_L2_PROPOSER_AMOUNT:-${DEFAULT_CERC_L2_PROPOSER_AMOUNT}}" +CERC_L2_BATCHER_AMOUNT="${CERC_L2_BATCHER_AMOUNT:-${DEFAULT_CERC_L2_BATCHER_AMOUNT}}" + export DEPLOYMENT_CONTEXT="$CERC_L1_CHAIN_ID" # Optional create2 salt for deterministic deployment of contract implementations export IMPL_SALT=$(openssl rand -hex 32) @@ -68,9 +71,8 @@ if [ -n "$CERC_L1_ADDRESS" ] && [ -n "$CERC_L1_PRIV_KEY" ]; then echo "Funding accounts." wait_for_block 1 300 - cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value 5ether $PROPOSER --private-key $ADMIN_KEY - cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value 10ether $BATCHER --private-key $ADMIN_KEY - cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value 2ether $SEQ --private-key $ADMIN_KEY + cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value $CERC_L2_PROPOSER_AMOUNT $PROPOSER --private-key $ADMIN_KEY + cast send --from $ADMIN --rpc-url $CERC_L1_RPC --value $CERC_L2_BATCHER_AMOUNT $BATCHER --private-key $ADMIN_KEY else curl -o accounts.csv $CERC_L1_ACCOUNTS_CSV_URL # Admin