Merge pull request #12500 from safwen1/patch-1

Explaining payable(msg.sender)
This commit is contained in:
Harikrishnan Mulackal 2022-01-10 13:28:56 +05:30 committed by GitHub
commit 3731c0f4ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;