-
Notifications
You must be signed in to change notification settings - Fork 4
/
mint_stake_token.sh
executable file
·54 lines (46 loc) · 1.47 KB
/
mint_stake_token.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
SEPOLIA_ENDPOINT=""
PRIV_KEY=""
BUMP_PRICE_PERCENT=""
# Parsing command line arguments
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--eth-rpc-endpoint)
SEPOLIA_ENDPOINT="$2"
shift # past argument
shift # past value
;;
--private-key)
PRIV_KEY="$2"
shift # past argument
shift # past value
;;
--bump-price-percent)
BUMP_PRICE_PERCENT="$2"
shift # past argument
shift # past value
;;
*)
shift # past argument
;;
esac
done
# Check if the required arguments are set
if [ -z "$SEPOLIA_ENDPOINT" ] || [ -z "$PRIV_KEY" ]; then
echo "Missing required arguments. Usage: $0 --eth-rpc-endpoint SEPOLIA_ENDPOINT --private-key PRIV_KEY [--bump-price-percent BUMP_PRICE_PERCENT]"
exit 1
fi
JSON_FILE="honest-validator/l2_chain_info.json"
# Extracting the rollup, stake token, and inbox addresses using jq
ROLLUP_ADDR=$(jq -r '.[0].rollup.rollup' $JSON_FILE)
STAKE_TOKEN_ADDR=$(jq -r '.[0].rollup."stake-token"' $JSON_FILE)
docker pull ghcr.io/rauljordan/bold-utils:testnet-candidate
# Running the Docker command
docker run --network=host ghcr.io/rauljordan/bold-utils:testnet-candidate mint-stake-token \
--validator-priv-keys=$PRIV_KEY \
--l1-endpoint=$SEPOLIA_ENDPOINT \
--rollup-address=$ROLLUP_ADDR \
--wei-to-mint=150000000000000000000 \
--stake-token-address=$STAKE_TOKEN_ADDR \
--bump-price-percent=${BUMP_PRICE_PERCENT:-100}