Closed pscott closed 6 months ago
Looks good. I do agree this simplifies the reasoning for a fixed boost size.
Now the fee is computed as a % of the boost balance increase rather than the deposit amount. We should be explicit about this in the comments//docs. There is no longer a limit on the token fee of 10000.
An interesting edge case of this is that its now impossible to have a 100% fee due to the asymptotic nature of the fee curve.
It should be fine to just use uint256.max
though and the loss of precision should handle it.
Good point about updating the doc, I will do that (I had removed the reverts but forgot to update the comment).
Regarding asymptote: indeed this had occurred to me: I managed to get a 100%
fee by using this little trick:
https://github.com/snapshot-labs/boost/blob/9440238ca7e82fc76815c98b02c6dd3d4d647645/test/ProtocolFees.t.sol#L223
🔥
Makes it easier for the depositor to compute the exact amount needed to deposit.
e.g for a prize of 100 and a tokenFee of 10, just send 110. Previously, you would've had to deposit
100 * 100 / 90 == 111.111