safeApprove will fail if the current approval is > 0 but < amount:
if (want.allowance(address(this), address(lp)) < amount) {
want.safeApprove(address(lp), type(uint256).max);
}
This condition is unlikely to happen in practice as you approve the max value which should in theory last forever, but nevertheless a better option would be to reset the approval before setting it once again:
Handle
pauliax
Vulnerability details
Impact
safeApprove will fail if the current approval is > 0 but < amount:
This condition is unlikely to happen in practice as you approve the max value which should in theory last forever, but nevertheless a better option would be to reset the approval before setting it once again: