-
Notifications
You must be signed in to change notification settings - Fork 373
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
Experimental power number generator for uints #892
Conversation
I have run some tests. It does not seem to be working. I would expect echidna to be able to break pragma solidity ^0.8.0;
contract EchidnaTest {
uint256 private constant min = 16;
uint256 private constant max = 20;
function helper(uint256 amount) public {
amount = (10**min) + (amount % ((10**max) - (10**min)));
testAmount(amount);
}
function testAmount(uint256 amount) public {
if (amount > (10**min) && amount < (10**max)) {
assert(false);
}
}
} testMode: assertion
testLimit: 100000 |
This is working now, thanks @rappie ! |
I have tested this. As expected, it is noticably slower to break certain properties than before, but it does manage to break them without helpers. Personally I'd prefer to have only the logarithmic RNG. I believe this to be superior for fuzzing, but then again I'm no expert :) |
359e069
to
12a30c6
Compare
12a30c6
to
4ab9b8a
Compare
lib/Echidna/ABI.hs
Outdated
[ (getRandomR (0, 1023), 1) | ||
, (getRandomR (0, 2 ^ n - 5), 8) | ||
, (getRandomR (2 ^ n - 5, 2 ^ n - 1), 1) | ||
, (getRandomPow (n - 5), 4) |
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.
as I understand the chance of this happening will be 4/14 ~ 28%?
0ee2135
to
3c4dd1c
Compare
This should be considered experimental until we know it works better