@@ -22,6 +22,7 @@ import (
2222 "github.com/sprintertech/sprinter-signing/api/handlers"
2323 "github.com/sprintertech/sprinter-signing/cache"
2424 "github.com/sprintertech/sprinter-signing/chains/evm"
25+ "github.com/sprintertech/sprinter-signing/chains/evm/calls/contracts"
2526 "github.com/sprintertech/sprinter-signing/chains/evm/calls/events"
2627 evmListener "github.com/sprintertech/sprinter-signing/chains/evm/listener"
2728 evmMessage "github.com/sprintertech/sprinter-signing/chains/evm/message"
@@ -139,6 +140,7 @@ func Run() error {
139140 confirmationsPerChain := make (map [uint64 ]map [uint64 ]uint64 )
140141 domains := make (map [uint64 ]relayer.RelayedChain )
141142
143+ var hubPoolContract evmMessage.TokenMatcher
142144 acrossPools := make (map [uint64 ]common.Address )
143145 for _ , chainConfig := range configuration .ChainConfigs {
144146 switch chainConfig ["type" ] {
@@ -151,6 +153,14 @@ func Run() error {
151153 poolAddress := common .HexToAddress (config .AcrossPool )
152154 acrossPools [* config .GeneralChainConfig .Id ] = poolAddress
153155 }
156+
157+ if config .HubPool != "" {
158+ client , err := evmClient .NewEVMClient (config .GeneralChainConfig .Endpoint , nil )
159+ panicOnError (err )
160+
161+ hubPoolAddress := common .HexToAddress (config .HubPool )
162+ hubPoolContract = contracts .NewHubPoolContract (client , hubPoolAddress , config .Tokens )
163+ }
154164 }
155165 default :
156166 panic (fmt .Errorf ("type '%s' not recognized" , chainConfig ["type" ]))
@@ -182,6 +192,7 @@ func Run() error {
182192 communication ,
183193 keyshareStore ,
184194 priceAPI ,
195+ hubPoolContract ,
185196 sigChn ,
186197 config .Tokens ,
187198 config .ConfirmationsByValue ,
0 commit comments