This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information