MetaTx.sol

This library provides functions for handling meta transactions in the Story Protocol.

EIP712_DOMAIN_VERSION

string EIP712_DOMAIN_VERSION

Version of the EIP712 domain.

EIP712_DOMAIN_VERSION_HASH

bytes32 EIP712_DOMAIN_VERSION_HASH

Hash of the EIP712 domain version.

EIP712_DOMAIN

bytes32 EIP712_DOMAIN

EIP712 domain type hash.

EXECUTE

bytes32 EXECUTE

Execute type hash.

Execute

Structure for the Execute type.

struct Execute {
  address to;
  uint256 value;
  bytes data;
  uint256 nonce;
  uint256 deadline;
}

calculateDomainSeparator

function calculateDomainSeparator() internal view returns (bytes32)

Calculates the EIP712 domain separator for the current contract.

Return Values

NameTypeDescription
[0]bytes32The EIP712 domain separator.

calculateDomainSeparator

function calculateDomainSeparator(address ipAccount) internal view returns (bytes32)

Calculates the EIP712 domain separator for a given IP account.

Parameters

NameTypeDescription
ipAccountaddressThe IP account for which to calculate the domain separator.

Return Values

NameTypeDescription
[0]bytes32The EIP712 domain separator.

getExecuteStructHash

function getExecuteStructHash(struct MetaTx.Execute execute) internal pure returns (bytes32)

Calculates the EIP712 struct hash of an Execute.

Parameters

NameTypeDescription
executestruct MetaTx.ExecuteThe Execute to hash.

Return Values

NameTypeDescription
[0]bytes32The EIP712 struct hash of the Execute.