-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·100 lines (88 loc) · 1.92 KB
/
run.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
POSITIONAL=()
CMD_ARGS=""
while [[ $# -gt 0 ]]
do
key="$1"
# struct Args {
# /// The CREATE2 factory address
# #[arg(long)]
# factory: String,
# /// The EOA deployer which will call the safeCreate2
# #[arg(long)]
# deployer: String,
# /// the init code hash
# #[arg(long)]
# init_code_hash: String,
# /// zeros to search for
# #[arg(long)]
# zeros: Option<u8>,
# /// number of rounds to search
# /// each round is a block of size = limit
# /// each round will increment the initial_salt_n by limit
# /// so the total number of attempts will be limit * num_rounds
# /// default is 100,000
# #[arg(long)]
# num_rounds: Option<u128>,
# /// number of attempts per round
# /// default is 1,000,000
# /// each round will increment the initial_salt_n by round_size
# /// so the total number of attempts will be round_size * num_rounds
# #[arg(long)]
# round_size: Option<u128>,
# /// number of threads to use
# /// default is 16
# #[arg(long)]
# num_threads: Option<usize>,
# }
case $key in
--factory)
FACTORY="$2"
CMD_ARGS+="--factory ${FACTORY} "
shift
shift
;;
--deployer)
DEPLOYER="$2"
CMD_ARGS+="--deployer ${DEPLOYER} "
shift
shift
;;
--init-code-hash)
INIT_CODE_HASH="$2"
CMD_ARGS+="--init-code-hash ${INIT_CODE_HASH} "
shift
shift
;;
--want-zeros)
WANT_ZEROS="$2"
CMD_ARGS+="--want-zeros ${WANT_ZEROS} "
shift
shift
;;
--num-rounds)
NUM_ROUNDS="$2"
CMD_ARGS+="--num-rounds ${NUM_ROUNDS} "
shift
shift
;;
--round-size)
ROUND_SIZE="$2"
shift
shift
;;
--num-threads)
NUM_THREADS="$2"
CMD_ARGS+="--num-threads ${NUM_THREADS} "
shift
shift
;;
*)
POSITIONAL+=("$1")
CMD_ARGS+="$1 "
shift
;;
esac
done
export CMD_ARGS
docker-compose up --force-recreate