diff --git a/contracts/contracts/token/OUSD.sol b/contracts/contracts/token/OUSD.sol index 9a7fa725f2..5262ebb59c 100644 --- a/contracts/contracts/token/OUSD.sol +++ b/contracts/contracts/token/OUSD.sol @@ -642,8 +642,10 @@ contract OUSD is Initializable, InitializableERC20Detailed, Governable { public onlyGovernor { - if (rebaseState[_accountSource] != RebaseOptions.OptIn) { + if (rebaseState[_accountSource] == RebaseOptions.OptOut) { _rebaseOptIn(_accountSource); + } else if (rebaseState[_accountSource] == RebaseOptions.NotSet) { + rebaseState[_accountSource] == RebaseOptions.OptIn; } _resetYieldDelegation(_accountSource, _accountReceiver); @@ -712,6 +714,7 @@ contract OUSD is Initializable, InitializableERC20Detailed, Governable { uint256 _delegationStartCreditsPerToken ) internal { // TODO: possible to support non rebasing as well + // TODO probably delete this part require(rebaseState[_accountReceiver] == RebaseOptions.OptIn || rebaseState[_accountReceiver] == RebaseOptions.NotSet, "Account Receiver needs to support rebasing"); diff --git a/contracts/test/token/ousd.js b/contracts/test/token/ousd.js index 13f84a5f8c..7b4b70b27f 100644 --- a/contracts/test/token/ousd.js +++ b/contracts/test/token/ousd.js @@ -861,7 +861,7 @@ describe("Token", function () { await expect(matt).has.an.approxBalanceOf("80.00", ousd); await expect(anna).has.an.approxBalanceOf("10", ousd); - ousd + await ousd .connect(governor) // matt delegates yield to anna .governanceDelegateYield(matt.address, anna.address); @@ -889,7 +889,7 @@ describe("Token", function () { await expect(matt).has.an.approxBalanceOf("100.00", ousd); await expect(anna).has.an.balanceOf("0", ousd); - ousd + await ousd .connect(governor) // matt delegates yield to anna .governanceDelegateYield(matt.address, anna.address);