Closed chasebrownn closed 5 months ago
The referenced SafeERC20::forceApprove operation is redundant as the ensuing SafeERC20::forceApprove to a non-zero value will already zero out the approval if necessary.
SafeERC20::forceApprove
IERC20(_tokenIn).forceApprove(_target, 0); IERC20(_tokenIn).forceApprove(_target, _amount);
We advise the SafeERC20::forceApprove operation with a value of 0 to be removed, optimizing the code's gas cost.
0
Resolved
RDR-03C: Redundant Approval Operation
Description:
The referenced
SafeERC20::forceApprove
operation is redundant as the ensuingSafeERC20::forceApprove
to a non-zero value will already zero out the approval if necessary.Example:
Recommendation:
We advise the
SafeERC20::forceApprove
operation with a value of0
to be removed, optimizing the code's gas cost.