-
Notifications
You must be signed in to change notification settings - Fork 144
/
set_network_envs.sh
executable file
·59 lines (50 loc) · 1.88 KB
/
set_network_envs.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
#! /bin/bash
set -e
if [[ -z "$network" ]]; then
echo "WARN: No network specified, running on default network ethereum."
export NETWORK=ethereum
export BROWNIE_NETWORK=mainnet
export WEB3_PROVIDER=$WEB3_PROVIDER
export EXPLORER=$EXPLORER
export DEFAULT_EXPLORER=https://api.etherscan.io/api
elif [[ "$network" =~ ^ethereum$|^eth$|^ETH$|^mainnet$ ]]; then
export NETWORK=ethereum
export BROWNIE_NETWORK=mainnet
export WEB3_PROVIDER=$WEB3_PROVIDER
export EXPLORER=$EXPLORER
export DEFAULT_EXPLORER=https://api.etherscan.io/api
elif [[ "$network" =~ ^ftm$|^FTM$|^fantom$ ]]; then
export NETWORK=fantom
export BROWNIE_NETWORK=ftm-main
export WEB3_PROVIDER=$FTM_WEB3_PROVIDER
export EXPLORER=$FTM_EXPLORER
export DEFAULT_EXPLORER=https://api.ftmscan.com/api
elif [[ "$network" =~ ^gno$|^GNO$|^gnosis$ ]]; then
export NETWORK=gnosis
export BROWNIE_NETWORK=xdai-main
export WEB3_PROVIDER=$XDAI_WEB3_PROVIDER
export EXPLORER=$XDAI_EXPLORER
export DEFAULT_EXPLORER=https://blockscout.com/xdai/mainnet/api
elif [[ "$network" =~ ^arb$|^ARB$|^arbi$|^arbitrum$ ]]; then
export NETWORK=arbitrum
export BROWNIE_NETWORK=arbitrum-main
export WEB3_PROVIDER=$ARBI_WEB3_PROVIDER
export EXPLORER=$ARBI_EXPLORER
export DEFAULT_EXPLORER=https://api.arbiscan.io/api
elif [[ "$network" =~ ^op$|^OPTI$|^opti$|^optimism$ ]]; then
export NETWORK=optimism
export BROWNIE_NETWORK=optimism-main
export WEB3_PROVIDER=$OPTI_WEB3_PROVIDER
export EXPLORER=$OPTI_EXPLORER
export DEFAULT_EXPLORER=https://api-optimistic.etherscan.io/api
elif [[ "$network" =~ ^base$|^BASE$ ]]; then
export NETWORK=base
export BROWNIE_NETWORK=base-main
export WEB3_PROVIDER=$BASE_WEB3_PROVIDER
export EXPLORER=$BASE_EXPLORER
export DEFAULT_EXPLORER=https://api.basescan.org/api
else
echo "Error! Unsupported network $network specified!"
exit 1
fi
export PROJECT_PREFIX=yearn-exporter-worker-$NETWORK