From 95cf63bbe1003f1da13bc34439c1986be838d87e Mon Sep 17 00:00:00 2001 From: Mati Date: Tue, 13 Jun 2023 18:53:43 -0300 Subject: [PATCH] Add rounding behavior in docstring --- contracts/USDM.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/USDM.sol b/contracts/USDM.sol index 332d353..702f6f2 100644 --- a/contracts/USDM.sol +++ b/contracts/USDM.sol @@ -110,6 +110,10 @@ contract USDM is * @notice Converts an amount of tokens to shares. * @param amount The amount of tokens to convert. * @return The equivalent amount of shares. + * + * Note: All rounding errors should be rounded down in the interest of the protocol's safety. + * Token transfers, including mint and burn operations, may require a rounding, leading to potential + * transferring at most one GWEI less than expected aggregated over a long period of time. */ function convertToShares(uint256 amount) public view returns (uint256) { return (amount * _BASE) / rewardMultiplier;