The Treasury::deposit
function directly stores the passed amount in the _balances
and _totalValue
, which would lead to incorrect accounting in case of Fee on transfer (FOT) / Tax tokens as the actual amount received by the contract would be low. In addition to this, the event emitted will be incorrect as well as the amount being passed on here is of the parameter itself and not the actual amount received.
The Treasury::deposit
function is designed to allow users to deposit any token of their choice, these tokens are tracked via _balances
individually and via _totalValue
collectively.
However, depositing a legit FOT / Tax token would store incorrect amount, as the actual amount received might be lower than the passed amount
parameter.
This would show false values to the withdrawer (manager) and the withdraw function might revert as well. It also would emit an incorrect event as the actual amount received by the contract would be different.
Incorrect accounting of _balances
and _totalValue
Withdraw function will revert even though the _balances
values are matched with the withdrawing amount parameter.
Incorrect event emission would take place in deposit function as the actual value received will be quite different.
Manual Review
/
Hardhat
It is recommended to handle FOT and tax tokens by checking balance before and after:
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.