From 24f26f202459efcdba8c542fbae869f07c57dfa9 Mon Sep 17 00:00:00 2001 From: Dima Lekhovitsky Date: Sun, 22 Oct 2023 18:20:47 +0300 Subject: [PATCH] fix: add clarifying comments --- contracts/core/PriceOracleV3.sol | 2 ++ contracts/credit/CreditConfiguratorV3.sol | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/contracts/core/PriceOracleV3.sol b/contracts/core/PriceOracleV3.sol index f1a448fe..2d80d19b 100644 --- a/contracts/core/PriceOracleV3.sol +++ b/contracts/core/PriceOracleV3.sol @@ -24,6 +24,8 @@ import {PriceFeedValidationTrait} from "../traits/PriceFeedValidationTrait.sol"; /// to the price oracle by returning `skipPriceCheck = true`. /// Price oracle also allows to set a reserve price feed for a token, that can be activated /// in case the main one becomes stale or starts returning wrong values. +/// One should not expect the reserve price feed to always differ from the main one, although +/// most often that would be the case. contract PriceOracleV3 is ACLNonReentrantTrait, PriceFeedValidationTrait, IPriceOracleV3 { /// @notice Contract version uint256 public constant override version = 3_00; diff --git a/contracts/credit/CreditConfiguratorV3.sol b/contracts/credit/CreditConfiguratorV3.sol index 2c5bd36b..8ab73fc8 100644 --- a/contracts/credit/CreditConfiguratorV3.sol +++ b/contracts/credit/CreditConfiguratorV3.sol @@ -874,7 +874,8 @@ contract CreditConfiguratorV3 is ICreditConfiguratorV3, ACLNonReentrantTrait { return CreditManagerV3(creditManager).getTokenMaskOrRevert(token); // I:[CC-7] } - /// @dev Ensures that contract is compatible with credit manager + /// @dev Ensures that contract is compatible with credit manager by checking that it implements + /// the `creditManager()` function that returns the correct address function _revertIfContractIncompatible(address _contract) internal view @@ -884,6 +885,7 @@ contract CreditConfiguratorV3 is ICreditConfiguratorV3, ACLNonReentrantTrait { revert AddressIsNotContractException(_contract); // I:[CC-12A,29] } + // any interface with `creditManager()` would work instead of `CreditFacadeV3` here try CreditFacadeV3(_contract).creditManager() returns (address cm) { if (cm != creditManager) revert IncompatibleContractException(); // I:[CC-12B,29] } catch {