-
Notifications
You must be signed in to change notification settings - Fork 5
/
Justfile
60 lines (40 loc) · 1.12 KB
/
Justfile
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
default:
just --list
start:
yarn dev
install:
yarn
build:
yarn build
get-contracts gcpath="../gogopool":
#!/bin/zsh
echo $gcpath
echo {{gcpath}}
CURRENT=$PWD
CONTRACTS=("Oracle" "Storage" "MinipoolManager" "TokenGGP" "TokenggAVAX" "Staking" "OneInchMock" "RewardsPool" "ClaimNodeOp" "ProtocolDAO")
cd {{gcpath}}
if [[ ! -d "node_modules" ]]; then
yarn
fi
forge build
cd $CURRENT
rm -rf src/contracts
mkdir -p src/contracts
for contract in "${CONTRACTS[@]}"; do
CONTRACT_PATH={{gcpath}}/artifacts-forge/$contract.sol/$contract.json
echo $CONTRACT_PATH
CURRENT_CONTRACT="src/contracts/$contract.ts"
cp $CONTRACT_PATH src/contracts
mv src/contracts/$contract.json src/contracts/$contract.ts
sed -i '' '1,2d' $CURRENT_CONTRACT
sed -i '' "1i\
const $contract = [" $CURRENT_CONTRACT
sed -i '' '/"bytecode":/,$d' $CURRENT_CONTRACT
sed -i '' '$d' $CURRENT_CONTRACT
sed -i '' '$a\
] as const
' $CURRENT_CONTRACT
echo "" >> $CURRENT_CONTRACT
echo "export default $contract" >> $CURRENT_CONTRACT
done
prettier --write src/contracts/*