Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add Echidna Tests #16
Add Echidna Tests #16
Changes from 34 commits
b8b0c46
76263a2
17eb123
249bc10
ce48f5a
9b5ac48
ccdc6ad
c758324
859bd83
a7067de
15b99cd
a2a1c3f
987d9e9
8bd10a3
b410712
f6c75c3
1e38053
265cfc2
0bc19c0
92ed7bc
9908549
8fda89f
0c411b2
3ec2ef7
782ad06
4965922
871d4e7
27ea557
5c8bd99
e0904fe
6178810
f09c6fb
05110a0
2264418
ed9846b
0c23bcb
cc7595f
b313c1e
14c0f50
7bc78af
c518a3c
4cf1724
1ba313b
11c4382
0549117
0380b12
f586a92
7417bfa
2d2cc02
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might also be worthwhile to have a test that hevm warps to some random point during or after init and check that payouts and
accrued
andunpaid
values all line up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I think @kmbarry1 will make some dapp fuzz tests as well leveraging on
hevm.warp
to fuzz time-dependant logic and compare the two approaches.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I was kind of waiting for all the churn to settle down in the code itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the issue here is that the award will almost never exist if
id
is a randomuint256
. You'll need to mod it into the appropriate range:id = 1 + id % vest.ids();
to effectively test already-created vests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_vest
andtest_yank
are called insidetest_init
with an existing valid id.I can fuzz them independently leveraging on the preserved state option eventually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't fuzz the ids cause they're checked in all the functions on dss-vest, if the award exists, so declaring both
test_vest
andtest_yank
internal allows to check for asserts ontest_init
seeds.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this approach is good enough. The only downside is every award gets
yanked
before any more are created, so you're never testing with multiple awards in existence. However, given how the contract is written, there's very little chance of bugs that only surface when multiple awards exist.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll have a similar issue here as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case
test_yank
, that is called insidetest_init
, will use an existing valid id plus an_end
seed fromtest_init
.