Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"time"

"github.com/ethereum/go-ethereum/common"
ethereumCrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
Expand Down Expand Up @@ -114,6 +115,8 @@ func Run() error {
}
blockstore := store.NewBlockStore(db)
keyshareStore := keyshare.NewECDSAKeyshareStore(configuration.RelayerConfig.MpcConfig.KeysharePath)
keyshare, err := keyshareStore.GetKeyshare()
panicOnError(err)

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

lifiMh := evmMessage.NewLifiEscrowMessageHandler(
*c.GeneralChainConfig.Id,
ethereumCrypto.PubkeyToAddress(*keyshare.Key.ECDSAPub.ToBtcecPubKey().ToECDSA()),
lifiOutputSettlers,
coordinator,
host,
Expand Down
4 changes: 2 additions & 2 deletions chains/evm/calls/consts/lifi.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ var LifiABI, _ = abi.JSON(strings.NewReader(`[{
"type": "function",
"stateMutability": "nonpayable",
"inputs": [
{"name": "fillDeadline", "type": "uint32"},
{"name": "orderId", "type": "bytes32"},
{
"name": "outputs",
Expand All @@ -27,7 +26,8 @@ var LifiABI, _ = abi.JSON(strings.NewReader(`[{
{"name": "context", "type": "bytes"}
]
},
{"name": "proposedSolver", "type": "bytes32"}
{"name": "fillDeadline", "type": "uint48"},
{"name": "fillerData", "type": "bytes"}
],
"outputs": []
}]`))
6 changes: 4 additions & 2 deletions chains/evm/message/lifiEscrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type LifiEscrowMessageHandler struct {

func NewLifiEscrowMessageHandler(
chainID uint64,
mpcAddress common.Address,
lifiAddresses map[uint64]common.Address,
coordinator Coordinator,
host host.Host,
Expand All @@ -70,6 +71,7 @@ func NewLifiEscrowMessageHandler(
lifiAddresses: lifiAddresses,
coordinator: coordinator,
host: host,
mpcAddress: mpcAddress,
comm: comm,
fetcher: fetcher,
confirmationWatcher: confirmationWatcher,
Expand Down Expand Up @@ -220,10 +222,10 @@ func (h *LifiEscrowMessageHandler) calldata(order *lifi.LifiOrder) ([]byte, erro

return consts.LifiABI.Pack(
"fillOrderOutputs",
order.Order.FillDeadline,
common.HexToHash(order.Meta.OnChainOrderID),
outputs,
common.HexToHash(h.mpcAddress.Hex()))
new(big.Int).SetUint64(uint64(order.Order.FillDeadline)),
common.HexToHash(h.mpcAddress.Hex()).Bytes())
}

// verifyOrder verifies order based on these instructions https://docs.catalyst.exchange/solver/orderflow/#order-validation
Expand Down
1 change: 1 addition & 0 deletions chains/evm/message/lifiEscrow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func (s *LifiEscrowMessageHandlerTestSuite) SetupTest() {

s.handler = message.NewLifiEscrowMessageHandler(
8453,
common.Address{},
lifiAddresses,
s.mockCoordinator,
s.mockHost,
Expand Down
Loading