Make _msgSender() payable (#1913)

(cherry picked from commit 52dc14c368)
This commit is contained in:
Nicolás Venturo
2019-09-09 12:24:46 -03:00
committed by Francisco Giordano
parent c247a21cb5
commit dd2094b86e
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address) {
function _msgSender() internal view returns (address payable) {
return msg.sender;
}

View File

@ -75,7 +75,7 @@ contract GSNRecipient is IRelayRecipient, Context, GSNBouncerBase {
*
* IMPORTANT: Contracts derived from {GSNRecipient} should never use `msg.sender`, and use {_msgSender} instead.
*/
function _msgSender() internal view returns (address) {
function _msgSender() internal view returns (address payable) {
if (msg.sender != _relayHub) {
return msg.sender;
} else {
@ -97,7 +97,7 @@ contract GSNRecipient is IRelayRecipient, Context, GSNBouncerBase {
}
}
function _getRelayedCallSender() private pure returns (address result) {
function _getRelayedCallSender() private pure returns (address payable result) {
// We need to read 20 bytes (an address) located at array index msg.data.length - 20. In memory, the array
// is prefixed with a 32-byte length value, so we first add 32 to get the memory read index. However, doing
// so would leave the address in the upper 20 bytes of the 32-byte word, which is inconvenient and would