-
Notifications
You must be signed in to change notification settings - Fork 710
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
Document invariant testing + patterns #497
Comments
Getting this done. |
Thoughts on patterns: Open Invariant TestingThis testing pattern deploys all relevant contracts in the
Bounded Actor-Based Invariant TestingThis testing pattern deploys all relevant contracts in the User contract reference. To take it a step further, a contract can be used to dynamically deploy new actors during the fuzzing campaign and perform actions from these actors (example). Another use case for this pattern is to create a contract that will call the This pattern must add all non-wrapper contracts deployed in the
Unbounded Actor-Based Invariant TestingSimilar pattern to above, except with unbounded parameters. This allows for the contract to be called without any artificially bounded parameters, potentially exposing previously unconceived vectors to break invariants. This pattern must use
|
Hey @lucas-manuel can we get examples of the first and last example too please, thanks |
Currently all the invariant examples we have are private, but here is an open source implementation of bounded actor-based invariant testing: https://github.com/maple-labs/revenue-distribution-token/blob/add-forge-invariants/contracts/test/Invariants.t.sol |
When are Invariant tests expected to be released to the public? Looking forward to it. Thanks! |
They are already released! |
What! Am I looking at the wrong version of the foundry book? Or, can I have a link to the documentation of invariant tests? Damn I'm excited! |
And an example project where it is used? |
Scroll up |
There is no official docs for this still? |
Soon :) For now take a look at https://github.com/lucas-manuel/invariant-example and #760 |
Also maple-core-v2. |
what is the best way of managing blockchain time in invariant tests? |
What does |
Could you guys please open new issues about these questions, for us to document them in the book? |
foundry-rs/foundry#1572
https://github.com/maple-labs/revenue-distribution-token/tree/e0eca03c2ff05c36000a097de678543d7234f7cc/contracts/test
document simple invariant breaking, the actor model from Maple's RDT, usage of targetContract(s) etc
The text was updated successfully, but these errors were encountered: