diff --git a/chains/evm/config.go b/chains/evm/config.go index 68787bd3..23004883 100644 --- a/chains/evm/config.go +++ b/chains/evm/config.go @@ -14,6 +14,7 @@ import ( "github.com/mitchellh/mapstructure" solverConfig "github.com/sprintertech/solver-config/go/config" + "github.com/sprintertech/solver-sdk/pkg/chains/caip" "github.com/sprintertech/sprinter-signing/config" "github.com/sprintertech/sprinter-signing/config/chain" ) @@ -76,7 +77,7 @@ func NewEVMConfig(chainConfig map[string]interface{}, solverConfig solverConfig. return nil, err } - id := fmt.Sprintf("eip155:%d", *c.Id) + id := caip.ChainIDToCAIP(*c.Id, caip.NamespaceForChainID(*c.Id)) sc, ok := solverConfig.Chains[id] if !ok { return nil, fmt.Errorf("no solver config for id %s", id) @@ -125,8 +126,8 @@ func NewEVMConfig(chainConfig map[string]interface{}, solverConfig solverConfig. Processors: processors, AcrossPool: solverConfig.ProtocolsMetadata.Across.SpokePools[id], AcrossHubPool: solverConfig.ProtocolsMetadata.Across.HubPools[id], - LifiOutputSettler: solverConfig.ProtocolsMetadata.Lifi.OutputSettler, - LifiInputSettlerEscrow: solverConfig.ProtocolsMetadata.Lifi.InputSettlerEscrow, + LifiOutputSettler: solverConfig.ProtocolsMetadata.Lifi.OutputSettlers[id], + LifiInputSettlerEscrow: solverConfig.ProtocolsMetadata.Lifi.InputSettlerEscrows[id], Liquidators: liquidators, // nolint:gosec diff --git a/chains/evm/config_test.go b/chains/evm/config_test.go index 681f3763..f9097ca4 100644 --- a/chains/evm/config_test.go +++ b/chains/evm/config_test.go @@ -105,8 +105,12 @@ func (s *NewEVMConfigTestSuite) Test_ValidConfig() { }, }, Lifi: &solverConfig.LifiMetadata{ - OutputSettler: "settler", - InputSettlerEscrow: "escrowSettler", + OutputSettlers: map[string]string{ + "eip155:1": "settler", + }, + InputSettlerEscrows: map[string]string{ + "eip155:1": "escrowSettler", + }, }, SprinterCredit: map[string][]solverConfig.SprinterCredit{ "eip155:1": { @@ -231,10 +235,15 @@ func (s *NewEVMConfigTestSuite) Test_ValidConfigWithCustomTxParams() { }, }, Lifi: &solverConfig.LifiMetadata{ - OutputSettler: "settler", + OutputSettlers: map[string]string{ + "eip155:1": "settler", + }, + InputSettlerEscrows: map[string]string{ + "eip155:1": "escrow", + }, RepaymentProcessors: map[string]map[string]solverConfig.RepaymentProcessor{ - "eip155:1": map[string]solverConfig.RepaymentProcessor{ - "uSdC": solverConfig.RepaymentProcessor{ + "eip155:1": { + "uSdC": { Address: "0xdBBE3D8c2d2b22A2611c5A94A9a12C2fCD49Eb28", }, }, @@ -256,16 +265,17 @@ func (s *NewEVMConfigTestSuite) Test_ValidConfigWithCustomTxParams() { BlockConfirmations: 5, Blocktime: 2, }, - BlockInterval: big.NewInt(2), - BlockRetryInterval: time.Duration(10) * time.Second, - Admin: "adminAddress", - AcrossPool: "acrossPool", - AcrossHubPool: "acrossHubPool", - LifiOutputSettler: "settler", - Repayer: "repayer", - ConfirmationsByValue: expectedBlockConfirmations, - Tokens: expectedTokens, - Processors: processors, - Liquidators: make(map[common.Address]common.Address), + BlockInterval: big.NewInt(2), + BlockRetryInterval: time.Duration(10) * time.Second, + Admin: "adminAddress", + AcrossPool: "acrossPool", + AcrossHubPool: "acrossHubPool", + LifiOutputSettler: "settler", + LifiInputSettlerEscrow: "escrow", + Repayer: "repayer", + ConfirmationsByValue: expectedBlockConfirmations, + Tokens: expectedTokens, + Processors: processors, + Liquidators: make(map[common.Address]common.Address), }) } diff --git a/go.mod b/go.mod index 40bf46b4..d7983c66 100644 --- a/go.mod +++ b/go.mod @@ -21,8 +21,8 @@ require ( github.com/rs/zerolog v1.25.0 github.com/spf13/cobra v1.10.2 github.com/spf13/viper v1.9.0 - github.com/sprintertech/solver-config/go v0.0.0-20260819115035-7b1b83250ca4 - github.com/sprintertech/solver-sdk v1.1.1-0.20260827154133-1e8cff30b44b + github.com/sprintertech/solver-config/go v0.0.0-20260901094026-b84bd6a9b33c + github.com/sprintertech/solver-sdk v1.1.1-0.20260901143229-178cc52472b7 github.com/stretchr/testify v1.11.1 github.com/sygmaprotocol/sygma-core v0.0.0-20250304150334-bd39ac4f7b82 go.opentelemetry.io/otel v1.39.0 diff --git a/go.sum b/go.sum index 767f82a9..3eba8368 100644 --- a/go.sum +++ b/go.sum @@ -1713,16 +1713,10 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= -github.com/sprintertech/solver-config/go v0.0.0-20260811202645-859c642937f6 h1:SiLvJC8vyMNWbQgqGdd7Z5WP2Jg7XFShXN130ryqCgM= -github.com/sprintertech/solver-config/go v0.0.0-20260811202645-859c642937f6/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ= -github.com/sprintertech/solver-config/go v0.0.0-20260819115035-7b1b83250ca4 h1:ouDxcEePolYizXXKjeB61jawFmDJrBeJg7l4MSnQeck= -github.com/sprintertech/solver-config/go v0.0.0-20260819115035-7b1b83250ca4/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ= -github.com/sprintertech/solver-sdk v1.1.1-0.20260821104752-6a3c113a5958 h1:++m9ZfqDmqx2ieyP76h/snKFRVhl2TUPJ7qavLz1JiU= -github.com/sprintertech/solver-sdk v1.1.1-0.20260821104752-6a3c113a5958/go.mod h1:6euNIW0DgGI/RfIvpZJgnvoVcd1PmzE1T20C0dXnyrc= -github.com/sprintertech/solver-sdk v1.1.1-0.20260825101026-32c00a9704e6 h1:0bfmInjG3+ak7E65LVBVOQxArztBSZw49iNY9dpfS8I= -github.com/sprintertech/solver-sdk v1.1.1-0.20260825101026-32c00a9704e6/go.mod h1:A9fQAvneC86+z0ib2cb+yTOV84olOqcBZxomj1pe3bc= -github.com/sprintertech/solver-sdk v1.1.1-0.20260827154133-1e8cff30b44b h1:Xfr0QWclvoL0OGtjMrFTxoDU66JQHwBR8u1LdRYLba8= -github.com/sprintertech/solver-sdk v1.1.1-0.20260827154133-1e8cff30b44b/go.mod h1:A9fQAvneC86+z0ib2cb+yTOV84olOqcBZxomj1pe3bc= +github.com/sprintertech/solver-config/go v0.0.0-20260901094026-b84bd6a9b33c h1:qoZkN8WQ1UGE2c409EpafONb+HwpilrsXsKfYNHM/h0= +github.com/sprintertech/solver-config/go v0.0.0-20260901094026-b84bd6a9b33c/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ= +github.com/sprintertech/solver-sdk v1.1.1-0.20260901143229-178cc52472b7 h1:4p2gaKMNVCROeNlab2WBZYTemOkganPraqTypvOsNZU= +github.com/sprintertech/solver-sdk v1.1.1-0.20260901143229-178cc52472b7/go.mod h1:wssz0/TVHrUGBpR8CQt9uqXg+Dz+oKQeKKTWRvfO0BQ= github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=