Skip to content

Commit

Permalink
feat: Check min amount out is not zero
Browse files Browse the repository at this point in the history
Update tests

--- don't change below this line ---
ENG-4286 Took 57 minutes


Took 20 seconds
  • Loading branch information
dianacarvalho1 committed Mar 5, 2025
1 parent 9eb10e6 commit 5c28d77
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
5 changes: 5 additions & 0 deletions foundry/src/TychoRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ error TychoRouter__AmountInDiffersFromConsumed(
);
error TychoRouter__MessageValueMismatch(uint256 value, uint256 amount);
error TychoRouter__InvalidDataLength();
error TychoRouter__UndefinedMinAmountOut();

contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
IAllowanceTransfer public immutable permit2;
Expand Down Expand Up @@ -243,6 +244,10 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard {
if (receiver == address(0)) {
revert TychoRouter__AddressZero();
}
if (minAmountOut == 0) {
revert TychoRouter__UndefinedMinAmountOut();
}

// Assume funds are already in the router.
if (wrapEth) {
_wrapETH(amountIn);
Expand Down
Loading

0 comments on commit 5c28d77

Please sign in to comment.