The Treasury
contract allows users to deposit any ERC20 token, including the RAACToken
. However, the RAACToken
contract imposes a swap tax and burn tax during token transfers, which reduces the actual amount received by the Treasury
contract. This discrepancy between the recorded balance (_balances[token]
) and the actual token balance can lead to insufficient funds when attempting to withdraw tokens. This vulnerability arises because the deposit
function does not account for the tax mechanism of RAACToken
, resulting in an overestimation of the treasury's token balance.
The deposit
function in the Treasury
contract assumes that the full amount
of tokens specified by the user will be transferred to the treasury.
However, when depositing RAACToken
, the _update
function in the RAACToken
contract applies a swap tax and burn tax, reducing the actual amount received by the treasury.
This creates a mismatch between the recorded balance (_balances[token]
) and the actual token balance. When a manager attempts to withdraw tokens using the withdraw
function, the contract may fail due to insufficient funds, even if the recorded balance (_balances[token]
) suggests otherwise.
Incorrect Balance Tracking: The _balances[token]
variable in the Treasury
contract overestimates the actual token balance.
Withdrawal Failure: When a manager attempts to withdraw tokens using the withdraw
function, the contract may fail due to insufficient funds, even if the recorded balance (_balances[token]
) suggests otherwise.
Protocol Instability: This issue can lead to unexpected behavior in the protocol, such as failed transactions or incorrect accounting, undermining user trust.
The impact is Medium, the likelihood is Medium, so the severity is Medium.
Manual Review
Consider following fix:
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.