Open arcz opened 1 month ago
Hi @arcz,
Thanks for this! I have done some work on this, but for the life of me I can't find a way to test it :laughing: Please see PR https://github.com/ethereum/hevm/pull/503
There, the file test/contracts/pass/cheatCodeErrors.sol
is what's supposed to trigger the error. However, it seems like the interpreter ignores that there are too few arguments (1 instead of 2). I can't seem to make the interpreter die. If you change the 0x24
to 0x44
there, the hevm.deal
works, so indeed it is a correct call.
So I'm stuck at testing my new fix. Do you know how could I write that inline assembly such that the interpreter will die with a BadCheatcode
and I could test my error code? On bad selector, it reverts, on incorrect parameters it just runs happily ever after, I'm confused how to actually trigger one of these :laughing:
Thanks,
Mate
Blocked currently on a good test case and a follow-up review. Perhaps in September when fewer people are on vacation, this will be merged :)
We return non-helpful errors when there is a problem with a known cheat code. For instance, here we know we are inside
ffi
but we returnBadCheatCode
withsig
which doesn't add much debugging value.Ideally, in the error, we should have the method + args like
ffi(string[])
and a failure reason.