Take a look at https://github.com/Cyfrin/2024-05-Beanstalk-3/blob/662d26f12ee219ee92dc485c06e01a4cb5ee8dfb/protocol/contracts/libraries/LibUnripe.sol#L178-L184
This function returns the total percentage that beanstalk has recapitalized and this is calculated by the ratio of s.recapitalized and the total dollars the barnraise needs to raise, and the documentation hints that this finalized with the same same precision as getRecapPaidPercentAmount
(100% recapitalized = 1e6).
However going to the implementation of getRecapPaidPercentAmount
https://github.com/Cyfrin/2024-05-Beanstalk-3/blob/662d26f12ee219ee92dc485c06e01a4cb5ee8dfb/protocol/contracts/libraries/LibUnripe.sol#L233-L239
We can see that the latter implementation lacks any multiplication whatsoever to the DECIMALS
var, which indicates that the value returned is going to be deflated by 1e6
Contract fails to return promised values, since sister functions heavily desynchronizes from each other, would be key to note that that these functions are both heavily used in the UnripeFacet.
Manual review
Consider having both implementation multiply their calculation by the DECIMALS
var.
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.