Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: more visibility for unsupported cheatcodes (BadCheatCode) #938

Closed
0xPhaze opened this issue Feb 15, 2023 · 3 comments · Fixed by #1283
Closed

feat: more visibility for unsupported cheatcodes (BadCheatCode) #938

0xPhaze opened this issue Feb 15, 2023 · 3 comments · Fixed by #1283
Labels
hevm Requires changes in hevm

Comments

@0xPhaze
Copy link

0xPhaze commented Feb 15, 2023

Using unrecognized cheatcodes results in a failure.

import "forge-std/Test.sol";

contract TestContract is Test {
    function test123(uint256 x) public {
        vm.assume(false);
        vm.expectRevert();
    }
}
echidna-test . --contract TestContract --test-mode dapptest --format text --test-limit 100
Analyzing contract: /Users/lain/git/eth/template/test/TestContract.sol:TestContract
echidna-test: VM failed for unhandled reason, BadCheatCode (Just 1281615202). This shouldn't happen. Please file a ticket with this error message and steps to reproduce!

It would be great to know what cheatcode was executed (and perhaps where), as these can be difficult to find in larger codebases. Additionally, maybe unsupported cheatcodes could just be ignored (after printing an error message).

@arcz
Copy link
Member

arcz commented Feb 15, 2023

Yeah, we should handle it better, thanks for reporting.

@ggrieco-tob
Copy link
Member

Cheatcodes can only be hanlded using hevm because they generate a special type of error.

@arcz arcz added the hevm Requires changes in hevm label Mar 4, 2024
@arcz
Copy link
Member

arcz commented Jun 21, 2024

We should print a trace for any VM error, this will show which cheat code was called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hevm Requires changes in hevm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants