From 2c96306d329b0587cc0a3b77873c09fe74a762ee Mon Sep 17 00:00:00 2001 From: Domen Grabec Date: Wed, 13 Nov 2024 14:29:48 +0100 Subject: [PATCH] add more defensive checks where isNonRebasingAccount can not mistankingly be used to return true for yield delegation sources --- contracts/contracts/token/OUSD.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/contracts/token/OUSD.sol b/contracts/contracts/token/OUSD.sol index 78bd8ca0aa..d87e01391c 100644 --- a/contracts/contracts/token/OUSD.sol +++ b/contracts/contracts/token/OUSD.sol @@ -513,7 +513,10 @@ contract OUSD is Governable { ) { _rebaseOptOut(_account); } - return alternativeCreditsPerToken[_account] > 0; + + return rebaseState[_account] != RebaseOptions.YieldDelegationSource && + rebaseState[_account] != RebaseOptions.YieldDelegationTarget && + alternativeCreditsPerToken[_account] > 0; } function _balanceToRebasingCredits(uint256 balance)