Normal Behavior: Per ERC20 convention (OpenZeppelin, Solmate), setting allowance to type(uint256).max represents "infinite" approval that should NOT be decremented on transferFrom. This is a gas optimization and UX pattern widely adopted.
Specific Issue: _spendAllowance always subtracts value from currentAllowance without checking if allowance is type(uint256).max. This breaks the infinite allowance pattern.
Likelihood:
High: Infinite approvals are standard practice for DEXs (Uniswap), lending protocols (Aave), and aggregators. Users routinely approve type(uint256).max.
Impact:
High: Users who set infinite approval will have their allowance depleted over time, causing unexpected reverts. This breaks integrations with major DeFi protocols.
UX Degradation: Users must re-approve frequently, wasting gas and causing failed transactions.
Root Cause: _spendAllowance always decrements, even when allowance is type(uint256).max.
Impact: Breaks DeFi integrations expecting infinite approval to stay infinite.
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.
The contest is complete and the rewards are being distributed.