You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As explained here, fuzzing arrays is quite difficult in Solidity.
However, given our business logic, it would be extremely beneficial to have a suite of tests that fuzz the segments, testing different values for the amounts, milestones, and exponents.
The difficulty lies in the fact that our segments have special constraints - they can't be just any random sequence of data. Specifically, in the successful function execution paths, both of the following conditions must pass:
The amounts must add up to the net deposit amount.
The milestones must be ordered.
When I attempted to fuzz the arrays during the development of #220, I ended up giving up because I was getting too many test rejects, and also the test runs were unbearably slow (though I can't remember if that was, in part, caused by the activation of via IR).
Here's a GitHub Gist with quick sort algorithm I wrote back then, which might be handy when we pick this task up again:
As explained here, fuzzing arrays is quite difficult in Solidity.
However, given our business logic, it would be extremely beneficial to have a suite of tests that fuzz the segments, testing different values for the amounts, milestones, and exponents.
The difficulty lies in the fact that our segments have special constraints - they can't be just any random sequence of data. Specifically, in the successful function execution paths, both of the following conditions must pass:
When I attempted to fuzz the arrays during the development of #220, I ended up giving up because I was getting too many test rejects, and also the test runs were unbearably slow (though I can't remember if that was, in part, caused by the activation of via IR).
Here's a GitHub Gist with quick sort algorithm I wrote back then, which might be handy when we pick this task up again:
https://gist.github.com/paulrberg/61e5a90434bd4bad31d9dbe9dd0c500e
The text was updated successfully, but these errors were encountered: