mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12500 from safwen1/patch-1
Explaining payable(msg.sender)
This commit is contained in:
commit
3731c0f4ac
@ -121,6 +121,9 @@ to receive their money - contracts cannot activate themselves.
|
||||
// before `send` returns.
|
||||
pendingReturns[msg.sender] = 0;
|
||||
|
||||
// msg.sender is not of type `address payable` and must be
|
||||
// explicitly converted using `payable(msg.sender)` in order
|
||||
// use the member function `send()`.
|
||||
if (!payable(msg.sender).send(amount)) {
|
||||
// No need to call throw here, just reset the amount owing
|
||||
pendingReturns[msg.sender] = amount;
|
||||
|
Loading…
Reference in New Issue
Block a user