Skip to content

Commit 5c67f4e

Browse files
fix: Get quote from ALM Proxy (DEV-1141) (#230)
Co-authored-by: Lucas Manuel <lucasmanuel.tech@gmail.com>
1 parent e8315ca commit 5c67f4e

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

src/libraries/LayerZeroLib.sol

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
// SPDX-License-Identifier: AGPL-3.0-or-later
22
pragma solidity ^0.8.21;
33

4-
import { ILayerZero, SendParam, OFTReceipt, MessagingFee } from "../interfaces/ILayerZero.sol";
5-
import { IRateLimits } from "../interfaces/IRateLimits.sol";
6-
import { IALMProxy } from "../interfaces/IALMProxy.sol";
4+
import {
5+
ILayerZero,
6+
SendParam,
7+
OFTReceipt,
8+
MessagingFee,
9+
OFTLimit,
10+
OFTFeeDetail
11+
} from "../interfaces/ILayerZero.sol";
12+
13+
import { IRateLimits } from "../interfaces/IRateLimits.sol";
14+
import { IALMProxy } from "../interfaces/IALMProxy.sol";
715

816
import { ApproveLib } from "./ApproveLib.sol";
917

@@ -66,7 +74,14 @@ library LayerZeroLib {
6674
});
6775

6876
// Query the min amount received on the destination chain and set it.
69-
( , , OFTReceipt memory receipt ) = ILayerZero(oftAddress).quoteOFT(sendParams);
77+
( ,, OFTReceipt memory receipt ) = abi.decode(
78+
proxy.doCall(
79+
oftAddress,
80+
abi.encodeCall(ILayerZero.quoteOFT, (sendParams))
81+
),
82+
(OFTLimit, OFTFeeDetail[], OFTReceipt)
83+
);
84+
7085
sendParams.minAmountLD = receipt.amountReceivedLD;
7186

7287
MessagingFee memory fee = ILayerZero(oftAddress).quoteSend(sendParams, false);

0 commit comments

Comments
 (0)