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

fix: #13 add_test_range & sub_test_range false negatives #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions contracts/Math/ABDKMath64x64/ABDKMath64x64PropertyTests.sol
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ contract CryticABDKMath64x64Properties {
int128 result;
try this.add(x, y) {
result = this.add(x, y);
assert(result <= MAX_64x64 && result >= MIN_64x64);
assert(!(x >= 0 && y >= 0) || (result >= x && result >= y));
assert(!(x < 0 && y < 0) || (result < y && result < x));
} catch {
// If it reverts, just ignore
}
Expand Down Expand Up @@ -431,7 +432,8 @@ contract CryticABDKMath64x64Properties {
int128 result;
try this.sub(x, y) {
result = this.sub(x, y);
assert(result <= MAX_64x64 && result >= MIN_64x64);
assert(!(x >= 0 && y <= 0) || (result >= x && result >= neg (y)));
assert(!(x < 0 && y >= 0) || (result < neg(y) && result <= x));
} catch {
// If it reverts, just ignore
}
Expand Down