Assessment reports>Staking>Threat Model>_transfer

Function: _transfer(address _sender, address _recipient, uint256 _amount)

This is the internal function for transferring tokens.

Inputs

  • _sender

    • Control: Controlled by calling function.

    • Constraints: Checked that _sender is not the zero address and that it has enough balance.

    • Impact: The account that will send the tokens.

  • _recipient

    • Control: Controlled by calling function.

    • Constraints: Checked that _recipient is not the zero address.

    • Impact: The account that will receive the tokens.

  • _amount

    • Control: Controlled by calling function.

    • Constraints: Checked that _sender has enough balance.

    • Impact: The amount of tokens to be transferred.

Branches and code coverage (including function calls)

Intended branches

  • Checks that the _sender has enough balance.

  • Checks that the _sender is not the zero address.

  • Checks that the _recipient is not the zero address.

  • Checks that the _amount is greater than zero.

  • Decreases the balances for the _sender.

  • Increases the balances for the _recipient.

  • Checks that inPrivateTransferMode is true and calls _validateHandler.

Negative behavior

  • Should not allow transferring more tokens than the _sender has.

  • Should not allow transferring to the zero address.

Zellic © 2024Back to top ↑