Developer Guide: Delegation and Voting with EIP-712 Signatures

Hey all, I made a developer guide on applying EIP-712 signatures to Compound protocol governance voting and delegation. There are JS and Solidity examples within. Also use of MetaMask.

1 Like

very cool! Thank you very much for that!

I am trying to find an example of EIP-712 v4 and how arrays are being encoded.

What I’ve read from the docs is that it should be concatenation of the encoding of each element (as if each element was in a struct with the same name)

I’ve tried to implement it the way I thought it would work but it doesn’t match with what eth-sig-util produces.

Have you worked with arrays ? if not, any idea who has?

1 Like

Hi @adridadou,

Welcome to the community :wave:.

Were you able to find an example? If not, do you want to post in the #support?
I haven’t worked with EIP712 yet.

I haven’t found an example but I found the solution.

To encode an array, you need to use abi.encodePacked(array)
If the array is of a type that needs hashing first, you first need to convert from array to array of hashes and then use abi.encodePacked(array of hashes)

I’m using it in my code so once it’s all ready I can send a link here.

ERC-712 needs some help on the solidity side for sure :slight_smile:

1 Like