Describe Your Structs
Prepare the data structure for signatures
Last updated
Was this helpful?
Prepare the data structure for signatures
Last updated
Was this helpful?
We need some data structure to store the information that will be signed by the user.
Below we can see two structs EIP712Domain and MetaTransaction.
It will store the data related to transaction.
nonce : It is a unique value chosen by an entity in a protocol which is used to protect the entity against
from : Public key of the user signing the message.
It will store information related to domain to make the the data values unique across DApps and Blockchains.
name: the dApp name, e.g. βQuoteβ
version: The current version number of your dApp or platform. It prevents signatures from one dApp version from working with those of others.
chainId: Network Id e.g. Kovan Testnet = 42; Main Network = 1
verifyingContract: The contract address that will verify the resulting signature.