-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·135 lines (107 loc) · 7.68 KB
/
deploy.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/env -S bash -eu
cat >/dev/null <<EOF
$SPN_SUPERPOSITION_URL
$SPN_SUPERPOSITION_KEY
$SPN_PROXY_ADMIN
$SPN_EMERGENCY_COUNCIL
$SPN_LONGTAIL_ADDR
$SPN_FUSDC_ADDR
$SPN_SARP_AI
EOF
log() {
>&2 echo $@
}
log "SPN_PROXY_ADMIN=$SPN_PROXY_ADMIN"
log "SPN_EMERGENCY_COUNCIL=$SPN_EMERGENCY_COUNCIL"
export SPN_SHARE_IMPL_ADDR="${SPN_SHARE_IMPL_ADDR:-$(./deploy-share-impl.sh)}"
[ -z "$SPN_SHARE_IMPL_ADDR" ] && exit 1
log "SPN_SHARE_IMPL_ADDR=$SPN_SHARE_IMPL_ADDR"
export SPN_LOCKUP_TOKEN_IMPL_ADDR="${SPN_LOCKUP_TOKEN_IMPL_ADDR:-$(./deploy-lockup-token-impl.sh)}"
log "SPN_LOCKUP_TOKEN_IMPL_ADDR=$SPN_LOCKUP_TOKEN_IMPL_ADDR"
export SPN_FACTORY_1_IMPL_ADDR="${SPN_FACTORY_1_IMPL_ADDR:-$(./deploy-stylus.sh contract-factory-1.wasm)}"
[ -z "$SPN_FACTORY_1_IMPL_ADDR" ] && exit 1
log "SPN_FACTORY_1_IMPL_ADDR=$SPN_FACTORY_1_IMPL_ADDR"
export SPN_FACTORY_2_IMPL_ADDR="${SPN_FACTORY_2_IMPL_ADDR:-$(./deploy-stylus.sh contract-factory-2.wasm)}"
[ -z "$SPN_FACTORY_2_IMPL_ADDR" ] && exit 1
log "SPN_FACTORY_2_IMPL_ADDR=$SPN_FACTORY_2_IMPL_ADDR"
export SPN_INFRA_MARKET_IMPL_ADDR="${SPN_INFRA_MARKET_IMPL_ADDR:-$(./deploy-stylus.sh contract-infra-market.wasm)}"
[ -z "$SPN_INFRA_MARKET_IMPL_ADDR" ] && exit 1
log "SPN_INFRA_MARKET_IMPL_ADDR=$SPN_INFRA_MARKET_IMPL_ADDR"
export SPN_LOCKUP_IMPL_ADDR="${SPN_LOCKUP_IMPL_ADDR:-$(./deploy-stylus.sh contract-lockup.wasm)}"
[ -z "$SPN_LOCKUP_IMPL_ADDR" ] && exit 1
log "SPN_LOCKUP_IMPL_ADDR=$SPN_LOCKUP_IMPL_ADDR"
export SPN_TRADING_DPM_EXTRAS_IMPL_ADDR="${SPN_TRADING_DPM_EXTRAS_IMPL_ADDR:-$(./deploy-stylus.sh contract-trading-dpm-extras.wasm)}"
[ -z "$SPN_TRADING_DPM_EXTRAS_IMPL_ADDR" ] && exit 1
log "SPN_TRADING_DPM_EXTRAS_IMPL_ADDR=$SPN_TRADING_DPM_EXTRAS_IMPL_ADDR"
export SPN_TRADING_DPM_MINT_IMPL_ADDR="${SPN_TRADING_DPM_MINT_IMPL_ADDR:-$(./deploy-stylus.sh contract-trading-dpm-mint.wasm)}"
[ -z "$SPN_TRADING_DPM_MINT_IMPL_ADDR" ] && exit 1
log "SPN_TRADING_DPM_MINT_IMPL_ADDR=$SPN_TRADING_DPM_MINT_IMPL_ADDR"
export SPN_TRADING_DPM_QUOTES_IMPL_ADDR="${SPN_TRADING_DPM_QUOTES_IMPL_ADDR:-$(./deploy-stylus.sh contract-trading-dpm-quotes.wasm)}"
[ -z "$SPN_TRADING_DPM_QUOTES_IMPL_ADDR" ] && exit 1
log "SPN_TRADING_DPM_QUOTES_IMPL_ADDR=$SPN_TRADING_DPM_QUOTES_IMPL_ADDR"
export SPN_TRADING_DPM_PRICE_IMPL_ADDR="${SPN_TRADING_DPM_PRICE_IMPL_ADDR:-$(./deploy-stylus.sh contract-trading-dpm-price.wasm)}"
[ -z "$SPN_TRADING_DPM_PRICE_IMPL_ADDR" ] && exit 1
log "SPN_TRADING_DPM_PRICE_IMPL_ADDR=$SPN_TRADING_DPM_PRICE_IMPL_ADDR"
export SPN_TRADING_AMM_EXTRAS_IMPL_ADDR="${SPN_TRADING_AMM_EXTRAS_IMPL_ADDR:-$(./deploy-stylus.sh contract-trading-amm-extras.wasm)}"
[ -z "$SPN_TRADING_AMM_EXTRAS_IMPL_ADDR" ] && exit 1
log "SPN_TRADING_AMM_EXTRAS_IMPL_ADDR=$SPN_TRADING_AMM_EXTRAS_IMPL_ADDR"
export SPN_TRADING_AMM_MINT_IMPL_ADDR="${SPN_TRADING_AMM_MINT_IMPL_ADDR:-$(./deploy-stylus.sh contract-trading-amm-mint.wasm)}"
[ -z "$SPN_TRADING_AMM_MINT_IMPL_ADDR" ] && exit 1
log "SPN_TRADING_AMM_MINT_IMPL_ADDR=$SPN_TRADING_AMM_MINT_IMPL_ADDR"
export SPN_TRADING_AMM_QUOTES_IMPL_ADDR="${SPN_TRADING_AMM_QUOTES_IMPL_ADDR:-$(./deploy-stylus.sh contract-trading-amm-quotes.wasm)}"
[ -z "$SPN_TRADING_AMM_QUOTES_IMPL_ADDR" ] && exit 1
log "SPN_TRADING_AMM_QUOTES_IMPL_ADDR=$SPN_TRADING_AMM_QUOTES_IMPL_ADDR"
export SPN_TRADING_AMM_PRICE_IMPL_ADDR="${SPN_TRADING_AMM_PRICE_IMPL_ADDR:-$(./deploy-stylus.sh contract-trading-amm-price.wasm)}"
[ -z "$SPN_TRADING_AMM_PRICE_IMPL_ADDR" ] && exit 1
log "SPN_TRADING_AMM_PRICE_IMPL_ADDR=$SPN_TRADING_AMM_PRICE_IMPL_ADDR"
export SPN_BEAUTY_CONTEST_IMPL_ADDR="${SPN_BEAUTY_CONTEST_IMPL_ADDR:-$(./deploy-stylus.sh contract-beauty-contest.wasm)}"
[ -z "$SPN_BEAUTY_CONTEST_IMPL_ADDR" ] && exit 1
log "SPN_BEAUTY_CONTEST_IMPL_ADDR=$SPN_BEAUTY_CONTEST_IMPL_ADDR"
json="$(./deploy-proxies.sh)"
export SPN_INFRA_MARKET_PROXY_ADDR="$(echo "$json" | jq -r .infraMarketAddr)"
log "SPN_INFRA_MARKET_PROXY_ADDR=$SPN_INFRA_MARKET_PROXY_ADDR"
export SPN_LOCKUP_PROXY_ADDR="$(echo "$json" | jq -r .lockupAddr)"
log "SPN_LOCKUP_PROXY_ADDR=$SPN_LOCKUP_PROXY_ADDR"
export SPN_FACTORY_PROXY_ADDR="$(echo "$json" | jq -r .factoryAddr)"
log "SPN_FACTORY_PROXY_ADDR=$SPN_FACTORY_PROXY_ADDR"
export SPN_BEAUTY_CONTEST_PROXY_ADDR="$(echo "$json" | jq -r .beautyContestProxyAddr)"
log "SPN_BEAUTY_CONTEST_PROXY_ADDR=$SPN_BEAUTY_CONTEST_PROXY_ADDR"
export SPN_LOCKUP_TOKEN_PROXY_ADDR="$(echo "$json" | jq -r .lockupTokenProxyAddr)"
log "SPN_LOCKUP_TOKEN_PROXY_ADDR=$SPN_LOCKUP_TOKEN_PROXY_ADDR"
export SPN_HELPER_FACTORY="${SPN_HELPER_FACTORY:-$(./deploy-helper-factory.sh)}"
[ -z "$SPN_HELPER_FACTORY" ] && exit 1
log "SPN_HELPER_FACTORY=$SPN_HELPER_FACTORY"
export SPN_LENSESV1="${SPN_LENSESV1:-$(./deploy-lenses.sh)}"
[ -z "$SPN_LENSESV1" ] && exit 1
log "SPN_LENSESV1=$SPN_LENSESV1"
>&2 cat <<EOF
| Deployment name | Deployment address |
|-------------------------------|--------------------------------------------|
| Proxy admin | \`$SPN_PROXY_ADMIN\` |
| Factory 1 implementation | \`$SPN_FACTORY_1_IMPL_ADDR\` |
| Factory 2 implementation | \`$SPN_FACTORY_2_IMPL_ADDR\` |
| Lockup implementation | \`$SPN_LOCKUP_IMPL_ADDR\` |
| Optimistic infra predict impl | \`$SPN_INFRA_MARKET_IMPL_ADDR\` |
| Trading DPM mint impl | \`$SPN_TRADING_DPM_MINT_IMPL_ADDR\` |
| Trading DPM extras impl | \`$SPN_TRADING_DPM_EXTRAS_IMPL_ADDR\` |
| Trading DPM quotes impl | \`$SPN_TRADING_DPM_QUOTES_IMPL_ADDR\` |
| Trading DPM price impl | \`$SPN_TRADING_DPM_PRICE_IMPL_ADDR\` |
| Trading AMM mint impl | \`$SPN_TRADING_AMM_MINT_IMPL_ADDR\` |
| Trading AMM extras impl | \`$SPN_TRADING_AMM_EXTRAS_IMPL_ADDR\` |
| Trading AMM quotes impl | \`$SPN_TRADING_AMM_QUOTES_IMPL_ADDR\` |
| Trading AMM price impl | \`$SPN_TRADING_AMM_PRICE_IMPL_ADDR\` |
| Share implementation | \`$SPN_SHARE_IMPL_ADDR\` |
| Lockup token implementation | \`$SPN_LOCKUP_TOKEN_IMPL_ADDR\` |
| Infrastructure market proxy | \`$SPN_INFRA_MARKET_PROXY_ADDR\` |
| Lockup proxy | \`$SPN_LOCKUP_PROXY_ADDR\` |
| Lockup token proxy | \`$SPN_LOCKUP_TOKEN_PROXY_ADDR\` |
| Factory proxy | \`$SPN_FACTORY_PROXY_ADDR\` |
| Helper factory | \`$SPN_HELPER_FACTORY\` |
| LensesV1 | \`$SPN_LENSESV1\` |
| Beauty contest implementation | \`$SPN_BEAUTY_CONTEST_IMPL_ADDR\` |
| Beauty contest proxy | \`$SPN_BEAUTY_CONTEST_PROXY_ADDR\` |
| Sarp AI Resolver | \`$SPN_SARP_AI\` |
EOF
cat <<EOF
{"proxyAdmin":"$SPN_PROXY_ADMIN", "factory1Implementation":"$SPN_FACTORY_1_IMPL_ADDR", "factory2Implementation":"$SPN_FACTORY_2_IMPL_ADDR", "lockupImplementation":"$SPN_LOCKUP_IMPL_ADDR", "optimisticInfraMarketImplementation":"$SPN_INFRA_MARKET_IMPL_ADDR", "tradingDpmMintImplementation":"$SPN_TRADING_DPM_MINT_IMPL_ADDR", "tradingDpmExtrasImplementation":"$SPN_TRADING_DPM_EXTRAS_IMPL_ADDR", "tradingDpmPriceImplementation":"$SPN_TRADING_DPM_PRICE_IMPL_ADDR", "tradingDpmQuotesImplementation":"$SPN_TRADING_DPM_QUOTES_IMPL_ADDR", "tradingAmmMintImplementation":"$SPN_TRADING_AMM_MINT_IMPL_ADDR", "tradingAmmExtrasImplementation":"$SPN_TRADING_AMM_EXTRAS_IMPL_ADDR", "tradingAmmPriceImplementation":"$SPN_TRADING_AMM_PRICE_IMPL_ADDR", "tradingAmmQuotesImplementation":"$SPN_TRADING_AMM_QUOTES_IMPL_ADDR", "shareImplementation":"$SPN_SHARE_IMPL_ADDR", "lockupTokenImplementation":"$SPN_LOCKUP_TOKEN_IMPL_ADDR", "beautyContest": "$SPN_BEAUTY_CONTEST_IMPL_ADDR", "infrastructureMarketProxy":"$SPN_INFRA_MARKET_PROXY_ADDR", "lockupProxyImpl":"$SPN_LOCKUP_PROXY_ADDR", "lockupProxyToken": "$SPN_FACTORY_PROXY_ADDR", "factoryProxy":"$SPN_FACTORY_PROXY_ADDR", "helperFactory": "$SPN_HELPER_FACTORY", "lensesV1": "$SPN_LENSESV1", "sarpAi": "$SPN_SARP_AI", "beautyContestProxy": "$SPN_BEAUTY_CONTEST_PROXY_ADDR" }
EOF