forked from paradigmxyz/paradigm-ctf-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·51 lines (42 loc) · 1.15 KB
/
build
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
#!/bin/bash
set -euo pipefail
build_challenge() {
name="$1"
solcv="${2:-}"
tag="gcr.io/paradigm-ctf/$name:latest"
if [ ! -z "$solcv" ]; then
pushd "$name/public"
ROOT_DIR="$(cd .. && pwd)"
SOLC_VERSION="$solcv" solc "private=$ROOT_DIR/private/" "public=$ROOT_DIR/public/contracts" --combined-json bin contracts/Setup.sol > deploy/compiled.bin
sed -i.bak "s^${ROOT_DIR}^^g" deploy/compiled.bin && rm deploy/compiled.bin.bak
popd
fi
docker build -t "$tag" "$name/public"
if [ ! -z "${DEPLOY:-}" ]; then
docker push "$tag"
fi
}
(cd challenge_base && docker build -t ctf/challenge_base:latest .)
(cd eth_challenge_base && docker build -t ctf/eth_challenge_base:latest .)
declare -a chals=(
"babycrypto"
"bank 0.4.24"
"vault 0.4.16"
"lockbox 0.4.24"
"babysandbox 0.7.0"
"market 0.7.0"
"upgrade 0.6.12"
"secure 0.5.12"
"jop 0.7.6"
"rever 0.8.0"
"swap 0.4.24"
"babyrev 0.4.24"
"bouncer 0.8.0"
"hello 0.8.0"
"farmer 0.8.0"
"yield_aggregator 0.8.0"
"broker 0.8.0"
)
for chal in "${chals[@]}"; do
build_challenge $chal
done