Assessment reports>Nukem Loans>Threat Model>transferFrom

Function: transferFrom(address from, address to, uint256 amount)

This allows users to transfer tokens from one address to another, provided that the sender has been approved to spend tokens on behalf of the owner.

Inputs

  • from

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The address to transfer tokens from.

  • to

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The address to transfer tokens to.

  • amount

    • Control: Fully controlled by the caller.

    • Constraints: None.

    • Impact: The amount of tokens to transfer.

Branches and code coverage (including function calls)

Intended branches

  • Assumed from posesses enough tokens to transfer.

  • Assumed from has approved msg.sender to spend tokens on their behalf.

  • Decrease balance of from by amount.

  • Increase balance of to by amount.

Negative behavior

  • Should not be callable if from does not posess enough tokens to transfer.

  • Should not be callable if from has not approved msg.sender to spend tokens on their behalf.

Zellic © 2024Back to top ↑