safe-apps-sdk: Signing a message with EIP-712 throw an error "The address is invalid"

We are currently testing to sign an EIP-712 message with a Safe, we are using the latest version of the SDKs (see: https://github.com/snapshot-labs/lock/blob/master/package.json#L11-L12) with the dev instance here https://safe-team.dev.gnosisdev.com/app but somehow when we try to trigger a new 712 message to sign we got this error:

Result Error: The address is invalid.

We made a test deployment here: https://bafybeidecgkelmzrlrjl2et6jrwhn4c2vs5hsjluklphxdo2kueej43ony.on.fleek.co/#/fabien.eth/proposal/0xbe992f0a433d2dbe2e0cee579e5e1bdb625cdcb3a14357ea990c6cdc3e129991 If you login with a Safe and try to cast a vote and that proposal you should get the same error.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 23 (12 by maintainers)

Most upvoted comments

We have incorrect order of eth_signTypedData parameters: https://github.com/safe-global/safe-apps-sdk/blob/development/packages/safe-apps-provider/src/provider.ts#L69 We have them as [message, address], but according to https://eips.ethereum.org/EIPS/eip-712#specification-of-the-eth_signtypeddata-json-rpc it should be [address, message]. We’ll fix it soon

@samuveth @firatkaratas I confirmed with Richard that there’s a bug on our side in terms of JSON-RPC payload handling, we’ll fix it next week

this is fixed in the latest releases

@mikhailxyz I’m still getting the same error and I don’t see any changes in the package version of @gnosis.pm/safe-apps-sdk. How do I install the latest changes?

update: It works now after updating to @gnosis.pm/safe-apps-provider@0.14.0

@samuveth I found the problem, the problem is that your message is encoded as a string instead of JSON as in specs: https://eips.ethereum.org/EIPS/eip-712#specification-of-the-eth_signtypeddata-json-rpc

It seems a lot of projects are doing that so we’ll add support for that soon 🤷