Skip to content

Commit c40b5cc

Browse files
committed
minBuyAmount => minAmountOut
1 parent c78483a commit c40b5cc

File tree

13 files changed

+63
-63
lines changed

13 files changed

+63
-63
lines changed

src/ISettlerActions.sol

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,26 +168,26 @@ interface ISettlerActions {
168168
ISignatureTransfer.PermitTransferFrom memory permit,
169169
uint80 poolInfo,
170170
bytes memory sig,
171-
uint256 minBuyAmount
171+
uint256 minAmountOut
172172
) external;
173173
function METATXN_CURVE_TRICRYPTO_VIP(
174174
address recipient,
175175
ISignatureTransfer.PermitTransferFrom memory permit,
176176
uint80 poolInfo,
177-
uint256 minBuyAmount
177+
uint256 minAmountOut
178178
) external;
179179

180-
function DODOV1(address sellToken, uint256 bps, address pool, bool quoteForBase, uint256 minBuyAmount) external;
180+
function DODOV1(address sellToken, uint256 bps, address pool, bool quoteForBase, uint256 minAmountOut) external;
181181
function DODOV2(
182182
address recipient,
183183
address sellToken,
184184
uint256 bps,
185185
address pool,
186186
bool quoteForBase,
187-
uint256 minBuyAmount
187+
uint256 minAmountOut
188188
) external;
189189

190-
function VELODROME(address recipient, uint256 bps, address pool, uint24 swapInfo, uint256 minBuyAmount) external;
190+
function VELODROME(address recipient, uint256 bps, address pool, uint24 swapInfo, uint256 minAmountOut) external;
191191

192192
/// @dev Trades against MaverickV2 using the contracts balance for funding
193193
/// This action does not use the MaverickV2 callback, so it takes an arbitrary pool address to make calls against.
@@ -199,7 +199,7 @@ interface ISettlerActions {
199199
address pool,
200200
bool tokenAIn,
201201
int32 tickLimit,
202-
uint256 minBuyAmount
202+
uint256 minAmountOut
203203
) external;
204204
/// @dev Trades against MaverickV2, spending the taker's coupon inside the callback
205205
/// This action requires the use of the MaverickV2 callback, so we take the MaverickV2 CREATE2 salt as an argument to derive the pool address from the trusted factory and inithash.
@@ -211,7 +211,7 @@ interface ISettlerActions {
211211
bool tokenAIn,
212212
bytes memory sig,
213213
int32 tickLimit,
214-
uint256 minBuyAmount
214+
uint256 minAmountOut
215215
) external;
216216
/// @dev Trades against MaverickV2, spending the taker's coupon inside the callback; metatransaction variant
217217
function METATXN_MAVERICKV2_VIP(
@@ -220,7 +220,7 @@ interface ISettlerActions {
220220
bytes32 salt,
221221
bool tokenAIn,
222222
int32 tickLimit,
223-
uint256 minBuyAmount
223+
uint256 minAmountOut
224224
) external;
225225

226226
/// @dev Trades against UniswapV2 using the contracts balance for funding
@@ -336,7 +336,7 @@ interface ISettlerActions {
336336
uint256 buyScalingFactor,
337337
bool isAsk,
338338
uint256 priceLimit,
339-
uint256 minBuyAmount
339+
uint256 minAmountOut
340340
) external;
341341

342342
function CHECK_SLIPPAGE(bool exact) external;

src/chains/Arbitrum/Common.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ abstract contract ArbitrumMixin is
149149
sellToDodoV2(recipient, sellToken, bps, dodo, quoteForBase);
150150
_checkSlippage(buyToken, minAmountOut, actualBuyToken, actualAmountOut);
151151
} else if (action == uint32(ISettlerActions.DODOV1.selector)) {
152-
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minBuyAmount) =
152+
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minAmountOut) =
153153
abi.decode(data, (IERC20, uint256, IDodoV1, bool, uint256));
154154

155-
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minBuyAmount);
155+
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minAmountOut);
156156
} else if (action == uint32(ISettlerActions.RENEGADE.selector)) {
157157
(address target, IERC20 baseToken, bytes memory renegadeData) = abi.decode(data, (address, IERC20, bytes));
158158

src/chains/Bnb/Common.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ abstract contract BnbMixin is
155155
sellToDodoV2(recipient, sellToken, bps, dodo, quoteForBase);
156156
_checkSlippage(buyToken, minAmountOut, actualBuyToken, actualAmountOut);
157157
} else if (action == uint32(ISettlerActions.DODOV1.selector)) {
158-
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minBuyAmount) =
158+
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minAmountOut) =
159159
abi.decode(data, (IERC20, uint256, IDodoV1, bool, uint256));
160160

161-
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minBuyAmount);
161+
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minAmountOut);
162162
} else {
163163
return false;
164164
}

src/chains/Linea/Common.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ abstract contract LineaMixin is FreeMemory, SettlerBase, DodoV1 {
4646
if (super._dispatch(i, action, data, slippage)) {
4747
return true;
4848
} else if (action == uint32(ISettlerActions.DODOV1.selector)) {
49-
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minBuyAmount) =
49+
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minAmountOut) =
5050
abi.decode(data, (IERC20, uint256, IDodoV1, bool, uint256));
5151

52-
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minBuyAmount);
52+
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minAmountOut);
5353
} else {
5454
return false;
5555
}

src/chains/Mantle/Common.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ abstract contract MantleMixin is FreeMemory, SettlerBase, DodoV1, DodoV2 {
5050
sellToDodoV2(recipient, sellToken, bps, dodo, quoteForBase);
5151
_checkSlippage(buyToken, minAmountOut, actualBuyToken, actualAmountOut);
5252
} else if (action == uint32(ISettlerActions.DODOV1.selector)) {
53-
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minBuyAmount) =
53+
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minAmountOut) =
5454
abi.decode(data, (IERC20, uint256, IDodoV1, bool, uint256));
5555

56-
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minBuyAmount);
56+
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minAmountOut);
5757
} else {
5858
return false;
5959
}

src/chains/Polygon/Common.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ abstract contract PolygonMixin is FreeMemory, SettlerBase, DodoV1, DodoV2, Unisw
8989
(IERC20 actualBuyToken, uint256 actualAmountOut) = sellToBebop(recipient, sellToken, order, makerSignature);
9090
_checkSlippage(buyToken, minAmountOut, actualBuyToken, actualAmountOut);
9191
} else if (action == uint32(ISettlerActions.DODOV1.selector)) {
92-
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minBuyAmount) =
92+
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minAmountOut) =
9393
abi.decode(data, (IERC20, uint256, IDodoV1, bool, uint256));
9494

95-
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minBuyAmount);
95+
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minAmountOut);
9696
} else {
9797
return false;
9898
}

src/chains/Scroll/Common.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ abstract contract ScrollMixin is FreeMemory, SettlerBase, MaverickV2, DodoV1, Do
7272
sellToDodoV2(recipient, sellToken, bps, dodo, quoteForBase);
7373
_checkSlippage(buyToken, minAmountOut, actualBuyToken, actualAmountOut);
7474
} else if (action == uint32(ISettlerActions.DODOV1.selector)) {
75-
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minBuyAmount) =
75+
(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minAmountOut) =
7676
abi.decode(data, (IERC20, uint256, IDodoV1, bool, uint256));
7777

78-
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minBuyAmount);
78+
sellToDodoV1(sellToken, bps, dodo, quoteForBase, minAmountOut);
7979
} else {
8080
return false;
8181
}

