When a user deposits USDT as margin collateral into their account the contract doesn't account for the fact that USDT has a fee on transfer and the amount received will not be equal to the amount sent which will lead to the system suffering continuous losses.
When calling TradingAccountBranch::depositMargin
with USDT as collateral type the user specifies the amount of tokens they want to deposit and as a result that is the same amount with which their balance in the system is increased but in the case of USDT when safeTransferFrom
is used the contract will receive less tokens than amount as the token takes a fee from every transfer it is used in meaning that the actual balance will be less than the recorded balance in a user's account.
The contract will be essentially paying for every fee of the USDT token on deposit and suffer continuous losses.
Manual review
VS Code
Handle the fee on transfer by checking the balanceOf(address(this))
before and after the transfer to determine the exact amount of tokens received.
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.