-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsync.sh
executable file
·60 lines (51 loc) · 1.34 KB
/
sync.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
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <evk_periphery_repo_path>"
exit 1
fi
evk_periphery_repo_path=$1
abis_path="./abis"
interfaces_path="./interfaces"
mkdir -p $abis_path $interfaces_path
contracts=(
"TrackingRewardStreams"
"GenericFactory"
"EVault"
"EthereumVaultConnector"
"ProtocolConfig"
"SequenceRegistry"
"BasePerspective"
"SnapshotRegistry"
"FeeFlowController"
"EulerKinkIRMFactory"
"EulerRouterFactory"
"SwapVerifier"
"Swapper"
"AccountLens"
"IRMLens"
"OracleLens"
"VaultLens"
"UtilsLens"
"EulerEarnVaultLens"
"IRMLinearKink"
"EulerRouter"
"TermsOfUseSigner"
"RewardToken"
"EdgeFactory"
)
for contract in "${contracts[@]}"; do
jq '.abi' $evk_periphery_repo_path/out/${contract}.sol/${contract}.json | jq '.' > $abis_path/${contract}.json
done
contracts=(
"EulerEarn"
"EulerEarnFactory"
)
for contract in "${contracts[@]}"; do
jq '.abi' $evk_periphery_repo_path/out-euler-earn/${contract}.sol/${contract}.json | jq '.' > $abis_path/${contract}.json
done
for abi_file in "$abis_path"/*.json; do
contract=$(basename "$abi_file" .json)
cast interface --name I${contract} --pragma ^0.8.0 -o $interfaces_path/I${contract}.sol $abi_file
sed -i '' 's/\/\/ SPDX-License-Identifier: UNLICENSED/\/\/ SPDX-License-Identifier: MIT/' "$interfaces_path/I${contract}.sol"
done
node chains.js