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

Better printing for 0x0 selector in counterexample #419

Open
igorganich opened this issue Nov 22, 2024 · 0 comments
Open

Better printing for 0x0 selector in counterexample #419

igorganich opened this issue Nov 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@igorganich
Copy link

Is your feature request related to a problem? Please describe.
We can use

bytes4 selector = svm.createBytes4("selector");
vm.assume(bytes4(some_data) == selector);

pattern to print it in counterexamples.
In the case of normal functions, it prints pretty functions names in counterexamples:

Counterexample:
...
    halmos_selector_bytes4_213bfa9_18 = withdraw

But if the function is ETH transferring (0x0) - it just prints

Counterexample:
...
    halmos_selector_bytes4_2b8420c_24 = 0x00000000

And I think such behavior may be enhanced

Describe the solution you'd like
Maybe, print "transfer" instead of 0x00000000 ?

Additional context

  1. checkout on this commit igorganich/damn-vulnerable-defi-halmos@cc4fadc
  2. halmos --solver-timeout-assertion 0 --function check_sideEntrance
  3. see counterexamples
@igorganich igorganich added the enhancement New feature or request label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant