Function: transferFrom(address _sender, address _recipient, uint256 _amount)
Allows transferring tokens from an account to another.
Inputs
_senderControl: Fully controlled by the caller.
Constraints: None --- only checked that
msg.senderhas enough allowance for the particular_sender.Impact: The account that will send the tokens.
_recipientControl: Fully controlled by the caller.
Constraints: None.
Impact: The account that will receive the tokens.
_amountControl: Fully controlled by the caller.
Constraints: Ensured that
msg.senderhas enough allowance for the particular_sender.Impact: The amount of tokens to be transferred.
Branches and code coverage (including function calls)
Intended branches
Assumes no malicious intent on behalf of the handler.
If
msg.senderis the handler, do not check allowance.Checks that the
_senderhas enough balance. Ensured in_transfer.Checks that the
_recipientis not the zero address. Ensured in_transfer.Checks that the
_amountis greater than zero. Ensured in_transfer.Decreases the
balancesfor the_sender. Ensured in_transfer.Increases the
balancesfor the_recipient. Ensured in_transfer.Decreases the allowance of
_senderformsg.senderby_amount. Ensured in_approve.Ensures enough allowance for
msg.senderhas been granted by_sender.
Negative behavior
Should not allow tranferring more tokens than the
_senderhas, even if the allowance is greater than the balance.Should not allow transferring more tokens than the allowance granted by the
_sender.