eip-712
eip-712 copied to clipboard
Failed with recursive data
For example
{
CIP23Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' }
],
Person: [
{ name: 'name', type: 'string' },
{ name: 'mother', type: 'Person' },
{ name: 'father', type: 'Person' }
]
}
Could you provide an example of the message, and what the expected result would be?
For example:
{
"types": {
"EIP712Domain": [
{ "name": "name", "type": "string" },
{ "name": "version", "type": "string" },
{ "name": "chainId", "type": "uint256" },
{ "name": "verifyingContract", "type": "address" }
],
"Person": [
{ "name": "name", "type": "string" },
{ "name": "wallet", "type": "address" }
],
"Mail": [
{ "name": "from", "type": "Person" },
{ "name": "to", "type": "Person" },
{ "name": "contents", "type": "string" },
{ "name": "replyTo", "type": "Mail" }
]
},
"primaryType": "Mail",
"domain": {
"name": "Ether Mail",
"version": "1",
"chainId": 1,
"verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"
},
"message": {
"from": {
"name": "Cow",
"wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"
},
"to": {
"name": "Bob",
"wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"
},
"contents": "Hello, Bob!"
}
}
The result is : 1901f2cee375fa42b42143804025fc449deafd50cc031ca257e0b194a650a912090fe51b671bc20a4046c6cfd629f9361edc9ea3c6ee0b20b767bcff06e1e8973930
eth_typedDataV4 support recursive data, when encode the omit value it will use a 0x0000000000000000000000000000000000000000000000000000000000000000
Thank you, will look into this.
Is there any documentation or a reference implementation for recursive types? I looked into this a little bit and I don't quite understand how it's supposed to work currently.
Running into similar issues. Opened #35 as mine is related to encodeType
.