It calculates proportional amount of Roots to transfer when transfers Stalk to another account. It wants to roundUp the division, however it's done incorrectly:
https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/df2dd129a878d16d4adc75049179ac0029d9a96b/protocol/contracts/libraries/Silo/LibSilo.sol#L296-L298
Counter example is following: 5 * 500 / 3
is rounded down to 833. Well known formula to roundUp is to subtract 1 from numerator and add 1 to result, so in example it will be (5 * 500 - 1) / 3 + 1 = 834
.
However current formula calculates (5 - 1) * 500 / 3 + 1 = 666
, which is obviously wrong.
Instead of rounding up actual formula in the contrary underestimates the result.
Manual Review
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.