Skip to content

Commit 5970a47

Browse files
committed
update lombardTransfer to use minAmountOut parameter
1 parent 2956568 commit 5970a47

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

Diff for: EurekaHandler/src/EurekaHandler.sol

+7-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ contract EurekaHandler is IEurekaHandler, Initializable, UUPSUpgradeable, Ownabl
102102
emit EurekaTransfer(transferParams.token, amountOutAfterFees, fees.relayFee, fees.relayFeeRecipient);
103103
}
104104

105-
function lombardTransfer(uint256 amount, TransferParams memory transferParams, Fees memory fees) external {
105+
function lombardTransfer(
106+
uint256 amount,
107+
uint256 minAmountOut,
108+
TransferParams memory transferParams,
109+
Fees memory fees
110+
) external {
106111
require(block.timestamp < fees.quoteExpiry, "Fee quote expired");
107112

108113
// Collect fees
@@ -114,7 +119,7 @@ contract EurekaHandler is IEurekaHandler, Initializable, UUPSUpgradeable, Ownabl
114119

115120
IERC20(lbtc).approve(lbtcVoucher, amount);
116121

117-
uint256 voucherAmount = IIBCVoucher(lbtcVoucher).wrap(amount);
122+
uint256 voucherAmount = IIBCVoucher(lbtcVoucher).wrap(amount, minAmountOut);
118123

119124
_sendTransfer(
120125
IICS20TransferMsgs.SendTransferMsg({

Diff for: EurekaHandler/src/interfaces/IEurekaHandler.sol

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,10 @@ interface IEurekaHandler {
2727
Fees memory fees
2828
) external;
2929

30-
function lombardTransfer(uint256 amount, TransferParams memory transferParams, Fees memory fees) external;
30+
function lombardTransfer(
31+
uint256 amount,
32+
uint256 minAmountOut,
33+
TransferParams memory transferParams,
34+
Fees memory fees
35+
) external;
3136
}

Diff for: EurekaHandler/src/interfaces/lombard/IIBCVoucher.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface IIBCVoucher {
55
/// @notice Gives voucher in exchange for LBTC
66
/// @dev LBTC should be approved to `transferFrom`
77
/// @param amount Amount of LBTC
8-
function wrap(uint256 amount) external returns (uint256 voucherAmount);
8+
function wrap(uint256 amount, uint256 minAmountOut) external returns (uint256 voucherAmount);
99

1010
/// @notice Spends the voucher and gives LBTC back
1111
/// @dev No approval required, burns directly from message sender

0 commit comments

Comments
 (0)