MetaTransactionsFacet

Git Source

Inherits: ReentrancyGuard

State Variables

META_TRANSACTION_TYPEHASH

bytes32 private constant META_TRANSACTION_TYPEHASH =
    keccak256(bytes("MetaTransaction(uint256 nonce,address from,bytes functionSignature)"));

Functions

convertBytesToBytes4

function convertBytesToBytes4(bytes memory inBytes) internal pure returns (bytes4 outBytes4);

getDomainSeparator

function getDomainSeparator() private view returns (bytes32);

toTypedMessageHash

Accept message hash and returns hash message in EIP712 compatible form So that it can be used to recover signer from signature signed using EIP712 formatted data https://eips.ethereum.org/EIPS/eip-712 "\x19" makes the encoding deterministic "\x01" is the version byte to make it compatible to EIP-191

function toTypedMessageHash(bytes32 messageHash) internal view returns (bytes32);

hashMetaTransaction

function hashMetaTransaction(MetaTransaction memory metaTx) internal pure returns (bytes32);

getNonce

Query the latest nonce of an address

function getNonce(address user) external view returns (uint256 nonce_);

Parameters

NameTypeDescription
useraddressAddress to query

Returns

NameTypeDescription
nonce_uint256The latest nonce for the address

verify

function verify(address user, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV)
    internal
    view
    returns (bool);

executeMetaTransaction

function executeMetaTransaction(
    address userAddress,
    bytes memory functionSignature,
    bytes32 sigR,
    bytes32 sigS,
    uint8 sigV
) public payable returns (bytes memory);

Events

MetaTransactionExecuted

event MetaTransactionExecuted(address userAddress, address payable relayerAddress, bytes functionSignature);

Structs

MetaTransaction

struct MetaTransaction {
    uint256 nonce;
    address from;
    bytes functionSignature;
}