The method _msgSender()
returns the msg.sender.
With that clarification let’s check the transfer functions.
Consider the transfer()
function:
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
...
}
Consider the _transfer()
function:
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
The first parameter is the sender (_msg.sender());
The 2nd parameter is the recipient;
The 3rd parameter is the amount;
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
...
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
Should make sense now
Happy learning,
Dani