cairo-contracts
cairo-contracts copied to clipboard
EIP-712 / SNIP-12
🧐 Motivation
EIP-712 is implemented in a draft in the solidity contracts. It seems like a good idea to implement in cairo as well considering that Argent-X seems to be using it it.
📝 Details
I'm not entirely sure about Cairo's capabilities for this. The standard library does support keccak. Everything would be a felt as well. Any guidance on how one would approach this is highly appreciated.
The repository developed by @0xChqrles offers a good start for initiating this PR. It enables computing typed data hash, checking their signature, and consuming them.
@martriay What changes do you think are needed to integrate this feature into OZ? I believe it's an important feature because all wallets rely on an EIP-712 signature method implemented by starknetjs, and it's important to have the capability to recompute this hash on-chain.
Thank you for mentioning my repo ! It only supports SNIP-12 revision 0 but I would be glad to help supporting revision 1 too !