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

Counter examples in Solidity #886

Open
RaoulSchaffranek opened this issue Nov 18, 2024 · 1 comment
Open

Counter examples in Solidity #886

RaoulSchaffranek opened this issue Nov 18, 2024 · 1 comment
Labels
enhancement New feature or request ux

Comments

@RaoulSchaffranek
Copy link
Member

RaoulSchaffranek commented Nov 18, 2024

It would be very cool if Kontrol could generate executable counter-examples. Here is a small example:

function prove_foo(uint256 bar) {
    assert(bar != 0xC0FFEE);
}

Kontrol fails and gives us a counter-example with bar = 0xC0FFEE. It would be even nicer if Kontrol could generate an executable unit test like this:

function prove_foo_1() {
    prove_foo(0xC0FFEE);
}

If we can make the generated test fully concrete and self-contained, it would make an excellent entry point for Simbolik, and it can be easily added as a regression test to CI.

@palinatolmach palinatolmach added enhancement New feature or request ux labels Nov 20, 2024
@palinatolmach
Copy link
Collaborator

Agreed, thanks @RaoulSchaffranek! It would also make it easier to integrate Kontrol with third-party tools like https://getrecon.xyz/.

The only challenge I see is related to mapping Kontrol cheatcodes to Foundry (there're not many incompatible ones now, and we can come up with translation rules) and, mainly, concretizing/setting up symbolic storage — right now, we don't concretize the storage entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ux
Projects
None yet
Development

No branches or pull requests

2 participants