Skip to content

Commit b8d7a9b

Browse files
committed
More comments updates
1 parent 3ee5461 commit b8d7a9b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

contracts/contracts/token/OUSD.sol

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,10 @@ contract OUSD is Initializable, InitializableERC20Detailed, Governable {
501501
nonRebasingCreditsPerToken[_account] = _rebasingCreditsPerToken;
502502

503503
// Update global totals
504+
// We use the current value of balanceOf, after the update, so
505+
// that if any rounding errors happened in the conversion, we
506+
// will be updating the nonRebasingSupply properly with
507+
// the account balance
504508
nonRebasingSupply = nonRebasingSupply.add(balanceOf(_account));
505509
_rebasingCredits = _rebasingCredits.sub(oldCredits);
506510
}
@@ -541,7 +545,9 @@ contract OUSD is Initializable, InitializableERC20Detailed, Governable {
541545
rebaseState[msg.sender] = RebaseOptions.OptIn;
542546

543547
// Update global totals:
544-
// Decrease non rebasing supply
548+
// Decrease non rebasing supply. We use the old balance, since that
549+
// would have been the value that was originally used to adjust the
550+
// nonRebasingSupply.
545551
nonRebasingSupply = nonRebasingSupply.sub(oldBalance);
546552
// Increase rebasing credits, totalSupply remains unchanged so no
547553
// adjustment necessary

0 commit comments

Comments
 (0)