Assessment reports>Staking>Threat Model>approve

Function: approve(address _spender, uint256 _amount)

Allows approving allowances for transferring tokens.

Inputs

  • _spender

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The account that will be allowed to transfer tokens.

  • _amount

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The amount of tokens to be allowed to be transferred.

Branches and code coverage (including function calls)

Intended branches

  • Sets the allowance of _spender to _amount for the msg.sender.

  • Check that _spender and _owner are not the zero address (in _approve).

Negative behavior

  • Should not allow approving tokens on behalf of others.

Zellic © 2024Back to top ↑