Declare Your Variables
Let assign real values to our data structure
Now we have defined our data structure, let's define some variables which will help us implement EIP-712 standard.
EIP712_DOMAIN_TYPEHASH
Hash made using types of EIP712Domain struct which will be used to verify the types of incoming data included in the signature.
META_TRANSACTION_TYPEHASH
Hash made using types of MetaTransaction struct which will be used to verify the types of incoming data included in the signature.
DOMAIN_SEPARATOR
Define the domain separator hash with real values as per our DApp. Since our DApp is on kovan network, we set chainId as 42 here.
nonces
This is a map of user address and a nonce(number used only once) value. It helps in preventing the replay attack so that user don't end up producing same signatures even if he sign the same data again.
Last updated