Platform: Code4rena
Start Date: 01/07/2022
Pot Size: $75,000 USDC
Total HM: 17
Participants: 105
Period: 7 days
Judge: Jack the Pug
Total Solo HM: 5
Id: 143
League: ETH
Rank: 22/105
Findings: 2
Award: $577.55
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: 0xNineDec
Also found by: 0x1f8b, 0x29A, 0x52, 0xDjango, 0xdanial, 0xf15ers, Cheeezzyyyy, Chom, Franfran, GalloDaSballo, Green, IllIllI, Meera, Ruhum, bardamu, cccz, codexploder, defsec, hake, hansfriese, horsefacts, hubble, hyh, jonatascm, kebabsec, oyc_109, pashov, rbserver, simon135, tabish, tintin, zzzitron
14.8726 USDC - $14.87
In times of network conjestion, the priceFeed may take longer than expected to update, and the price may take longer than usual to update, in order to ensure the latest price is fresh (within update window), you should verify that the feed was updated recently enough
Here's an example of how to ensure the price was updated recently enough
// Check Price ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ) = feed.latestRoundData(); require(block.timestamp - updatedAt < SECONDS_PER_HOUR); // Check for freshness of feed
#0 - drgorillamd
2022-07-12T19:21:01Z
Duplicate of #138
🌟 Selected for report: bardamu
Also found by: GalloDaSballo, berndartmueller, codexploder, horsefacts
562.6794 USDC - $562.68
It may be best to let the price feed be changeable as a new price feed with different update rate or threshold may be introduced in the future, however the code will not allow changing of priceFeeds.
if (feedFor[_currency][_base] != IJBPriceFeed(address(0))) revert PRICE_FEED_ALREADY_EXISTS();
Price feeds may also be deprecated and reintroduced with new addresses, because the function is limited by the onlyOwner
it may be best to allow overwriting of the price, or setting up a new function that would enable replacing or removing a deprecated price feed.
Allow the owner to set a new price feed
#0 - mejango
2022-07-12T20:05:35Z
new price feeds with updated oracles can be added and used by projects in the future.
#1 - jack-the-pug
2022-07-31T12:22:23Z
Duplicate of #59