Skip to content

Commit a66b77a

Browse files
feat_: integrate base chain
Signed-off-by: Brian Sztamfater <[email protected]>
1 parent e9abf16 commit a66b77a

File tree

36 files changed

+4390
-147
lines changed

36 files changed

+4390
-147
lines changed

.codeclimate.yml

+1
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ exclude_patterns:
4242
- "static/"
4343
- "t/"
4444
- "images/qr-assets.go"
45+
- "contracts/hop/l2Contracts/l2BaseBridge/l2BaseBridge.go"

api/backend_test.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -1527,8 +1527,10 @@ func TestWalletConfigOnLoginAccount(t *testing.T) {
15271527
alchemyArbitrumSepoliaToken := "alchemy-arbitrum-sepolia-token"
15281528
alchemyOptimismMainnetToken := "alchemy-optimism-mainnet-token"
15291529
alchemyOptimismSepoliaToken := "alchemy-optimism-sepolia-token"
1530-
raribleMainnetAPIKey := "rarible-mainnet-api-key" // nolint: gosec
1531-
raribleTestnetAPIKey := "rarible-testnet-api-key" // nolint: gosec
1530+
alchemyBaseMainnetToken := "alchemy-base-mainnet-token" // nolint: gosec
1531+
alchemyBaseSepoliaToken := "alchemy-base-sepolia-token" // nolint: gosec
1532+
raribleMainnetAPIKey := "rarible-mainnet-api-key" // nolint: gosec
1533+
raribleTestnetAPIKey := "rarible-testnet-api-key" // nolint: gosec
15321534

15331535
b := NewGethStatusBackend(tt.MustCreateTestLogger())
15341536
createAccountRequest := &requests.CreateAccount{
@@ -1565,6 +1567,8 @@ func TestWalletConfigOnLoginAccount(t *testing.T) {
15651567
AlchemyArbitrumSepoliaToken: alchemyArbitrumSepoliaToken,
15661568
AlchemyOptimismMainnetToken: alchemyOptimismMainnetToken,
15671569
AlchemyOptimismSepoliaToken: alchemyOptimismSepoliaToken,
1570+
AlchemyBaseMainnetToken: alchemyBaseMainnetToken,
1571+
AlchemyBaseSepoliaToken: alchemyBaseSepoliaToken,
15681572
RaribleMainnetAPIKey: raribleMainnetAPIKey,
15691573
RaribleTestnetAPIKey: raribleTestnetAPIKey,
15701574
},
@@ -1585,6 +1589,8 @@ func TestWalletConfigOnLoginAccount(t *testing.T) {
15851589
require.Equal(t, b.config.WalletConfig.AlchemyAPIKeys[ArbitrumSepoliaChainID], alchemyArbitrumSepoliaToken)
15861590
require.Equal(t, b.config.WalletConfig.AlchemyAPIKeys[OptimismChainID], alchemyOptimismMainnetToken)
15871591
require.Equal(t, b.config.WalletConfig.AlchemyAPIKeys[OptimismSepoliaChainID], alchemyOptimismSepoliaToken)
1592+
require.Equal(t, b.config.WalletConfig.AlchemyAPIKeys[BaseChainID], alchemyBaseMainnetToken)
1593+
require.Equal(t, b.config.WalletConfig.AlchemyAPIKeys[BaseSepoliaChainID], alchemyBaseSepoliaToken)
15881594
require.Equal(t, b.config.WalletConfig.RaribleMainnetAPIKey, raribleMainnetAPIKey)
15891595
require.Equal(t, b.config.WalletConfig.RaribleTestnetAPIKey, raribleTestnetAPIKey)
15901596

@@ -1846,6 +1852,8 @@ func TestRestoreKeycardAccountAndLogin(t *testing.T) {
18461852
"alchemyArbitrumSepoliaToken": "",
18471853
"alchemyOptimismMainnetToken": "",
18481854
"alchemyOptimismSepoliaToken": "",
1855+
"alchemyBaseMainnetToken": "",
1856+
"alchemyBaseSepoliaToken": "",
18491857
},
18501858
"torrentConfigEnabled": false,
18511859
"torrentConfigPort": 0,

api/default_networks.go

+50
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ const (
1616
OptimismSepoliaChainID uint64 = 11155420
1717
ArbitrumChainID uint64 = 42161
1818
ArbitrumSepoliaChainID uint64 = 421614
19+
BaseChainID uint64 = 8453
20+
BaseSepoliaChainID uint64 = 84532
1921
sntSymbol = "SNT"
2022
sttSymbol = "STT"
2123
)
@@ -114,6 +116,52 @@ func optimismSepolia(stageName string) params.Network {
114116
}
115117
}
116118

119+
func base(stageName string) params.Network {
120+
return params.Network{
121+
ChainID: BaseChainID,
122+
ChainName: "Base",
123+
DefaultRPCURL: fmt.Sprintf("https://%s.api.status.im/nodefleet/base/mainnet/", stageName),
124+
DefaultFallbackURL: fmt.Sprintf("https://%s.api.status.im/infura/base/mainnet/", stageName),
125+
DefaultFallbackURL2: fmt.Sprintf("https://%s.api.status.im/grove/base/mainnet/", stageName),
126+
RPCURL: "https://base-mainnet.infura.io/v3/",
127+
FallbackURL: "https://base-archival.rpc.grove.city/v1/",
128+
BlockExplorerURL: "https://basescan.org",
129+
IconURL: "network/Network=Base",
130+
ChainColor: "#0052FF",
131+
ShortName: "base",
132+
NativeCurrencyName: "Ether",
133+
NativeCurrencySymbol: "ETH",
134+
NativeCurrencyDecimals: 18,
135+
IsTest: false,
136+
Layer: 2,
137+
Enabled: true,
138+
RelatedChainID: BaseSepoliaChainID,
139+
}
140+
}
141+
142+
func baseSepolia(stageName string) params.Network {
143+
return params.Network{
144+
ChainID: BaseSepoliaChainID,
145+
ChainName: "Base",
146+
DefaultRPCURL: fmt.Sprintf("https://%s.api.status.im/nodefleet/base/sepolia/", stageName),
147+
DefaultFallbackURL: fmt.Sprintf("https://%s.api.status.im/infura/base/sepolia/", stageName),
148+
DefaultFallbackURL2: fmt.Sprintf("https://%s.api.status.im/grove/base/sepolia/", stageName),
149+
RPCURL: "https://base-sepolia.infura.io/v3/",
150+
FallbackURL: "https://base-sepolia-archival.rpc.grove.city/v1/",
151+
BlockExplorerURL: "https://sepolia.basescan.org/",
152+
IconURL: "network/Network=Base",
153+
ChainColor: "#0052FF",
154+
ShortName: "base",
155+
NativeCurrencyName: "Ether",
156+
NativeCurrencySymbol: "ETH",
157+
NativeCurrencyDecimals: 18,
158+
IsTest: true,
159+
Layer: 2,
160+
Enabled: false,
161+
RelatedChainID: BaseChainID,
162+
}
163+
}
164+
117165
func arbitrum(stageName string) params.Network {
118166
return params.Network{
119167
ChainID: ArbitrumChainID,
@@ -168,6 +216,8 @@ func defaultNetworks(stageName string) []params.Network {
168216
optimismSepolia(stageName),
169217
arbitrum(stageName),
170218
arbitrumSepolia(stageName),
219+
base(stageName),
220+
baseSepolia(stageName),
171221
}
172222
}
173223

api/default_networks_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestBuildDefaultNetworks(t *testing.T) {
2323

2424
actualNetworks := BuildDefaultNetworks(&request.WalletSecretsConfig)
2525

26-
require.Len(t, actualNetworks, 6)
26+
require.Len(t, actualNetworks, 8)
2727

2828
for _, n := range actualNetworks {
2929
var err error
@@ -34,6 +34,8 @@ func TestBuildDefaultNetworks(t *testing.T) {
3434
case OptimismSepoliaChainID:
3535
case ArbitrumChainID:
3636
case ArbitrumSepoliaChainID:
37+
case BaseChainID:
38+
case BaseSepoliaChainID:
3739
default:
3840
err = errors.Errorf("unexpected chain id: %d", n.ChainID)
3941
}
@@ -63,7 +65,7 @@ func TestBuildDefaultNetworksGanache(t *testing.T) {
6365

6466
actualNetworks := BuildDefaultNetworks(&request.WalletSecretsConfig)
6567

66-
require.Len(t, actualNetworks, 6)
68+
require.Len(t, actualNetworks, 8)
6769

6870
for _, n := range actualNetworks {
6971
require.True(t, strings.Contains(n.RPCURL, ganacheURL))

api/defaults.go

+6
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ func buildWalletConfig(request *requests.WalletSecretsConfig, statusProxyEnabled
215215
if request.AlchemyOptimismSepoliaToken != "" {
216216
walletConfig.AlchemyAPIKeys[OptimismSepoliaChainID] = request.AlchemyOptimismSepoliaToken
217217
}
218+
if request.AlchemyBaseMainnetToken != "" {
219+
walletConfig.AlchemyAPIKeys[baseChainID] = request.AlchemyBaseMainnetToken
220+
}
221+
if request.AlchemyBaseSepoliaToken != "" {
222+
walletConfig.AlchemyAPIKeys[baseSepoliaChainID] = request.AlchemyBaseSepoliaToken
223+
}
218224
if request.StatusProxyMarketUser != "" {
219225
walletConfig.StatusProxyMarketUser = request.StatusProxyMarketUser
220226
}

contracts/balancechecker/address.go

+2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ var contractDataByChainID = map[uint64]common.Address{
1212
1: common.HexToAddress("0x040EA8bFE441597849A9456182fa46D38B75BC05"), // mainnet
1313
10: common.HexToAddress("0x55bD303eA3D50FC982A8a5b43972d7f38D129bbF"), // optimism
1414
42161: common.HexToAddress("0x54764eF12d29b249fDC7FC3caDc039955A396A8e"), // arbitrum
15+
8453: common.HexToAddress("0x84A1C94fcc5EcFA292771f6aE7Fbf24ec062D34e"), // base
1516
11155111: common.HexToAddress("0x55bD303eA3D50FC982A8a5b43972d7f38D129bbF"), // sepolia
1617
421614: common.HexToAddress("0x54764eF12d29b249fDC7FC3caDc039955A396A8e"), // sepolia arbitrum
1718
11155420: common.HexToAddress("0x55bD303eA3D50FC982A8a5b43972d7f38D129bbF"), // sepolia optimism
19+
84532: common.HexToAddress("0x84A1C94fcc5EcFA292771f6aE7Fbf24ec062D34e"), // sepolia base
1820
777333: common.HexToAddress("0x0000000000000000000000000000000010777333"), // unit tests
1921
}
2022

contracts/ethscan/address.go

+2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ var contractDataByChainID = map[uint64]ContractData{
1717
1: {common.HexToAddress("0x08A8fDBddc160A7d5b957256b903dCAb1aE512C5"), 12_194_222}, // mainnet
1818
10: {common.HexToAddress("0x9e5076df494fc949abc4461f4e57592b81517d81"), 34_421_097}, // optimism
1919
42161: {common.HexToAddress("0xbb85398092b83a016935a17fc857507b7851a071"), 70_031_945}, // arbitrum
20+
8453: {common.HexToAddress("0xc68c1e011cfE059EB94C8915c291502288704D89"), 24_567_587}, // base
2021
777333: {common.HexToAddress("0x0000000000000000000000000000000000777333"), 50}, // unit tests
2122
11155111: {common.HexToAddress("0xec21ebe1918e8975fc0cd0c7747d318c00c0acd5"), 4_366_506}, // sepolia
2223
421614: {common.HexToAddress("0xec21Ebe1918E8975FC0CD0c7747D318C00C0aCd5"), 553_947}, // sepolia arbitrum
2324
11155420: {common.HexToAddress("0xec21ebe1918e8975fc0cd0c7747d318c00c0acd5"), 7_362_011}, // sepolia optimism
25+
84532: {common.HexToAddress("0xc68c1e011cfE059EB94C8915c291502288704D89"), 20_078_235}, // sepolia base
2426
}
2527

2628
func ContractAddress(chainID uint64) (common.Address, error) {

contracts/gas-price-oracle/address.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ var ErrorNotAvailableOnChainID = errors.New("not available for chainID")
1313
var contractAddressByChainID = map[uint64]common.Address{
1414
wallet_common.OptimismMainnet: common.HexToAddress("0x8527c030424728cF93E72bDbf7663281A44Eeb22"),
1515
wallet_common.OptimismSepolia: common.HexToAddress("0x5230210c2b4995FD5084b0F5FD0D7457aebb5010"),
16+
wallet_common.BaseMainnet: common.HexToAddress("0x8527c030424728cF93E72bDbf7663281A44Eeb22"),
17+
wallet_common.BaseSepolia: common.HexToAddress("0x5230210c2b4995FD5084b0F5FD0D7457aebb5010"),
1618
}
1719

1820
func ContractAddress(chainID uint64) (common.Address, error) {

contracts/hop/L2_BaseBrige.abi

+1
Large diffs are not rendered by default.

contracts/hop/address.go

+44
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ var hopBridgeContractAddresses = map[string]map[uint64]map[string]common.Address
4848
CctpL2Bridge: common.HexToAddress("0x6504BFcaB789c35325cA4329f1f41FaC340bf982"),
4949
CctpMessageTransmitter: common.HexToAddress("0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca"),
5050
},
51+
walletCommon.BaseMainnet: {
52+
L2CanonicalToken: common.HexToAddress("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 "),
53+
CctpL2Bridge: common.HexToAddress("0xe7F40BF16AB09f4a6906Ac2CAA4094aD2dA48Cc2"),
54+
CctpMessageTransmitter: common.HexToAddress("0xAD09780d193884d503182aD4588450C416D6F9D4"),
55+
},
5156
walletCommon.EthereumSepolia: {
5257
L1CanonicalToken: common.HexToAddress("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
5358
CctpL1Bridge: common.HexToAddress("0x05fda2db623fa6a89a2db33550848ab2006a4427"),
@@ -60,6 +65,10 @@ var hopBridgeContractAddresses = map[string]map[uint64]map[string]common.Address
6065
L2CanonicalToken: common.HexToAddress("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
6166
CctpL2Bridge: common.HexToAddress("0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5"),
6267
},
68+
walletCommon.BaseSepolia: {
69+
L2CanonicalToken: common.HexToAddress("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
70+
CctpL2Bridge: common.HexToAddress("0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5"),
71+
},
6372
},
6473
"USDC.e": {
6574
walletCommon.EthereumMainnet: {
@@ -94,6 +103,19 @@ var hopBridgeContractAddresses = map[string]map[uint64]map[string]common.Address
94103
L2SaddleSwap: common.HexToAddress("0x10541b07d8Ad2647Dc6cD67abd4c03575dade261"),
95104
L2SaddleLpToken: common.HexToAddress("0xB67c014FA700E69681a673876eb8BAFAA36BFf71"),
96105
},
106+
walletCommon.BaseMainnet: {
107+
L1CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
108+
L1MessengerWrapper: common.HexToAddress("0x4a55e8e407609A3046804ca500BeF6F5ebaCb6F9"),
109+
L2CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
110+
L2CanonicalToken: common.HexToAddress("0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"),
111+
L2Bridge: common.HexToAddress("0x46ae9BaB8CEA96610807a275EBD36f8e916b5C61"),
112+
CctpL2Bridge: common.HexToAddress("0xe7F40BF16AB09f4a6906Ac2CAA4094aD2dA48Cc2"),
113+
CctpMessageTransmitter: common.HexToAddress("0xAD09780d193884d503182aD4588450C416D6F9D4"),
114+
L2HopBridgeToken: common.HexToAddress("0x74fa978EaFFa312bC92e76dF40FcC1bFE7637Aeb"),
115+
L2AmmWrapper: common.HexToAddress("0x7D269D3E0d61A05a0bA976b7DBF8805bF844AF3F"),
116+
L2SaddleSwap: common.HexToAddress("0x022C5cE6F1Add7423268D41e08Df521D5527C2A0"),
117+
L2SaddleLpToken: common.HexToAddress("0x3b507422EBe64440f03BCbE5EEe4bdF76517f320"),
118+
},
97119
walletCommon.EthereumSepolia: {
98120
L1CanonicalToken: common.HexToAddress("0x95B01328BA6f4de261C4907fB35eE3c4968e9CEF"),
99121
CctpL1Bridge: common.HexToAddress("0x98bc5b835686e1a00e6c2168af162905899e93d6"),
@@ -191,6 +213,17 @@ var hopBridgeContractAddresses = map[string]map[uint64]map[string]common.Address
191213
L2SaddleSwap: common.HexToAddress("0x652d27c0F72771Ce5C76fd400edD61B406Ac6D97"),
192214
L2SaddleLpToken: common.HexToAddress("0x59745774Ed5EfF903e615F5A2282Cae03484985a"),
193215
},
216+
walletCommon.BaseMainnet: {
217+
L1CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
218+
L1MessengerWrapper: common.HexToAddress("0x17B5ACE1cD6b0d033431873826937F499Eec2C95"),
219+
L2CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
220+
L2CanonicalToken: common.HexToAddress("0x4200000000000000000000000000000000000006"),
221+
L2Bridge: common.HexToAddress("0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a"),
222+
L2HopBridgeToken: common.HexToAddress("0xC1985d7a3429cDC85E59E2E4Fcc805b857e6Ee2E"),
223+
L2AmmWrapper: common.HexToAddress("0x10541b07d8Ad2647Dc6cD67abd4c03575dade261"),
224+
L2SaddleSwap: common.HexToAddress("0x0ce6c85cF43553DE10FC56cecA0aef6Ff0DD444d"),
225+
L2SaddleLpToken: common.HexToAddress("0x0ce6c85cF43553DE10FC56cecA0aef6Ff0DD444d"),
226+
},
194227
},
195228
"HOP": {
196229
walletCommon.EthereumMainnet: {
@@ -219,6 +252,17 @@ var hopBridgeContractAddresses = map[string]map[uint64]map[string]common.Address
219252
L2SaddleSwap: common.HexToAddress("0x0000000000000000000000000000000000000000"),
220253
L2SaddleLpToken: common.HexToAddress("0x0000000000000000000000000000000000000000"),
221254
},
255+
walletCommon.BaseMainnet: {
256+
L1CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
257+
L1MessengerWrapper: common.HexToAddress("0x86eD3B8AD6b721fD3a2Fa73c227987Fb9AD3D1Ae"),
258+
L2CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
259+
L2CanonicalToken: common.HexToAddress("0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"),
260+
L2Bridge: common.HexToAddress("0xe22D2beDb3Eca35E6397e0C6D62857094aA26F52"),
261+
L2HopBridgeToken: common.HexToAddress("0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"),
262+
L2AmmWrapper: common.HexToAddress("0x0000000000000000000000000000000000000000"),
263+
L2SaddleSwap: common.HexToAddress("0x0000000000000000000000000000000000000000"),
264+
L2SaddleLpToken: common.HexToAddress("0x0000000000000000000000000000000000000000"),
265+
},
222266
},
223267
"SNX": {
224268
walletCommon.EthereumMainnet: {

contracts/hop/l2Contracts/l2BaseBridge/l2BaseBridge.go

+3,392
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mobile/callog/status_request_log.go

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ var sensitiveKeys = []string{
3232
"alchemyArbitrumSepoliaToken",
3333
"alchemyOptimismMainnetToken",
3434
"alchemyOptimismSepoliaToken",
35+
"alchemyBaseMainnetToken",
36+
"alchemyBaseSepoliaToken",
3537
"statusProxyMarketUser",
3638
"statusProxyMarketPassword",
3739
"statusProxyBlockchainUser",

multiaccounts/accounts/database.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ const (
114114
AccountPartiallyOperable AccountOperable = "partially" // an account is partially operable if it is not a keycard account and there is created keystore file for the address it is derived from
115115
AccountFullyOperable AccountOperable = "fully" // an account is fully operable if it is not a keycard account and there is a keystore file for it
116116

117-
ProdPreferredChainIDsDefault = "1:10:42161"
117+
ProdPreferredChainIDsDefault = "1:10:42161:8453"
118118
TestPreferredChainIDsDefault = "5:420:421613"
119-
TestSepoliaPreferredChainIDsDefault = "11155111:11155420:421614"
119+
TestSepoliaPreferredChainIDsDefault = "11155111:11155420:421614:84532"
120120
)
121121

122122
// Returns true if an account is a wallet account that logged in user has a control over, otherwise returns false.

protocol/communities/manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func NewDefaultTokenManager(tm *token.Manager, nm network.ManagerInterface) *Def
287287
type BalancesByChain = map[uint64]map[gethcommon.Address]map[gethcommon.Address]*hexutil.Big
288288

289289
func (m *DefaultTokenManager) GetAllChainIDs() ([]uint64, error) {
290-
networks, err := m.networkManager.Get(false)
290+
networks, err := m.networkManager.GetAll()
291291
if err != nil {
292292
return nil, err
293293
}

protocol/requests/create_account.go

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ type WalletSecretsConfig struct {
102102
AlchemyArbitrumSepoliaToken string `json:"alchemyArbitrumSepoliaToken"`
103103
AlchemyOptimismMainnetToken string `json:"alchemyOptimismMainnetToken"`
104104
AlchemyOptimismSepoliaToken string `json:"alchemyOptimismSepoliaToken"`
105+
AlchemyBaseMainnetToken string `json:"alchemyBaseMainnetToken"`
106+
AlchemyBaseSepoliaToken string `json:"alchemyBaseSepoliaToken"`
105107

106108
StatusProxyStageName string `json:"statusProxyStageName"`
107109
StatusProxyMarketUser string `json:"statusProxyMarketUser"`

rpc/network/network.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/status-im/status-go/params"
1212
)
1313

14-
var SepoliaChainIDs = []uint64{11155111, 421614, 11155420}
14+
var SepoliaChainIDs = []uint64{11155111, 421614, 11155420, 84532}
1515

1616
type CombinedNetwork struct {
1717
Prod *params.Network
@@ -319,7 +319,7 @@ func (nm *Manager) GetActiveNetworks() ([]*params.Network, error) {
319319
return nil, err
320320
}
321321

322-
networks, err := nm.Get(false)
322+
networks, err := nm.GetAll()
323323
if err != nil {
324324
return nil, err
325325
}

services/wallet/activity/activity.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ func getActivityEntries(ctx context.Context, deps FilterDependencies, addresses
454454
networks = joinItems(chainIDs, nil)
455455
}
456456

457-
layer2Chains := []uint64{common.OptimismMainnet, common.OptimismSepolia, common.ArbitrumMainnet, common.ArbitrumSepolia}
457+
layer2Chains := []uint64{common.OptimismMainnet, common.OptimismSepolia, common.ArbitrumMainnet, common.ArbitrumSepolia, common.BaseMainnet, common.BaseSepolia}
458458
layer2Networks := joinItems(layer2Chains, func(chainID uint64) string {
459459
return fmt.Sprintf("%d", chainID)
460460
})

services/wallet/common/const.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,23 @@ const (
3737
BinanceChainID uint64 = 56 // obsolete?
3838
BinanceTestChainID uint64 = 97 // obsolete?
3939
AnvilMainnet uint64 = 31337
40+
BaseMainnet uint64 = 8453
41+
BaseSepolia uint64 = 84532
4042
)
4143

4244
var (
4345
SupportedNetworks = map[uint64]bool{
4446
EthereumMainnet: true,
4547
OptimismMainnet: true,
4648
ArbitrumMainnet: true,
49+
BaseMainnet: true,
4750
}
4851

4952
SupportedTestNetworks = map[uint64]bool{
5053
EthereumSepolia: true,
5154
OptimismSepolia: true,
5255
ArbitrumSepolia: true,
56+
BaseSepolia: true,
5357
}
5458
)
5559

@@ -84,9 +88,9 @@ func (c ChainID) ToUint() uint64 {
8488

8589
func (c ChainID) IsMainnet() bool {
8690
switch uint64(c) {
87-
case EthereumMainnet, OptimismMainnet, ArbitrumMainnet:
91+
case EthereumMainnet, OptimismMainnet, ArbitrumMainnet, BaseMainnet:
8892
return true
89-
case EthereumSepolia, OptimismSepolia, ArbitrumSepolia:
93+
case EthereumSepolia, OptimismSepolia, ArbitrumSepolia, BaseSepolia:
9094
return false
9195
case UnknownChainID:
9296
return false
@@ -102,6 +106,8 @@ func AllChainIDs() []ChainID {
102106
ChainID(OptimismSepolia),
103107
ChainID(ArbitrumMainnet),
104108
ChainID(ArbitrumSepolia),
109+
ChainID(BaseMainnet),
110+
ChainID(BaseSepolia),
105111
}
106112
}
107113

@@ -110,4 +116,5 @@ var AverageBlockDurationForChain = map[ChainID]time.Duration{
110116
ChainID(EthereumMainnet): time.Duration(12000) * time.Millisecond,
111117
ChainID(OptimismMainnet): time.Duration(400) * time.Millisecond,
112118
ChainID(ArbitrumMainnet): time.Duration(300) * time.Millisecond,
119+
ChainID(BaseMainnet): time.Duration(400) * time.Millisecond,
113120
}

services/wallet/onramp/provider_mercuryo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (p *MercuryoProvider) GetCryptoOnRamp(ctx context.Context) (CryptoOnRamp, e
5353
Hostname: "mercuryo.io",
5454
SupportsSinglePurchase: true,
5555
SupportsRecurrentPurchase: true,
56-
SupportedChainIDs: []uint64{walletCommon.EthereumMainnet, walletCommon.ArbitrumMainnet, walletCommon.OptimismMainnet},
56+
SupportedChainIDs: []uint64{walletCommon.EthereumMainnet, walletCommon.ArbitrumMainnet, walletCommon.OptimismMainnet, walletCommon.BaseMainnet},
5757
URLsNeedParameters: true,
5858
SiteURL: mercuryioNoFeesBaseURL,
5959
RecurrentSiteURL: mercuryioNoFeesBaseURL + "&widget_flow=recurrent",

0 commit comments

Comments
 (0)