Skip to content

InvPriceFeed.latestRoundData potentially incorrect calculation #104

@barakman

Description

@barakman

In the aforementioned function:

int256 invDollarPrice = (invUsdcPrice * usdcUsdPrice) /
    int(10 ** (decimals() - 10));

It is not really clear why you subtract 10 from your decimals().
In particularly, because USDC decimals are 6, and your decimals are 18.
Even if this is indeed the intended behavior, you probably still want to add proper documentation explaining this subtraction.

The natspec documentation (right above the function) related to this variable seems wrong or obsolete.
This variable appears 2nd in the list of returned values, but your documentation specifies a different name altogether:

* @return usdcUsdPrice The latest USDC price in USD computed from the INV/USDC and USDC/USD feeds

So I suspect that it is possibly incorrect at this point (not just the return-value name, but also the actual description of it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions