Skip to content

Commit

Permalink
Codearena 154, Incorrect Decoding of Swap Results Leads to Ineffectiv…
Browse files Browse the repository at this point in the history
…e Slippage Protection
  • Loading branch information
af-afk committed Sep 23, 2024
1 parent 65c99fc commit 1e49a07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/sol/SeawaterAMM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ contract SeawaterAMM is ISeawaterAMM {
));
require(success, string(data));

(int256 swapAmountIn, int256 swapAmountOut) = abi.decode(data, (int256, int256));
(int256 swapAmountOut, int256 swapAmountIn) = abi.decode(data, (int256, int256));
require(swapAmountOut >= int256(minOut), "min out not reached!");
return (swapAmountIn, swapAmountOut);
}
Expand All @@ -335,7 +335,7 @@ contract SeawaterAMM is ISeawaterAMM {
));
require(success, string(data));

(int256 swapAmountIn, int256 swapAmountOut) = abi.decode(data, (int256, int256));
(int256 swapAmountOut, int256 swapAmountIn) = abi.decode(data, (int256, int256));
require(swapAmountOut >= int256(minOut), "min out not reached!");
return (swapAmountIn, swapAmountOut);
}
Expand Down Expand Up @@ -410,7 +410,7 @@ contract SeawaterAMM is ISeawaterAMM {
}

/// @inheritdoc ISeawaterExecutorAdminExposed
function tickSpacing653FE28F(address /* pool */) external returns (uint8) {
function tickSpacing653FE28F(address /* pool */) external returns (uint16) {
directDelegate(_getExecutorAdmin());
}

Expand Down

0 comments on commit 1e49a07

Please sign in to comment.