Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrowDom committed Nov 26, 2024
1 parent 57cccba commit 24bf72a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions contracts/contracts/token/OUSD.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,13 @@ contract OUSD is Governable {
returns (uint256, uint256)
{
uint256 cpt = _creditsPerToken(_account);
if (cpt == 1e27) {
// For a period before the resolution upgrade, we created all new
// contract accounts at high resolution. Since they are not changing
// as a result of this upgrade, we will return their true values
return (creditBalances[_account], cpt);
} else if (cpt == 1e18) {
// This is the current implementation's non rebasing account where cpt
// equals 1e18 and creditBalaces of the account equal the token balances
if (cpt == 1e27 || cpt == 1e18) {
// There are 2 reasons why we return the non downscaled amounts:
// - 1e27 For a period before the resolution upgrade, we created all new
// contract accounts at high resolution. Since they are not changing
// as a result of this upgrade, we will return their true values
// - 1e18 This is the current implementation's non rebasing account where cpt
// equals 1e18 and creditBalaces of the account equal the token balances
return (creditBalances[_account], cpt);
} else {
return (
Expand Down

0 comments on commit 24bf72a

Please sign in to comment.