Skip to content

Commit

Permalink
fix: add clarifying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lekhovitsky committed Oct 22, 2023
1 parent 2d70d93 commit 24f26f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions contracts/core/PriceOracleV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion contracts/credit/CreditConfiguratorV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 24f26f2

Please sign in to comment.