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
In the getImbalance function, the multiplication totalImbalance *= resolution is performed unchecked.
Since the resolution field can be arbitrarily big and totalImbalance can reach 2
63−1, overflows are possible.
A check on writing the resolution variable could be introduced to avoid this.
Since the function is only used to retrieve information and in a benevolent case resolution should not be
this big, this is unlikely. But because this function is used in the getRate function, a consequence could be
returning a wrong rate to users.
The same applies to currentBlockImbalance *= resolution.
The text was updated successfully, but these errors were encountered:
In the getImbalance function, the multiplication totalImbalance *= resolution is performed unchecked.
Since the resolution field can be arbitrarily big and totalImbalance can reach 2
63−1, overflows are possible.
A check on writing the resolution variable could be introduced to avoid this.
Since the function is only used to retrieve information and in a benevolent case resolution should not be
this big, this is unlikely. But because this function is used in the getRate function, a consequence could be
returning a wrong rate to users.
The same applies to currentBlockImbalance *= resolution.
The text was updated successfully, but these errors were encountered: