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

chore: configure fund amount #22

Merged
merged 1 commit into from
Oct 23, 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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ L1_CHAIN_ID=11155111
L1_CHAIN_NAME=Sepolia
L1_BLOCK_TIME=12
L1_FUNDED_PRIVATE_KEY=<DEPLOYER_PRIVATE_KEY>
# Amount to fund the ADMIN, BATCHER and PROPOSER addresses
# Specified as a string with a unit type. e.g. 1ether, 10gwei, 0.01ether
L1_FUND_AMOUNT=1ether

# L2
L2_CHAIN_ID=11155420
Expand Down
6 changes: 3 additions & 3 deletions scripts/l2/l2-gen-addresses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ echo "Generated new addresses and updated .env file."
# Function to fund an address
fund_address() {
local address=$1
local amount="10ether"
local amount=$2

cast send --private-key "$L1_FUNDED_PRIVATE_KEY" --rpc-url "$L1_RPC_URL" \
--value "$amount" "$address"
Expand All @@ -46,8 +46,8 @@ for role in ADMIN BATCHER PROPOSER; do
address="${!address_var}"

if [[ -n "$address" ]]; then
echo "Funding $role address: $address"
fund_address "$address"
echo "Funding $role address: $address with amount $L1_FUND_AMOUNT"
fund_address "$address" "$L1_FUND_AMOUNT"
echo
else
echo "Warning: $role address not found in .env file"
Expand Down