Skip to content

Commit db08068

Browse files
authored
Fix mayan swift contract targeting wrong chain (#46)
1 parent da3fac8 commit db08068

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/app.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ func Run() error {
150150
panicOnError(err)
151151

152152
var hubPoolContract evmMessage.TokenMatcher
153-
var mayanSwiftContract *contracts.MayanSwiftContract
154153
acrossPools := make(map[uint64]common.Address)
155154
mayanPools := make(map[uint64]common.Address)
156155
repayerAddresses := make(map[uint64]common.Address)
@@ -173,7 +172,6 @@ func Run() error {
173172
if c.MayanSwift != "" {
174173
poolAddress := common.HexToAddress(c.MayanSwift)
175174
mayanPools[*c.GeneralChainConfig.Id] = poolAddress
176-
mayanSwiftContract = contracts.NewMayanSwiftContract(client, common.HexToAddress(c.MayanSwift))
177175
}
178176

179177
if c.AcrossHubPool != "" {
@@ -203,7 +201,8 @@ func Run() error {
203201
c, err := evm.NewEVMConfig(chainConfig, *solverConfig)
204202
panicOnError(err)
205203

206-
client, err := evmClient.NewEVMClient(c.GeneralChainConfig.Endpoint, nil)
204+
kp, _ := secp256k1.GenerateKeypair()
205+
client, err := evmClient.NewEVMClient(c.GeneralChainConfig.Endpoint, kp)
207206
panicOnError(err)
208207

209208
log.Info().Uint64("chain", *c.GeneralChainConfig.Id).Msgf("Registering EVM domain")
@@ -241,6 +240,7 @@ func Run() error {
241240
}
242241

243242
if c.MayanSwift != "" {
243+
mayanSwiftContract := contracts.NewMayanSwiftContract(client, common.HexToAddress(c.MayanSwift))
244244
mayanApi := mayan.NewMayanExplorer()
245245
mayanMh := evmMessage.NewMayanMessageHandler(
246246
*c.GeneralChainConfig.Id,

0 commit comments

Comments
 (0)