Assessment reports>Metavest>Threat Model>withdrawFromController

Function: withdrawFromController(address _tokenContract)

This function is used to withdraw the tokens from the controller.

Inputs

  • _tokenContract

    • Control: Arbitrary.

    • Constraints: Should be a valid token contract address.

    • Impact: Address of the token contract.

Branches and code coverage

Intended branches

  • Transfer the token balance of the controller to the authority.

Negative behavior

  • Revert if the caller is not the authority.

  • Revert if the token balance of the controller is zero.

Function call analysis

  • IERC20M(_tokenContract).balanceOf(address(this))

    • What is controllable? _tokenContract.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? N/A.

  • this.safeTransfer(_tokenContract, this.authority, _balance)

    • What is controllable? _tokenContract and authority.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? N/A.

Zellic © 2024Back to top ↑