makerdao / univ2-lp-oracle

GNU Affero General Public License v3.0
23 stars 13 forks source link

CVF-58: Fix unsafe cast to uint128 #46

Closed WilfredTA closed 3 years ago

WilfredTA commented 3 years ago

Adding a requires for now to ensure that a cast will not result in an overflow, and failing if this is not the case.

While this mitigates that overflow risk, I believe it is not the best solution & I spent a good amount of time thinking of others. I will open an issue for further discussion, though, since the solution is outside the scope of audit-related fix.