fix: Changed error code as per ISwapAdapter.sol definition

This commit is contained in:
domenicodev
2023-12-22 11:17:12 +01:00
parent cc1a17c889
commit b46c662607

View File

@@ -134,7 +134,7 @@ contract IntegralSwapAdapter is ISwapAdapter {
uint256[] memory limits = _getLimits(0, sellToken, buyToken); uint256[] memory limits = _getLimits(0, sellToken, buyToken);
if(amount > limits[0] || amount < limits[2]) { if(amount > limits[0] || amount < limits[2]) {
revert Unavailable("amount is out of limits range"); revert LimitExceeded(amount);
} }
uint256 amountOut = relayer.quoteSell(address(sellToken), address(buyToken), amount); uint256 amountOut = relayer.quoteSell(address(sellToken), address(buyToken), amount);
@@ -172,7 +172,7 @@ contract IntegralSwapAdapter is ISwapAdapter {
uint256[] memory limits = _getLimits(0, sellToken, buyToken); uint256[] memory limits = _getLimits(0, sellToken, buyToken);
if(amountBought > limits[1] || amountBought < limits[3]) { if(amountBought > limits[1] || amountBought < limits[3]) {
revert Unavailable("amountBought is out of limits range"); revert LimitExceeded(amountBought);
} }
uint256 amountIn = relayer.quoteBuy(address(sellToken), address(buyToken), amountBought); uint256 amountIn = relayer.quoteBuy(address(sellToken), address(buyToken), amountBought);