Assessment reports>Benqi Oracle>Threat Model>normalizePrice

Function: normalizePrice(uint256 price, uint8 currentDecimals)

This function normalizes the price to 18 decimals.

Inputs

  • price

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: A price to normalize.

  • currentDecimals

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The current number of decimals of the price.

Branches and code coverage

Intended branches

  • Check if the current number of decimals is 18.

  • Check if the current number of decimals is less than 18.

  • Check if the current number of decimals is greater than 18.

Zellic © 2025Back to top ↑