Open code423n4 opened 2 years ago
chainlinkpriceoracle.md - l#86 ManagedIndexReweightingLogic.sol - l#29-32
BaseIndex.sol - l#77 IndexLibrary.sol - l#14,17,26 TopNMarketCapIndex.sol - l#8
IndexLibrary.sol l#29 (_assetPerBaseInUQ) IndexLogic.sol - l#98 (value)
UniswapV2PricePathOracle.sol - It don't follow prefix optimisations for loops, It should also use prefix ++i instead of i++ to save gas as other
Gas1: prefer fixing pragma instead of floating pragma
Gas2: break && into seperate statements for require() save gas
chainlinkpriceoracle.md - l#86 ManagedIndexReweightingLogic.sol - l#29-32
Gas3: prefer uint256 instead of other uint types
BaseIndex.sol - l#77 IndexLibrary.sol - l#14,17,26 TopNMarketCapIndex.sol - l#8
Gas4: For unsigned integer, no need to check >, instead check for !=, which save gas
IndexLibrary.sol l#29 (_assetPerBaseInUQ) IndexLogic.sol - l#98 (value)
Gas5: use prefix {++i}
UniswapV2PricePathOracle.sol - It don't follow prefix optimisations for loops, It should also use prefix ++i instead of i++ to save gas as other