Closed code423n4 closed 3 years ago
pants
The calculation of amount could be more precise as follows:
uint224 heldBalance = ((afterOrAtStart.amount - beforeOrAtStart.amount) * (_targetTimestamp - beforeOrAtStart.timestamp)) / (afterOrAtStart.timestamp - beforeOrAtStart.timestamp);
uint224 amount = beforeOrAtStart.amount + heldBalance;
(TwabLib.sol line 355)
Not sure if this is still relevant. Just going to acknowledge and move on.
The finding may have been valid during preview, but I can't verify it against the contest code. Invalid
Handle
pants
Vulnerability details
The calculation of amount could be more precise as follows:
uint224 heldBalance = ((afterOrAtStart.amount - beforeOrAtStart.amount) * (_targetTimestamp - beforeOrAtStart.timestamp)) / (afterOrAtStart.timestamp - beforeOrAtStart.timestamp);
uint224 amount = beforeOrAtStart.amount + heldBalance;
(TwabLib.sol line 355)