There are some assembly blocks that write to memory words in the ranges 0x40–0x5f and 0x60–0x7f, which can lead to undefined behavior.
Memory structure:
0x0 - 0x1f: first scratch word
0x20 - 0x3f: second scratch word
0x40 - 0x5f: free pointer
0x60 - 0x7f: zero
>= 0x80: actual memory data
As the Solidity documentation notes, the free memory pointer and the zero slot are reserved and should not be used as scratch memory:
Memory allocated by yourself using a mechanism like the allocate function described above.
Memory allocated by Solidity, e.g. memory within the bounds of a memory array you reference.
The scratch space between memory offset 0 and 64 mentioned above.
Temporary memory that is located after the value of the free memory pointer at the beginning of the assembly block, i.e. memory that is “allocated” at the free memory pointer without updating the free memory pointer.
Two assembly blocks write to these unsafe memory locations:
As the Solidity documentation warns: "this will lead to incorrect and undefined behavior that cannot easily be discovered by testing."
Use safe memory ranges (e.g., memory addresses beyond the current free memory pointer) and avoid writing directly to 0x00 or other reserved regions.
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.