File tree 1 file changed +9
-1
lines changed
contracts/protocol/integration/oracles
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ contract UniswapPairPriceAdapter is Ownable {
117
117
* @param _assetOne Address of first asset in pair
118
118
* @param _assetTwo Address of second asset in pair
119
119
*/
120
- function getPrice (address _assetOne , address _assetTwo ) external view returns (bool , uint256 ) {
120
+ function getPoolPrice (address _assetOne , address _assetTwo ) external view returns (bool , uint256 ) {
121
121
require (controller.isSystemContract (msg .sender ), "Must be system contract " );
122
122
123
123
bool isAllowedUniswapPoolOne = uniswapPoolsToSettings[_assetOne].isValid;
@@ -148,6 +148,14 @@ contract UniswapPairPriceAdapter is Ownable {
148
148
return (true , assetOnePriceToMaster.preciseDiv (assetTwoPriceToMaster));
149
149
}
150
150
151
+ function getPrice (address _assetOne , address _assetTwo ) external view returns (bool , uint256 ) {
152
+ try this .getPoolPrice (_assetOne, _assetTwo) returns (bool found , uint256 price ) {
153
+ if (found) {
154
+ return (true , price);
155
+ }
156
+ } catch {}
157
+ }
158
+
151
159
function addPool (address _poolAddress ) external onlyOwner {
152
160
require (
153
161
! uniswapPoolsToSettings[_poolAddress].isValid,
You can’t perform that action at this time.
0 commit comments