You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
token-2022: [I-03] Clarify calculate_inverse_fee math (#6874)
#### Problem
According to the Certora audit report:
> Description: The function calculate_inverse_fee is not exactly an
inverse operation of calculate_fee. That is, it is not the case that
calculate_inverse_fee(x + calculate_fee(x)) == calculate_fee(x).
> Recommendation: Document that calculate_inverse_fee is not an exact
inverse and instead that only the relationship calculate_fee(x) <=
calculate_inverse_fee(x + calculate_fee(x)) holds in order to avoid
confusion with the potential users of calculate_inverse_fee.
#### Solution
Do the recommended thing. I don't think the math in the comment is
correct, so I've added a test to make sure the relationship is correct.
0 commit comments