@@ -60,27 +60,21 @@ contract UniswapPairPriceAdapter is Ownable {
60
60
// Uniswap allowed pools
61
61
address [] public allowedUniswapPools;
62
62
63
- // Address of Uniswap factory
64
- address public uniswapFactory;
65
-
66
63
/* ============ Constructor ============ */
67
64
68
65
/**
69
66
* Set state variables
70
67
*
71
68
* @param _controller Instance of controller contract
72
- * @param _uniswapFactory Address of Uniswap factory
73
69
* @param _uniswapPools Array of allowed Uniswap pools
74
70
*/
75
71
constructor (
76
72
IController _controller ,
77
- address _uniswapFactory ,
78
73
IUniswapV2Pair[] memory _uniswapPools
79
74
)
80
75
public
81
76
{
82
77
controller = _controller;
83
- uniswapFactory = _uniswapFactory;
84
78
85
79
// Add each of initial addresses to state
86
80
for (uint256 i = 0 ; i < _uniswapPools.length ; i++ ) {
@@ -200,10 +194,7 @@ contract UniswapPairPriceAdapter is Ownable {
200
194
uint256 tokenTwoPriceToMaster = _priceOracle.getPrice (poolInfo.tokenTwo, _masterQuoteAsset);
201
195
202
196
// Get reserve amounts
203
- (
204
- uint256 tokenOneReserves ,
205
- uint256 tokenTwoReserves
206
- ) = UniswapV2Library.getReserves (uniswapFactory, poolInfo.tokenOne, poolInfo.tokenTwo);
197
+ (uint256 tokenOneReserves , uint256 tokenTwoReserves , ) = IUniswapV2Pair (_poolAddress).getReserves ();
207
198
208
199
uint256 normalizedTokenOneBaseUnit = tokenOneReserves.preciseDiv (poolInfo.tokenOneBaseUnit);
209
200
uint256 normalizedTokenBaseTwoUnits = tokenTwoReserves.preciseDiv (poolInfo.tokenTwoBaseUnit);
0 commit comments