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
It is not possible to write fuzz tests without a baseline against which to compare the test values. There are two possible solutions for this:
Fuzz against another Solidity math library
Fuzz against a math library written in another programming language
The issue with 1 is that there is no other Solidity math library that has all the functions that PRBMath has. Furthermore, I'm not aware of any other Solidity library with more tests than PRBMath. If I am to fuzz against a third-party, I would rather do it against a library that is battle-tested from a testing perspective.
The proper solution seems to be 2, whereby I use the ffi cheatcode and test against a Rust-based fixed-point math library such as fixed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It is not possible to write fuzz tests without a baseline against which to compare the test values. There are two possible solutions for this:
The issue with 1 is that there is no other Solidity math library that has all the functions that PRBMath has. Furthermore, I'm not aware of any other Solidity library with more tests than PRBMath. If I am to fuzz against a third-party, I would rather do it against a library that is battle-tested from a testing perspective.
The proper solution seems to be 2, whereby I use the
ffi
cheatcode and test against a Rust-based fixed-point math library such as fixed.More research needed on this.
Beta Was this translation helpful? Give feedback.
All reactions