The assembly blocks are marked as @solidity memory-safe-assembly
but they are not.
You use the free memory pointer address 0x40
to store the error selector. This address is used by the EVM to store the free memory pointer. You should use 0x00
instead as the selector can fit in.
The functions will return a blank error instead of the custom error. An external script or user could watch for this error and never find it.
Add this lines at the end of MathMastersTest
.
Foundry
https://docs.soliditylang.org/en/v0.8.17/assembly.html#memory-safety
https://docs.soliditylang.org/en/v0.8.17/internals/layout_in_memory.html#layout-in-memory
Use the "scratch space" to store the selector. You can use mstore(0, selector)
instead of mstore(0x40, selector)
, and revert(0, 4)
instead of revert(0x1c, 0x04)
.
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.