Skip to content

Commit 37d26f3

Browse files
authored
fix: update lifi filler abi (#75)
1 parent 2fd0efd commit 37d26f3

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

app/app.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"time"
1616

1717
"github.com/ethereum/go-ethereum/common"
18+
ethereumCrypto "github.com/ethereum/go-ethereum/crypto"
1819
"github.com/libp2p/go-libp2p/core/crypto"
1920
"github.com/rs/zerolog/log"
2021
"github.com/spf13/viper"
@@ -114,6 +115,8 @@ func Run() error {
114115
}
115116
blockstore := store.NewBlockStore(db)
116117
keyshareStore := keyshare.NewECDSAKeyshareStore(configuration.RelayerConfig.MpcConfig.KeysharePath)
118+
keyshare, err := keyshareStore.GetKeyshare()
119+
panicOnError(err)
117120

118121
mp, err := observability.InitMetricProvider(context.Background(), configuration.RelayerConfig.OpenTelemetryCollectorURL)
119122
panicOnError(err)
@@ -290,6 +293,7 @@ func Run() error {
290293

291294
lifiMh := evmMessage.NewLifiEscrowMessageHandler(
292295
*c.GeneralChainConfig.Id,
296+
ethereumCrypto.PubkeyToAddress(*keyshare.Key.ECDSAPub.ToBtcecPubKey().ToECDSA()),
293297
lifiOutputSettlers,
294298
coordinator,
295299
host,

chains/evm/calls/consts/lifi.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ var LifiABI, _ = abi.JSON(strings.NewReader(`[{
1111
"type": "function",
1212
"stateMutability": "nonpayable",
1313
"inputs": [
14-
{"name": "fillDeadline", "type": "uint32"},
1514
{"name": "orderId", "type": "bytes32"},
1615
{
1716
"name": "outputs",
@@ -27,7 +26,8 @@ var LifiABI, _ = abi.JSON(strings.NewReader(`[{
2726
{"name": "context", "type": "bytes"}
2827
]
2928
},
30-
{"name": "proposedSolver", "type": "bytes32"}
29+
{"name": "fillDeadline", "type": "uint48"},
30+
{"name": "fillerData", "type": "bytes"}
3131
],
3232
"outputs": []
3333
}]`))

chains/evm/message/lifiEscrow.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ type LifiEscrowMessageHandler struct {
5353

5454
func NewLifiEscrowMessageHandler(
5555
chainID uint64,
56+
mpcAddress common.Address,
5657
lifiAddresses map[uint64]common.Address,
5758
coordinator Coordinator,
5859
host host.Host,
@@ -70,6 +71,7 @@ func NewLifiEscrowMessageHandler(
7071
lifiAddresses: lifiAddresses,
7172
coordinator: coordinator,
7273
host: host,
74+
mpcAddress: mpcAddress,
7375
comm: comm,
7476
fetcher: fetcher,
7577
confirmationWatcher: confirmationWatcher,
@@ -220,10 +222,10 @@ func (h *LifiEscrowMessageHandler) calldata(order *lifi.LifiOrder) ([]byte, erro
220222

221223
return consts.LifiABI.Pack(
222224
"fillOrderOutputs",
223-
order.Order.FillDeadline,
224225
common.HexToHash(order.Meta.OnChainOrderID),
225226
outputs,
226-
common.HexToHash(h.mpcAddress.Hex()))
227+
new(big.Int).SetUint64(uint64(order.Order.FillDeadline)),
228+
common.HexToHash(h.mpcAddress.Hex()).Bytes())
227229
}
228230

229231
// verifyOrder verifies order based on these instructions https://docs.catalyst.exchange/solver/orderflow/#order-validation

chains/evm/message/lifiEscrow_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func (s *LifiEscrowMessageHandlerTestSuite) SetupTest() {
101101

102102
s.handler = message.NewLifiEscrowMessageHandler(
103103
8453,
104+
common.Address{},
104105
lifiAddresses,
105106
s.mockCoordinator,
106107
s.mockHost,

0 commit comments

Comments
 (0)