Open hats-bug-reporter[bot] opened 1 week ago
The price is only increasing, but in case of someone trying to steal the new price yield, selling would be done at previous price until next update (after update delay.), hence the current/previous price logic.
@AndreiMVP
The attacker who wants to steal the yield has to wait commitDelay
which starts at 1 hour
.
In order to avoid such attacks you'd have a period in which the price is updated linearly, e.g. after 1 hour of calling updatePrice
it starts increasing linearly for the next 24 hours.
Github username: -- Twitter username: -- Submission hash (on-chain): 0xf9aa717628e796693ae5526e037c0762499c8675bebb05e3f34dea348aaeb9fd Severity: medium
Description: Description\ The updatePrice() and commitPrice() functions can be frontrun and convert assets to shares, then when the new price is updated, the shares can be converted to assets for instant profit.
Attack Scenario\
Attachments