-
Notifications
You must be signed in to change notification settings - Fork 11
/
setupLocal.sh
executable file
·64 lines (53 loc) · 1.54 KB
/
setupLocal.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
61
62
63
64
#!/usr/bin/env bash
# use deterministic addresses
#source ./.env.example
set -a
. ./.env.example
set +a
fixtures=false
extrafixtures=false
# Parse command-line options
while getopts "fx" opt; do
case ${opt} in
f)
fixtures=true
;;
x)
extrafixtures=true
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
shift $((OPTIND -1))
FSC="forge script --chain 31337 --rpc-url $RPC_URL --use 0.8.18 --offline --broadcast --revert-strings debug"
# Deployments
$FSC script/dev/Ipnft.s.sol:DeployIpnftSuite
$FSC script/dev/Tokens.s.sol:DeployTokens
$FSC script/dev/Periphery.s.sol
$FSC script/dev/Tokenizer.s.sol:DeployTokenizer
$FSC script/dev/CrowdSale.s.sol:DeployStakedCrowdSale
$FSC script/dev/Tokens.s.sol:DeployFakeTokens
$FSC script/dev/CrowdSale.s.sol:DeployCrowdSale
# optionally: fixtures
if $fixtures; then
echo "Running fixture scripts."
$FSC script/dev/Ipnft.s.sol:FixtureIpnft
$FSC script/dev/Tokenizer.s.sol:FixtureTokenizer
fi
# optionally: extra fixtures
if $extrafixtures; then
echo "Running extra fixture scripts (crowdsales)."
$FSC script/dev/CrowdSale.s.sol:FixtureCrowdSale
echo "Waiting 15 seconds until claiming plain sale..."
sleep 16
cast rpc evm_mine
CROWDSALE=$PLAIN_CROWDSALE_ADDRESS $FSC script/dev/CrowdSale.s.sol:ClaimSale
$FSC script/dev/CrowdSale.s.sol:FixtureStakedCrowdSale
echo "Waiting 15 seconds until claiming staked sale..."
sleep 16
cast rpc evm_mine
CROWDSALE=$STAKED_LOCKING_CROWDSALE_ADDRESS $FSC script/dev/CrowdSale.s.sol:ClaimSale
fi