@@ -475,23 +475,22 @@ contract OUSD is Initializable, InitializableERC20Detailed, Governable {
475475 // high resolution, and do not have to do any other bookkeeping
476476 nonRebasingCreditsPerToken[_account] = 1e27 ;
477477 } else {
478- // Get old values, so we can use them unaffected by changes
479- uint256 oldBalance = balanceOf (_account);
478+ // This does not change, but if it did, we want want to
479+ // use the before changes value.
480480 uint256 oldCredits = _creditBalances[_account];
481481
482482 // Atomicly update account information:
483483 // It is important that balanceOf not be called inside updating
484484 // account data, since it will give wrong answers if it does
485485 // not have all an account's data in a consistent state.
486- nonRebasingCreditsPerToken[_account] = 1e27 ;
487- // difference between the 1e18 balance and the new 1e27 resolution
488- _creditBalances[_account] = oldBalance * 1e9 ;
489-
490- // Verify perfect acccount accounting update
491- require (oldBalance == balanceOf (_account), "Balances do not match " );
486+ //
487+ // By setting a per account nonRebasingCreditsPerToken,
488+ // this account will no longer follow with the global
489+ // rebasing credits per token.
490+ nonRebasingCreditsPerToken[_account] = _rebasingCreditsPerToken;
492491
493492 // Update global totals:
494- nonRebasingSupply = nonRebasingSupply.add (oldBalance );
493+ nonRebasingSupply = nonRebasingSupply.add (balanceOf (_account) );
495494 _rebasingCredits = _rebasingCredits.sub (oldCredits);
496495 }
497496 }
0 commit comments