-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.sh
executable file
·59 lines (48 loc) · 2.18 KB
/
build.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
#!/usr/bin/env bash
set -e
change_bytecode_to_json_and_move () {
cat_command="cat temp/$1.bin"
bytecode="`$cat_command`"; # read file contents into var
echo "\"$bytecode\"" > "resources/bytecode/$1.json" # write to file
}
mkdir -p temp
solc --overwrite --optimize --abi --bin contracts/OUTPACE.sol -o temp
solc --overwrite --optimize --allow-paths . --abi --bin contracts/deposits/Depositor.sol -o temp
solc --overwrite --optimize --allow-paths . --abi --bin contracts/deposits/Sweeper.sol -o temp
solc --overwrite --abi --bin contracts/Identity.sol -o temp
solc --overwrite --abi --allow-paths . contracts/wallet/QuickAccManager.sol -o temp
solc --overwrite --abi --allow-paths . contracts/wallet/RemainingBalancesOracle.sol -o temp
solc --overwrite --abi --allow-paths . contracts/wallet/Batcher.sol -o temp
solc --overwrite --abi contracts/IdentityFactory.sol -o temp
solc --overwrite --abi contracts/StakingPool.sol -o temp
# create dir if not exists
mkdir -p resources abi
# ABIs
mv temp/OUTPACE.abi abi/OUTPACE.json
mv temp/Identity.abi abi/Identity5.2.json
mv temp/IdentityFactory.abi abi/IdentityFactory5.2.json
mv temp/StakingPool.abi abi/StakingPool.json
mv temp/QuickAccManager.abi abi/QuickAccManager.json
mv temp/RemainingBalancesOracle.abi abi/RemainingBalancesOracle.json
mv temp/Batcher.abi abi/Batcher.json
# Identity bin file
#### we require this file for the Rust implementation
cp temp/Identity.bin resources/bytecode/Identity5.2.bin
# copy the Identity.bin to Identity5.2.bin because `change_bytecode_to_json_and_move`
cp temp/Identity.bin temp/Identity5.2.bin
change_bytecode_to_json_and_move "Identity5.2"
# Sweeper abi & bin file
mv temp/Sweeper.abi abi/Sweeper.json
#### we require this file for the Rust implementation
cp temp/Sweeper.bin resources/bytecode/Sweeper.bin
change_bytecode_to_json_and_move "Sweeper"
# Depositor abi & bin file
mv temp/Depositor.abi abi/Depositor.json
#### we require this file for the Rust implementation
cp temp/Depositor.bin resources/bytecode/Depositor.bin
change_bytecode_to_json_and_move "Depositor"
# OUTPACE bytecode
cp temp/OUTPACE.bin resources/bytecode/OUTPACE.bin
change_bytecode_to_json_and_move "OUTPACE"
# Remove the temp folder
rm -r temp/