Skip to content

Keep3rV2Oracle Overflow Bug #54

@b0dhidharma

Description

@b0dhidharma

Keep3rV2Oracle is not to using FixedPoint library and it's using solc 0.8.x, this introduces a possible revert.

Last price cumulative's in uniswap / sushiswap pairs are accumulators, and they are designed to overflow.

When doing the calculations with these queried value, Keep3rV2Oracle does a priceLast * e10 / Q112 .

If the cumulative price is big enough * e10 will throw an overflow because of checked math in solidity 0.8.x, therefore reverting.

Very rough branch demonstrating that it will fail: link.

It does not represent an immediate risk but it depends a lot on pair's volume and tokens decimals. So, I'd strongly suggest to deprecate the oracle / fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions