Skip to content
New issue

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

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

Already on GitHub? # to your account

💥 Integrate 🐍 snekmate Contracts With Halmos #180

Closed
pcaversaccio opened this issue Nov 8, 2023 · 0 comments · Fixed by #207 or #240
Closed

💥 Integrate 🐍 snekmate Contracts With Halmos #180

pcaversaccio opened this issue Nov 8, 2023 · 0 comments · Fixed by #207 or #240
Assignees
Labels
feature 💥 New feature or request help wanted 🆘 Extra attention is needed
Milestone

Comments

@pcaversaccio
Copy link
Owner

Halmos is a symbolic testing tool for EVM smart contracts. Solidity is currently offered by default, but Vyper support is added incrementally. Since we write all tests in Solidity (and is fully open-source), it integrates well with our test framework. Thus, we should use Halmos to formally verify 🐍 snekmate contracts.

References

@pcaversaccio pcaversaccio self-assigned this Nov 8, 2023
@pcaversaccio pcaversaccio added feature 💥 New feature or request help wanted 🆘 Extra attention is needed labels Nov 8, 2023
@pcaversaccio pcaversaccio added this to the 0.0.5 milestone Nov 8, 2023
@pcaversaccio pcaversaccio modified the milestones: 0.0.5, 0.1.0 Mar 7, 2024
@pcaversaccio pcaversaccio linked a pull request Apr 25, 2024 that will close this issue
pcaversaccio added a commit that referenced this issue May 22, 2024
### 🕓 Changelog

This PR adds [`halmos`](https://github.com/a16z/halmos)-based symbolic
tests for the `erc20`, `erc721`, `erc1155`, and `math` contracts (closes
#180). The `erc721` and `erc1155` tests each take substantial amount of
time as part of the CI. Hence, we run the new `halmos` CI pipeline each
day at 03:30 a.m. (= "nightly" tests) as scheduled `cron` job instead of
integrating it into the normal `push` and `pull_request` pipeline.
Furthermore, the `halmos`-based `math` tests `testHalmosAssertMulDiv`,
`testHalmosAssertWadLn`, `testHalmosAssertWadExp`,
`testHalmosAssertCbrt`, and `testHalmosAssertWadCbrt` face out of memory
issues as the timeout for the Z3 solver does not work for the queries of
these tests. Thus, these tests are currently commented out.
Additionally, the test `testHalmosAssertNoBackdoor` in the `erc721` and
`erc1155` contracts is currently commented out due to performance and
reverting path issues in `halmos`. Eventually, we target the `main`
`halmos` branch (= "nightly" version) in the CI pipeline and use the
[Yices 2 SMT solver](https://github.com/SRI-CSL/yices2).

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio changed the title 💥 Integrate 🐍 snekmate Contracts with Halmos 💥 Integrate 🐍 snekmate Contracts With Halmos Jun 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature 💥 New feature or request help wanted 🆘 Extra attention is needed
Projects
None yet
1 participant