Assessment reports>Benqi Oracle>Threat Model>setDirectPrice

Function: setDirectPrice(address asset, uint256 price, bool setInEdge, bool setInChainlink)

This function sets the direct price for an asset in both underlying oracles.

Inputs

  • asset

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: An asset to set the direct price of.

  • price

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: A price to set the direct price of.

  • setInEdge

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: A boolean to set if the price should be set in the Edge oracle.

  • setInChainlink

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: A boolean to set if the price should be set in the Chainlink oracle.

Branches and code coverage

Intended branches

  • Check if the asset is a zero address.

  • Check if the price is zero.

  • Validate the price.

  • Set the price in the Edge oracle.

  • Set the price in the Chainlink oracle.

Negative behavior

  • Revert if the caller is not an owner.

  • Revert if both setInEdge and setInChainlink are false.

  • Revert if the asset is a zero address.

  • Revert if the price is zero.

Zellic © 2025Back to top ↑