Replies: 1 comment
-
// you need a domain
const domain = {
name: 'My App',
version: '1',
chainId: 1,
verifyingContract: '0x1111111111111111111111111111111111111111'
};
// types
const types = {
ForwardRequest: [
{ name: 'from', type: 'address' },
{ name: 'to', type: 'address' }
{ name: 'value', type: 'uint256' }
{ name: 'gas', type: 'uint256' }
{ name: 'nonce', type: 'uint256' }
{ name: 'data', type: 'bytes' }
]
};
const request = {
from: '0xAddr'
to: '0xAddr',
value: 123,
gas: 123
nonce: 123,
data: '0x1234'
}
wallet._signTypedData(domain, types, request); You may also have a look at this post. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
MinimalForwarder is used to relay transactions, often in the context of providing gas-less transactions. https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/metatx/MinimalForwarder.sol
The key functions, verify, and execute, take two arguments: ForwardRequest calldata req, and bytes calldata signature
Although conceptually I understand what each of these arguments means, it is really hard to figure the exact format /functions I need to use to construct these arguments. Does anyone have a working example of doing this using ether.js?
Beta Was this translation helpful? Give feedback.
All reactions