The error in mulWad()
is not placed in the correct place in memory. It is stored at 0x40 which is where the free memory pointer is. It should be stored in the scratch space if it fits within 64 bytes (which this custom error does). By doing it this way, you are overwriting the free memory pointer.
Here is the mulWad()
function - the problem is in the assembly. It stores the function selector for the custom error at 0x40 which is where the free memory pointer is supposed to be:
You are overwriting where the free memory pointer points, and the next time there is a new object that needs to be stored where the free memory pointer points, it may overwrite something else that is already stored there.
Also, the free memory pointer initially points to 0x80 and you will change it to point at a slot much further away (since your custom error is 0xbac65e5b) so you are needlessly being inefficient.
Manual review
The function selector for the error should be stored in the scratch space which begins at 0 since it fits within 64 bytes.
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.