-
Notifications
You must be signed in to change notification settings - Fork 23
/
presets.go
109 lines (93 loc) · 2.95 KB
/
presets.go
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
package preset
import (
"math/big"
"os"
"github.com/ethereum/go-ethereum/params"
"github.com/synapsecns/sanguine/core"
"github.com/synapsecns/sanguine/ethergo/chain/client"
)
// GetRinkeby gets the rinkeby preset backend.
func GetRinkeby() Backend {
chainConfig := *params.AllCliqueProtocolChanges
chainConfig.ChainID = params.RinkebyChainConfig.ChainID
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("RINEKBY_RPC_URL", "ws://0.0.0.0:8045"),
name: "Rinkeby",
privateKey: os.Getenv("EXPORT_KEY"),
}
}
// GetBSCTestnet gets the bsc backend.
func GetBSCTestnet() Backend {
chainConfig := *params.AllCliqueProtocolChanges
chainConfig.ChainID = client.ChapelChainConfig.ChainID
// london is not activated on bsc
chainConfig.LondonBlock = nil
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("BSC_TESTNET_RPC_URL", "ws://0.0.0.0:8046"),
name: "BSC Testnet",
privateKey: os.Getenv("EXPORT_KEY"),
}
}
// GetMaticMumbai gets the matic backend.
func GetMaticMumbai() Backend {
chainConfig := *params.AllCliqueProtocolChanges
chainConfig.ChainID = client.MaticMainnetConfig.ChainID
// london is not activated on bsc
chainConfig.LondonBlock = nil
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("MATIC_RPC_URL", "ws://0.0.0.0:8047"),
name: "Matic",
privateKey: os.Getenv("EXPORT_KEY"),
}
}
// GetAvalancheLocal gets the avalanche local config.
// TODO: this should use avalanche.
func GetAvalancheLocal() Backend {
chainConfig := *client.AvalancheLocalChainConfig
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("MATIC_RPC_URL", "ws://0.0.0.0:8048"),
name: "Avalanche",
privateKey: os.Getenv("EXPORT_KEY"),
}
}
// GetMaticMumbaiFakeSynDomain gets the matic backend.
func GetMaticMumbaiFakeSynDomain() Backend {
chainConfig := *params.AllCliqueProtocolChanges
chainConfig.ChainID = big.NewInt(int64(10))
// london is not activated on bsc
chainConfig.LondonBlock = nil
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("MATIC_RPC_URL", "ws://0.0.0.0:8049"),
name: "Matic",
privateKey: os.Getenv("EXPORT_KEY"),
}
}
// GetRinkebyFakeSynDomain gets the rinkeby preset backend.
func GetRinkebyFakeSynDomain() Backend {
chainConfig := *params.AllCliqueProtocolChanges
chainConfig.ChainID = big.NewInt(int64(10))
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("RINEKBY_RPC_URL", "ws://0.0.0.0:8050"),
name: "Rinkeby",
privateKey: os.Getenv("EXPORT_KEY"),
}
}
// GetBSCTestnetFakeSynDomain gets the bsc backend.
func GetBSCTestnetFakeSynDomain() Backend {
chainConfig := *params.AllCliqueProtocolChanges
chainConfig.ChainID = big.NewInt(int64(10))
// london is not activated on bsc
chainConfig.LondonBlock = nil
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("BSC_TESTNET_RPC_URL", "ws://0.0.0.0:8051"),
name: "BSC Testnet",
privateKey: os.Getenv("EXPORT_KEY"),
}
}