We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a21d379 commit a392306Copy full SHA for a392306
1 file changed
contracts/common/MetaTransactionMsgSender.sol
@@ -5,10 +5,13 @@ import { DSMath } from "../../lib/dappsys/math.sol";
5
6
abstract contract MetaTransactionMsgSender is DSMath {
7
bytes32 constant METATRANSACTION_FLAG = keccak256("METATRANSACTION");
8
+ uint256 constant METATRANSACTION_DATA_MIN_LENGTH = 32 + 20;
9
+ // Where 32 is the length of METATRANSACTION_FLAG in bytes
10
+ // Where 20 is the length of an address in bytes
11
12
function msgSender() internal view returns (address payable sender) {
13
uint256 index = msg.data.length;
- if (msg.sender == address(this) && index >= 52) {
14
+ if (msg.sender == address(this) && index >= METATRANSACTION_DATA_MIN_LENGTH) {
15
bytes memory array = msg.data;
16
bytes32 flag;
17
assembly {
0 commit comments