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
The average computation in the Select.sol library can overflow because the average is computed with (a + b) / 2 (see here).
An overflow would be caught by Open Zeppelin's SafeMath library, but this would lead to reverting the transaction.
Even though the real values in the Ampleforth oracles are not big enough for overflows, consider distributing the computation with (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2) to avoid the possibility altogether and improve the re-use of the Select.sol library.
The text was updated successfully, but these errors were encountered:
The average computation in the
Select.sol
library can overflow because the average is computed with(a + b) / 2
(see here).An overflow would be caught by Open Zeppelin's
SafeMath
library, but this would lead to reverting the transaction.Even though the real values in the Ampleforth oracles are not big enough for overflows, consider distributing the computation with
(a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2)
to avoid the possibility altogether and improve the re-use of theSelect.sol
library.The text was updated successfully, but these errors were encountered: