diff --git a/contracts/ResilientOracle.sol b/contracts/ResilientOracle.sol index 8e16b33f..543b1263 100755 --- a/contracts/ResilientOracle.sol +++ b/contracts/ResilientOracle.sol @@ -247,7 +247,10 @@ contract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOr /** * @notice Updates the capped main oracle snapshot. - * @dev This function should always be called before calling getPrice + * @dev This function should always be called before calling getPrice. + * A successful return does NOT guarantee the snapshot was advanced — CAPO-style + * main oracles no-op `updateSnapshot()` while within `snapshotInterval`, or when + * `snapshotInterval == 0`. * @param asset asset address */ function updateAssetPrice(address asset) external { diff --git a/contracts/oracles/OneJumpOracle.sol b/contracts/oracles/OneJumpOracle.sol index 8c3acdfb..cf5ff289 100644 --- a/contracts/oracles/OneJumpOracle.sol +++ b/contracts/oracles/OneJumpOracle.sol @@ -13,6 +13,10 @@ import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/I */ contract OneJumpOracle is CorrelatedTokenOracle { /// @notice Address of the intermediate oracle + /// @dev MUST return the price of `CORRELATED_TOKEN` denominated in `UNDERLYING_TOKEN` + /// (scaled to `36 - underlyingDecimals`), NOT a USD-denominated price. A USD feed + /// would inflate `getUnderlyingAmount()`; with `snapshotInterval == 0` (CAPO cap + /// disabled) the inflated value would reach `ResilientOracle` unbounded. OracleInterface public immutable INTERMEDIATE_ORACLE; /// @notice Constructor for the implementation contract. diff --git a/yarn.lock b/yarn.lock index c21d32de..e2039ac2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4131,29 +4131,7 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/oracle@npm:^2.7.0": - version: 2.14.0 - resolution: "@venusprotocol/oracle@npm:2.14.0" - dependencies: - "@chainlink/contracts": ^0.5.1 - "@defi-wonderland/smock": 2.4.0 - "@nomicfoundation/hardhat-network-helpers": ^1.0.8 - "@openzeppelin/contracts": ^4.6.0 - "@openzeppelin/contracts-upgradeable": ^4.7.3 - "@venusprotocol/governance-contracts": ^2.13.0 - "@venusprotocol/solidity-utilities": ^2.0.0 - "@venusprotocol/venus-protocol": ^9.7.0 - ethers: ^5.6.8 - hardhat: 2.22.18 - hardhat-deploy: ^0.12.4 - module-alias: ^2.2.2 - patch-package: ^8.0.0 - solidity-docgen: ^0.6.0-beta.29 - checksum: e10a6b303cb2d41f158fdae300d030f9fb506e0d389414a7b94fdada89bd322ad3e452a8b929a8e42602dd93e380916bbc86c9ba58fdf5178d38fbbb71edadb8 - languageName: node - linkType: hard - -"@venusprotocol/oracle@workspace:.": +"@venusprotocol/oracle@^2.7.0, @venusprotocol/oracle@workspace:.": version: 0.0.0-use.local resolution: "@venusprotocol/oracle@workspace:." dependencies: