The _spendAllowance function does not emit the required Approval event when decreasing the spender's allowance. According to the ERC20 standard, any change in allowance must emit an Approval event. Without this event, external observers cannot track allowance changes, breaking interoperability with wallets, block explorers, and other smart contracts that rely on these events for allowance tracking.
The function uses Yul assembly for gas optimization but omits the emission of the Approval event after updating the allowance storage.
Likelihood:
Every transferFrom operation (which calls _spendAllowance) fails to emit the required Approval event, affecting all allowance decreases.
The absence of events is immediately apparent to any external observer or tool that monitors allowance changes.
Impact:
Broken ERC20 Compliance: The token does not fully comply with the ERC20 standard, which may cause integration issues with wallets, DEXs, and other DeFi protocols.
Lack of Transparency: External parties cannot track allowance changes, leading to a loss of transparency and auditability for delegated spending.
Interoperability Issues: Smart contracts that rely on Approval events to react to allowance changes (e.g., allowance trackers, security monitors) will not function correctly.
User Experience Degradation: Wallets and interfaces that display allowance information may show outdated or incorrect values due to missing events.
Emit an Approval event with the new allowance value after decreasing it in _spendAllowance
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.