-
Notifications
You must be signed in to change notification settings - Fork 32
/
declare-all.sh
executable file
·57 lines (47 loc) · 1.6 KB
/
declare-all.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
#!/bin/bash
# Function to print usage and exit
print_usage_and_exit() {
echo "Usage: $0 --network {sepolia,goerli-1,mainnet}"
exit 1
}
# Ensure there are exactly two arguments
if [ "$#" -ne 2 ]; then
print_usage_and_exit
fi
# Parse the arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--network)
NETWORK="$2"
shift
;;
*)
echo "Unknown parameter passed: $1"
print_usage_and_exit
;;
esac
shift
done
# Ensure network is valid
if [ "$NETWORK" != "sepolia" -a "$NETWORK" != "mainnet" -a "$NETWORK" != "goerli-1" ]; then
echo "Invalid network: $NETWORK"
print_usage_and_exit
fi
scarb build
declare_class_hash() {
local class_name=$1
starkli declare --watch --network "$NETWORK" --keystore-password "$STARKNET_KEYSTORE_PASSWORD" --casm-file "target/dev/governance_${class_name}.compiled_contract_class.json" "target/dev/governance_${class_name}.contract_class.json"
}
echo "Declaring AirdropClaimCheck"
AIRDROP_CLAIM_CHECK_CLASS_HASH=$(declare_class_hash AirdropClaimCheck)
echo "Declaring Airdrop"
AIRDROP_CLASS_HASH=$(declare_class_hash Airdrop)
echo "Declaring Staker"
STAKER_CLASS_HASH=$(declare_class_hash Staker)
echo "Declaring Governor"
GOVERNOR_CLASS_HASH=$(declare_class_hash Governor)
echo "AirdropClaimCheck @ $AIRDROP_CLAIM_CHECK_CLASS_HASH"
echo "Airdrop @ $AIRDROP_CLASS_HASH"
echo "Staker @ $STAKER_CLASS_HASH"
echo "Governor @ $GOVERNOR_CLASS_HASH"
# starkli deploy --max-fee 0.001 --watch --network "$NETWORK" --keystore-password "$STARKNET_KEYSTORE_PASSWORD" "$AIRDROP_CLAIM_CHECK_CLASS_HASH"