code-423n4 / 2021-10-pooltogether-findings

0 stars 0 forks source link

Lack of precision at TwabLib.sol line 355 #5

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

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)

asselstine commented 3 years ago

Not sure if this is still relevant. Just going to acknowledge and move on.

GalloDaSballo commented 3 years ago

The finding may have been valid during preview, but I can't verify it against the contest code. Invalid