@@ -29,25 +29,25 @@ abstract contract OracleHelper {
2929 /// @notice The Oracle contract used to fetch the latest token prices
3030 IOracle tokenOracle;
3131
32- /// @notice The Oracle contract used to fetch the latest ETH prices. Only needed if tokenToNativeOracle flag is not set.
32+ /// @notice The Oracle contract used to fetch the latest native asset prices. Only needed if tokenToNativeOracle flag is not set.
3333 IOracle nativeOracle;
3434
3535 /// @notice If 'true' we will fetch price directly from tokenOracle
3636 /// @notice If 'false' we will use nativeOracle to establish a token price through a shared third currency
3737 bool tokenToNativeOracle;
3838
39- /// @notice 'false' if price is dollars- per-token (or ether- per-token), 'true' if price is tokens-per-dollar
39+ /// @notice 'false' if price is bridging-asset- per-token (or native-asset- per-token), 'true' if price is tokens-per-bridging-asset
4040 bool tokenOracleReverse;
4141
42- /// @notice 'false' if price is dollars- per-ether , 'true' if price is ether- per-dollar
42+ /// @notice 'false' if price is bridging-asset- per-native-asset , 'true' if price is native-asset- per-bridging-asset
4343 bool nativeOracleReverse;
4444
4545 /// @notice The price update threshold percentage from PRICE_DENOMINATOR that triggers a price update (1e26 = 100%)
4646 uint256 priceUpdateThreshold;
4747
4848 }
4949
50- /// @notice The cached token price from the Oracle, always in (ether -per-token) * PRICE_DENOMINATOR format
50+ /// @notice The cached token price from the Oracle, always in (native-asset -per-token) * PRICE_DENOMINATOR format
5151 uint256 public cachedPrice;
5252
5353 /// @notice The timestamp of a block when the cached price was updated
@@ -130,30 +130,30 @@ abstract contract OracleHelper {
130130 * @param nativeAssetPrice - the price of the native asset relative to a bridging asset or 1 if no bridging needed.
131131 * @param tokenOracleReverse - flag indicating direction of the "tokenPrice".
132132 * @param nativeOracleReverse - flag indicating direction of the "nativeAssetPrice".
133- * @return the ether -per-token price multiplied by the PRICE_DENOMINATOR constant.
133+ * @return the native-asset -per-token price multiplied by the PRICE_DENOMINATOR constant.
134134 */
135135 function calculatePrice (
136136 uint256 tokenPrice ,
137137 uint256 nativeAssetPrice ,
138138 bool tokenOracleReverse ,
139139 bool nativeOracleReverse
140140 ) private view returns (uint256 ){
141- // tokenPrice is normalized as dollars -per-token
141+ // tokenPrice is normalized as bridging-asset -per-token
142142 if (tokenOracleReverse) {
143- // inverting tokenPrice that was tokens-per-dollar (or tokens-per-ether )
143+ // inverting tokenPrice that was tokens-per-bridging-asset (or tokens-per-native-asset )
144144 tokenPrice = PRICE_DENOMINATOR * tokenOracleDecimalPower / tokenPrice;
145145 } else {
146- // tokenPrice already dollars- per-token (or ethers -per-token)
146+ // tokenPrice already bridging-asset- per-token (or native-asset -per-token)
147147 tokenPrice = PRICE_DENOMINATOR * tokenPrice / tokenOracleDecimalPower;
148148 }
149149
150150 if (nativeOracleReverse) {
151- // multiplying by nativeAssetPrice that is ethers- per-dollar
152- // => result = (dollar / token) * (ether / dollar ) = ether / token
151+ // multiplying by nativeAssetPrice that is native-asset- per-bridging-asset
152+ // => result = (bridging-asset / token) * (native-asset / bridging-asset ) = native-asset / token
153153 return nativeAssetPrice * tokenPrice / nativeOracleDecimalPower;
154154 } else {
155- // dividing by nativeAssetPrice that is dollars- per-ether
156- // => result = (dollar / token) / (dollar / ether ) = ether / token
155+ // dividing by nativeAssetPrice that is bridging-asset- per-native-asset
156+ // => result = (bridging-asset / token) / (bridging-asset / native-asset ) = native-asset / token
157157 return tokenPrice * nativeOracleDecimalPower / nativeAssetPrice;
158158 }
159159 }
0 commit comments