Platform: Code4rena
Start Date: 19/04/2022
Pot Size: $30,000 USDC
Total HM: 10
Participants: 43
Period: 3 days
Judges: moose-code, JasoonS
Total Solo HM: 7
Id: 90
League: ETH
Rank: 17/43
Findings: 3
Award: $116.42
🌟 Selected for report: 0
🚀 Solo Findings: 0
22.0499 USDC - $22.05
Price can be stale which can lead to wrong assetPerBaseInUQ return value
Oracle data feed is insufficiently validated. There is no check for stale price and round completeness.
Manual review, similar issue was found in yield contest - https://github.com/code-423n4/2022-01-yield-findings/issues/136
Validate data feed
(uint80 roundID, int256 basePrice, , uint256 timestamp, uint80 answeredInRound) = baseAggregator.latestRoundData(); require(basePrice > 0, "ChainLink: Base price <= 0"); require(answeredInRound >= roundID, "ChainLink: Stale price"); require(timestamp > 0, "ChainLink: Round not complete"); (roundID, int256 quotePrice, , timestamp, answeredInRound) = assetInfo.aggregator.latestRoundData(); require(usdcPrice > 0, "ChainLink: Quote price <= 0"); require(answeredInRound >= roundID, "ChainLink: Stale price"); require(timestamp > 0, "ChainLink: round not complete");
#0 - olivermehr
2022-05-02T20:26:36Z
Duplicate of issue #1
🌟 Selected for report: IllIllI
Also found by: 0v3rf10w, 0xDjango, 0xkatana, Dravee, Kenshin, Tadashi, TerrierLover, abhinavmir, defsec, ellahi, fatima_naz, foobar, gzeon, hyh, joestakey, kebabsec, kenta, minhquanym, oyc_109, rayn, robee, sseefried, xpriment626, z3s
62.9884 USDC - $62.99
1)- __gap is defined as storage variable but never used, - In vToken.sol https://github.com/code-423n4/2022-04-phuture/blob/594459d0865fb6603ba388b53f3f01648f5bb6fb/contracts/vToken.sol#L222
2)- As mentioned in github description of ManageIndexReweightingLogic.sol - This index reweighs manually by it's admin. shouldn't we put some modifier for reweight function! it is defined as external but as the users of protocol need not to call this function. adding some modifier could be a good practice.
similary here for TopNMarketCapReweightingLogic.sol
🌟 Selected for report: IllIllI
Also found by: 0v3rf10w, 0xDjango, 0xNazgul, 0xkatana, Dravee, Kenshin, MaratCerby, Tadashi, TerrierLover, Tomio, TrungOre, defsec, ellahi, fatherOfBlocks, fatima_naz, gzeon, joestakey, kenta, minhquanym, oyc_109, rayn, rfa, robee, simon135, slywaters, windhustler, z3s
31.3783 USDC - $31.38
1)- initialization of uint in for loop, default value of uint is zero - UniswapV2PathPriceOracle.sol https://github.com/code-423n4/2022-04-phuture/blob/594459d0865fb6603ba388b53f3f01648f5bb6fb/contracts/UniswapV2PathPriceOracle.sol#L49
2)- use (!=0) instead of >0 ( gas efficient). uint can't be negative - https://github.com/code-423n4/2022-04-phuture/blob/594459d0865fb6603ba388b53f3f01648f5bb6fb/contracts/IndexLogic.sol#L76
3)- use require instead of assert. require will revert and return the gas at failure. https://github.com/code-423n4/2022-04-phuture/blob/47cd226c80842585542599a3b56cc2a26b519d8a/contracts/IndexLogic.sol#L72