瀏覽代碼

Make _msgSender() payable (#1913)

Nicolás Venturo 6 年之前
父節點
當前提交
52dc14c368
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      contracts/GSN/Context.sol
  2. 2 2
      contracts/GSN/GSNRecipient.sol

+ 1 - 1
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;
     }
 

+ 2 - 2
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