feat: Check min amount out is not zero

Update tests

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


Took 20 seconds
This commit is contained in:
Diana Carvalho
2025-03-05 17:49:41 +00:00
parent 9eb10e63df
commit 5c28d77f1d
3 changed files with 35 additions and 31 deletions

View File

@@ -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;
@@ -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);