-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathpresets.go
65 lines (55 loc) · 1.72 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
package preset
import (
"math/big"
"os"
"github.com/ethereum/go-ethereum/params"
"github.com/synapsecns/sanguine/core"
"github.com/synapsecns/sanguine/ethergo/chain/client"
)
// GetSepolia gets the rinkeby preset backend.
func GetSepolia() Backend {
chainConfig := *params.AllDevChainProtocolChanges
chainConfig.ChainID = params.SepoliaChainConfig.ChainID
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("SEPOLIA_RPC_URL", "ws://0.0.0.0:8045"),
name: "Sepolia",
privateKey: os.Getenv("EXPORT_KEY"),
}
}
// GetBSCTestnet gets the bsc backend.
func GetBSCTestnet() Backend {
chainConfig := *params.AllDevChainProtocolChanges
chainConfig.ChainID = client.ChapelChainConfig.ChainID
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.AllDevChainProtocolChanges
chainConfig.ChainID = client.MaticMainnetConfig.ChainID
// london is not activated on bsc
chainConfig.LondonBlock = big.NewInt(0)
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("MATIC_RPC_URL", "ws://0.0.0.0:8047"),
name: "Matic",
privateKey: os.Getenv("EXPORT_KEY"),
}
}
// GetMaticMumbaiFakeSynDomain gets the matic backend.
func GetMaticMumbaiFakeSynDomain() Backend {
chainConfig := *params.AllDevChainProtocolChanges
chainConfig.ChainID = big.NewInt(int64(10))
// london is not activated on bsc
return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("MATIC_RPC_URL", "ws://0.0.0.0:8049"),
name: "Matic",
privateKey: os.Getenv("EXPORT_KEY"),
}
}