Open c4-bot-7 opened 7 months ago
0xA5DF marked the issue as primary issue
0xA5DF changed the severity to 2 (Med Risk)
Marking as med since it'll only take the fee part (which is only a small percentage I guess) and I guess also the allocator isn't going to change very often. Tagging @0xend to correct me if I'm wrong
0xA5DF marked the issue as selected for report
0xA5DF marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/pools/Pool.sol#L211
Vulnerability details
Vulnerability details
owner
can submitgetPendingBaseInterestAllocator
first, and then anyone can enable it byconfirmBaseInterestAllocator()
.The current logic is
BaseInterestAllocator
and put it inPool
.If the old BaseInterestAllocator already has a large balance, the balance of the Pool will increase dramatically.
Subsequent users executing
reallocate()
will get a big bonusgetReallocationBonus
.Assuming old
BaseInterestAllocator
balance:1 Mshares = 1 M (1 - optimalIdleRange.mid) totalSupply * getReallocationBonus / totalAssets()
Impact
after change BaseInterestAllocator, may pay large getReallocationBonus
Recommended Mitigation
Execute
_reallocate()
in theconfirmBaseInterestAllocator()
method without paying anygetReallocationBonus
.Assessed type
Context