Skip to content

Commit a392306

Browse files
committed
Bring over MTX constant from abandoned PR
1 parent a21d379 commit a392306

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

contracts/common/MetaTransactionMsgSender.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ import { DSMath } from "../../lib/dappsys/math.sol";
55

66
abstract contract MetaTransactionMsgSender is DSMath {
77
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
811

912
function msgSender() internal view returns (address payable sender) {
1013
uint256 index = msg.data.length;
11-
if (msg.sender == address(this) && index >= 52) {
14+
if (msg.sender == address(this) && index >= METATRANSACTION_DATA_MIN_LENGTH) {
1215
bytes memory array = msg.data;
1316
bytes32 flag;
1417
assembly {

0 commit comments

Comments
 (0)