In Treasury.sol, the deposit() and withdraw() functions have internal accounting to record the balance of tokens.
The issue is that it will not work with rebasing tokens. The protocol will likely use its own RToken in the treasury so that it will have some yields (funds in the treasury are stagnant for a long time).
All excess yields will be stuck forever in the Treasury as retrieving them is impossible because of how the internal accounting is done.
When a deposit() is made, _balances[token] += amount is recorded. Let's say 100 RToken (or scrvUSD) is deposited
Time pass, and now the Treasury holds 110 scrvUSD
Because of the internal accounting, it will not be possible to withdraw() more than 100 scrvUSD -> if (_balances[token] < amount) revert InsufficientBalance();
10 scrvUSD will be locked forever in the contract
All yields earned by deposited yield tokens in Treasury will be lost forever. Treasury of RAAC cannot use its own RToken (rebasing token) in treasury.
Manual
Remove the accounting and use balanceOf instead :
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.