File tree 2 files changed +37
-0
lines changed
2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,17 @@ abstract contract _Context is _IContext {
10
10
function _msgSender () internal view virtual returns (address msgSender ) {
11
11
msgSender = msg .sender ;
12
12
}
13
+
14
+ function _msgData () internal view virtual returns (bytes calldata msgData ) {
15
+ msgData = msg .data ;
16
+ }
17
+
18
+ function _calldataSuffixLength ()
19
+ internal
20
+ view
21
+ virtual
22
+ returns (uint256 length )
23
+ {
24
+ length = 0 ;
25
+ }
13
26
}
Original file line number Diff line number Diff line change @@ -46,4 +46,28 @@ abstract contract _MetaTransactionContext is _Context {
46
46
msgSender = msg .sender ;
47
47
}
48
48
}
49
+
50
+ function _msgData ()
51
+ internal
52
+ view
53
+ virtual
54
+ override
55
+ returns (bytes calldata msgData )
56
+ {
57
+ if (msg .sender == address (this )) {
58
+ msgData = msg .data [:msg .data .length - _calldataSuffixLength ()];
59
+ } else {
60
+ msgData = msg .data ;
61
+ }
62
+ }
63
+
64
+ function _calldataSuffixLength ()
65
+ internal
66
+ view
67
+ virtual
68
+ override
69
+ returns (uint256 length )
70
+ {
71
+ length = 20 ;
72
+ }
49
73
}
You can’t perform that action at this time.
0 commit comments