chore: readd post swap sanity check
@@ -48,9 +48,7 @@ contract CurveSwapStrategy is AccessControlUpgradeable, ReentrancyGuardUpgradeab
_approveBalance(_from, registry, _amount);
// msg.sender must supply from token for _amount.
IERC20Upgradeable(_from).safeTransferFrom(msg.sender, address(this), _amount);
-
- return
- ICurveRegistryExchange(registry).exchange(
+ amount = ICurveRegistryExchange(registry).exchange(
pool,
_from,
_to,
@@ -59,6 +57,9 @@ contract CurveSwapStrategy is AccessControlUpgradeable, ReentrancyGuardUpgradeab
// Swap strategy caller is the receiver of the swap.
msg.sender
);
+ require(amount > minAmount, "swapped amount less than min amount");
+
+ return amount;
}
// Anyone can estimate swap amount as this fn is stateless.
