From 23339243b68acca1ebbb3070f8a380fb3c9faee6 Mon Sep 17 00:00:00 2001 From: Dan Liu Date: Sat, 26 Mar 2022 10:41:00 +0800 Subject: [PATCH] refactor(PriceOracle): return constant price when base asset and quote asset are same. --- contracts/protocol/PriceOracle.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/protocol/PriceOracle.sol b/contracts/protocol/PriceOracle.sol index 8a89381e1..fda1a62d5 100644 --- a/contracts/protocol/PriceOracle.sol +++ b/contracts/protocol/PriceOracle.sol @@ -120,6 +120,10 @@ contract PriceOracle is Ownable { "PriceOracle.getPrice: Caller must be system contract." ); + if (_assetOne == _assetTwo) { + return 10**18; + } + bool priceFound; uint256 price;