In the _initStrategy
and setRouter
functions, the contract grants an infinite approval to the router
for the underlying
token:
Granting infinite approval can lead to gas inefficiencies when approvals need to be updated or reset, as changing an approval from a non-zero value to another non-zero value requires an extra transaction due to some ERC20 tokens' implementation (e.g., USDT).
Gas Waste: Users might incur higher gas costs if approvals need to be reset or updated, especially if the underlying token's approve
function requires setting the allowance to zero before setting a new value.
Operational Delay: Additional transactions may be needed to reset approvals, leading to delays in contract operations.
Use safeIncreaseAllowance
and safeDecreaseAllowance
: Instead of setting infinite approvals, adjust the allowance as needed using safeIncreaseAllowance
and safeDecreaseAllowance
functions from OpenZeppelin's SafeERC20
library.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.