Normal Behavior: View functions should not modify memory in ways that could affect caller state. They should only read and return data cleanly.
Specific Issue: _balanceOf writes 0 to ptr + 0x20 after loading the balance. This clears 32 bytes of memory that could be in use by the calling context in complex call chains or composable contracts.
Likelihood:
Low-Medium: Requires specific call patterns where memory at ptr + 0x20 is being used by calling code. More likely in complex composable DeFi or when called via delegatecall.
Impact:
Medium: Memory corruption can lead to unpredictable behavior, incorrect calculations, or security vulnerabilities in composing contracts.
Silent Bugs: Hard to debug since the corruption is subtle and may only manifest under specific conditions.
Root Cause: _balanceOf writes 0 to ptr+0x20 unnecessarily.
Remove the unnecessary memory write:
Impact: Potential memory corruption in complex composable calls.
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.