File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
contracts/protocol/integration/oracles Expand file tree Collapse file tree 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 {
117117 * @param _assetOne Address of first asset in pair
118118 * @param _assetTwo Address of second asset in pair
119119 */
120- function getPrice (address _assetOne , address _assetTwo ) external view returns (bool , uint256 ) {
120+ function getPoolPrice (address _assetOne , address _assetTwo ) external view returns (bool , uint256 ) {
121121 require (controller.isSystemContract (msg .sender ), "Must be system contract " );
122122
123123 bool isAllowedUniswapPoolOne = uniswapPoolsToSettings[_assetOne].isValid;
@@ -148,6 +148,14 @@ contract UniswapPairPriceAdapter is Ownable {
148148 return (true , assetOnePriceToMaster.preciseDiv (assetTwoPriceToMaster));
149149 }
150150
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+
151159 function addPool (address _poolAddress ) external onlyOwner {
152160 require (
153161 ! uniswapPoolsToSettings[_poolAddress].isValid,
You can’t perform that action at this time.
0 commit comments