Function: depositToken()
The function handles the deposit of tokens to the RabbitX exchange. This is a call to the handleDeposit function. Internally, the token passed as a parameter is checked to be supported.
The deposit function calls the same handleDeposit function with the defaultToken address passed as a parameter. The same threat model applies to it.
Inputs
amountControl: Completely controlled by the caller.
Impact: The amount to deposit. The value must not be smaller than the minimum deposit, and the transfer must be successful. The final contract balance must be correct after the transfer.
tokenControl: Completely controlled by the caller.
Impact: The token to deposit. The token address is checked to be supported.
Branches and code coverage (including function calls)
Intended branches
Transfer some
defaultTokenfrom the sender to the contract.The contract balance is correctly updated when the transfer succeeds.
Negative behavior
Revert when the amount is smaller than the minimum deposit.
Revert when the transfer fails.
Revert when the token is not supported.
Function call analysis
depositToken -> handleDeposit(uint256 amount, address token)External/Internal? Internal.
Argument control? Both arguments are controlled.
Impact: Handle underlying checks on arguments and perform the transfer. Ensure the balance is updated correctly.