From dd2094b86ec467a36c697f6a53020adba6d66a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Mon, 9 Sep 2019 12:24:46 -0300 Subject: [PATCH] Make _msgSender() payable (#1913) (cherry picked from commit 52dc14c368ecb3ddfbd918505a7a40eb90b124cc) --- contracts/GSN/Context.sol | 2 +- contracts/GSN/GSNRecipient.sol | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/GSN/Context.sol b/contracts/GSN/Context.sol index 849b67d74..107729583 100644 --- a/contracts/GSN/Context.sol +++ b/contracts/GSN/Context.sol @@ -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; } diff --git a/contracts/GSN/GSNRecipient.sol b/contracts/GSN/GSNRecipient.sol index 3f11170ad..7b4690229 100644 --- a/contracts/GSN/GSNRecipient.sol +++ b/contracts/GSN/GSNRecipient.sol @@ -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