src/core/CurveTricrypto.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface ICurveTricrypto {
1616
uint256 sellIndex,
1717
uint256 buyIndex,
1818
uint256 sellAmount,
19-
uint256 minBuyAmount,
19+
uint256 minAmountOut,
2020
bool useEth,
2121
address payer,
2222
address receiver,
@@ -42,7 +42,7 @@ library FastCurveTricrypto {
4242
uint256 sellIndex,
4343
uint256 buyIndex,
4444
uint256 sellAmount,
45-
uint256 minBuyAmount,
45+
uint256 minAmountOut,
4646
address receiver
4747
) internal pure returns (bytes memory data) {
4848
assembly ("memory-safe") {
@@ -57,7 +57,7 @@ library FastCurveTricrypto {
5757
mstore(add(0xe8, data), 0x6370a85c) // selector for `curveTricryptoSwapCallback(address,address,address,uint256,uint256)`
5858
mstore(add(0xe4, data), receiver)
5959
codecopy(add(0xa4, data), codesize(), 0x4c) // useEth and payer (both zeroed); clear dirty bits in `receiver`
60-
mstore(add(0x84, data), minBuyAmount)
60+
mstore(add(0x84, data), minAmountOut)
6161
mstore(add(0x64, data), sellAmount)
6262
mstore(add(0x44, data), buyIndex)
6363
mstore(add(0x24, data), sellIndex)

src/core/DodoV1.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ abstract contract DodoV1 is SettlerSwapAbstract, DodoSellHelper {
349349
using SafeTransferLib for IERC20;
350350
using FastDodoV1 for IDodoV1;
351351

352-
function sellToDodoV1(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minBuyAmount)
352+
function sellToDodoV1(IERC20 sellToken, uint256 bps, IDodoV1 dodo, bool quoteForBase, uint256 minAmountOut)
353353
internal
354354
{
355355
uint256 sellAmount;
@@ -359,12 +359,12 @@ abstract contract DodoV1 is SettlerSwapAbstract, DodoSellHelper {
359359
sellToken.safeApproveIfBelow(address(dodo), sellAmount);
360360
if (quoteForBase) {
361361
uint256 buyAmount = dodoQuerySellQuoteToken(dodo, sellAmount);
362-
if (buyAmount < minBuyAmount) {
363-
revertTooMuchSlippage(dodo.fast_BASE_TOKEN_(), minBuyAmount, buyAmount);
362+
if (buyAmount < minAmountOut) {
363+
revertTooMuchSlippage(dodo.fast_BASE_TOKEN_(), minAmountOut, buyAmount);
364364
}
365365
dodo.fastBuyBaseToken(buyAmount, sellAmount);
366366
} else {
367-
dodo.fastSellBaseToken(sellAmount, minBuyAmount);
367+
dodo.fastSellBaseToken(sellAmount, minAmountOut);
368368
}
369369
}
370370
}

test/integration/Hanji.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ abstract contract HanjiTestBase is AllowanceHolderPairTest {
102102
// ========== HELPER FUNCTIONS ==========
103103

104104
/// @dev Builds a standard HANJI action with common parameters
105-
function _buildHanjiAction(bool unwrap, uint256 bps, uint256 minBuyAmount) internal view returns (bytes memory) {
105+
function _buildHanjiAction(bool unwrap, uint256 bps, uint256 minAmountOut) internal view returns (bytes memory) {
106106
return abi.encodeCall(
107107
ISettlerActions.HANJI,
108108
(
@@ -113,7 +113,7 @@ abstract contract HanjiTestBase is AllowanceHolderPairTest {
113113
buyScalingFactor(),
114114
isAsk(),
115115
priceLimit(),
116-
minBuyAmount
116+
minAmountOut
117117
)
118118
);
119119
}
@@ -227,7 +227,7 @@ contract HanjiWmonToUsdcTest is HanjiTestBase {
227227

228228
// ========== SLIPPAGE TEST ==========
229229

230-
/// @notice Test that minBuyAmount causes revert when not met
230+
/// @notice Test that minAmountOut causes revert when not met
231231
function testHanji_revert_tooMuchSlippage() public skipIf(address(hanjiPool()) == address(0)) {
232232
ISignatureTransfer.PermitTransferFrom memory permit =
233233
defaultERC20PermitTransfer(address(fromToken()), amount(), 0);
@@ -295,7 +295,7 @@ contract HanjiUsdcToWmonTest is HanjiTestBase {
295295

296296
// ========== SLIPPAGE TEST ==========
297297

298-
/// @notice Test that minBuyAmount causes revert when not met
298+
/// @notice Test that minAmountOut causes revert when not met
299299
function testHanji_revert_tooMuchSlippage() public skipIf(address(hanjiPool()) == address(0)) {
300300
ISignatureTransfer.PermitTransferFrom memory permit =
301301
defaultERC20PermitTransfer(address(fromToken()), amount(), 0);

0 commit comments

Comments
 (0)