When signing a message with a SafeAppProvider (using Web3Provider from @ethersproject/providers) it used to just return 0x
and we would call some methods on the safe contract to validate the signature. Now when I go to sign the message I get some errors in the console and consequently can't validate the signature. Instead of just returning 0x
it now returns a full hash which I'm assuming is a mistake related to the errors in the console. What has changed? Why does signing the message not work anymore? Even if I decode the returned hash from signMessage, it won't validate because the signing address is not the same as the expected one
Code 613: Error fetching Safe message by message hash (404: An error occurred)
Status 404: https://safe-client.safe.global/v1/chains/1/messages/0x506c...
I would like to keep the current method of signing and validating to avoid having to install the protocol kit. But I tried using the lib anyway:
const protocolKit = await Safe.init({ provider, safeAddress })
const messageHash = await protocolKit.createMessage(message)
const sign = await protocolKit.signMessage(messageHash) // this is where it fails
Error: Messages can only be signed by Safe owners
The provider is the same as above. Somehow I can't figure out how to init the Safe
without a private key. I just deployed a new safe on mainnet to test. Any suggestions how to sign using the current method or how to fix my implementation of the protocol kit?
Edit: I think the problem is that the address my provider has connected to is the safe contract where it should be connected to one of the owner accounts
Edit 2: I'd like to use protocol kit to have the safe sign the message using EIP-1271 (not EIP-712 as seems to be the default). How can I do that? From what I understand that's why we were using the magic value in the first place