Function: clobDeposit(address token, uint256 amount, bool fromRouter)
This function allows depositing the specified amount of token to the CLOBManager contract.
Inputs
tokenControl: Full control.
Constraints: CLOBManager allows depositing arbitrary tokens.
Impact: The address of the token will be deposited to the CLOBManager contract.
amountControl: Full control.
Constraints: The caller should own enough tokens to transfer them to the CLOBManager contract.
Impact: The amount of token to be transferred to the CLOBManager contract.
fromRouterControl: Full control.
Constraints: N/A.
Impact: If
fromRouteristrue, then the tokens are transferred to this contract, and approval is granted to theCLOBManagercontract to use these tokens. Otherwise, tokens will be transferred from the caller account.
Branches and code coverage
Intended branches
Tokens are successfully deposited when
fromRouteris true.Tokens are successfully deposited when
fromRouteris false.
Negative behavior
The amount exceeds the caller’s balance of the
token.
Function call analysis
SafeTransferLib.safeTransferFrom(token, msg.sender, address(this), amount)What is controllable?
tokenandamount.If the return value is controllable, how is it used and how can it go wrong? There is no return value here.
What happens if it reverts, reenters or does other unusual control flow? There are no problems here.
SafeTransferLib.safeApprove(token, address(this.clobFactory), amount)What is controllable?
tokenandamount.If the return value is controllable, how is it used and how can it go wrong? There is no return value here.
What happens if it reverts, reenters or does other unusual control flow? There are no problems here.
this.clobFactory.deposit(msg.sender, token, amount, fromRouter)What is controllable?
token,amount, andfromRouter.If the return value is controllable, how is it used and how can it go wrong? There is no return value here.
What happens if it reverts, reenters or does other unusual control flow? There are no problems here.