diff --git a/contracts/contracts/token/OUSD.sol b/contracts/contracts/token/OUSD.sol index 21880e350e..8bd07380bf 100644 --- a/contracts/contracts/token/OUSD.sol +++ b/contracts/contracts/token/OUSD.sol @@ -432,8 +432,13 @@ contract OUSD is Governable { returns (uint256 rebasingCredits, uint256 actualBalance) { uint256 rebasingCreditsPerTokenMem = rebasingCreditsPerToken_; - // Round down in favour of the protocol - rebasingCredits = ((_balance) * rebasingCreditsPerTokenMem) / 1e18; + // Rounds up, because we need to ensure that accounts always have + // at least the balance that they should have. + // Note this should always be used on an absolute account value, + // not on a possibly negative diff, because then the rounding would be wrong. + rebasingCredits = + ((_balance) * rebasingCreditsPerTokenMem + 1e18 - 1) / + 1e18; actualBalance = (rebasingCredits * 1e18) / rebasingCreditsPerTokenMem; }