You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and This code in line 33,35 is a error you must fix it ( Explicit type conversion not allowed from "int8" to "uint256" )
if (adjustment >0) {
x = x.mul(10**uint256(adjustment));
} elseif (adjustment <0) {
x = x.div(10**uint256(adjustment *-1));
}
return x;
}
libraries/UniswapV2OracleLibrary.sol
error in code line source files let see this
fix source files IUniswapV2Pair.sol,Babylonian.sol just add spdx licensi
fix error in code line = 48,53,58,63,68 in file BitMath.sol (Explicit type conversion not allowed from "int_const -1" to "uint16")
fix error in code line = 81,87,98,100,105,115,117,121,138 in file FixedPoint.sol (Explicit type conversion not allowed from "int_const -1" to "uint144")
fix error in code line = 8,19,22 in file FullMath.sol ( Unary operator - cannot be applied to type uint256 )
and add spdx licensi
pragma solidity>=0.5.0;
import'../interfaces/IUniswapV2Pair.sol';
import'./FixedPoint.sol';
// library with helper methods for oracles that are concerned with computing average priceslibraryUniswapV2OracleLibrary {
using FixedPointfor*;
// helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]function currentBlockTimestamp() internalviewreturns (uint32) {
returnuint32(block.timestamp%2**32);
}
// produces the cumulative price using counterfactuals to save gas and avoid a call to sync.function currentCumulativePrices(
addresspair
) internalviewreturns (uintprice0Cumulative, uintprice1Cumulative, uint32blockTimestamp) {
blockTimestamp =currentBlockTimestamp();
price0Cumulative =IUniswapV2Pair(pair).price0CumulativeLast();
price1Cumulative =IUniswapV2Pair(pair).price1CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112reserve0, uint112reserve1, uint32blockTimestampLast) =IUniswapV2Pair(pair).getReserves();
if (blockTimestampLast != blockTimestamp) {
// subtraction overflow is desireduint32 timeElapsed = blockTimestamp - blockTimestampLast;
// addition overflow is desired// counterfactual
price0Cumulative +=uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;
// counterfactual
price1Cumulative +=uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;
}
}
}
libraries/InitializableERC20Detail.sol
fix pragma solidity in this file upgrade to up, because Source file requires different compiler version builds the released version pragma solidity ^0.8.0;