0

I'm trying to implement the Safe Protocol into a Intents project I'm working on. I crafted a test where I use the Protocol Kit's createMessage and signMessage. When attempting execution of this intent with this signature, I get a signature mismatch GS026, and upon further debugging, the signature does in fact completely misalign with the address I signed with that owns the Safe wallet - https://www.tdly.co/shared/simulation/0a8fa84c-f1ce-4df5-bdb1-3eb794108756

I'm wondering if anyone may have insights into what I'm missing.

Here are the domain, types, and

 types:  {
      MetaDelegateCall: [
        { name: 'to', type: 'address' },
        { name: 'data', type: 'bytes', calldata: true }
      ]
    }
    domain:  {
      name: 'BrinkAccount',
      version: '1',
      chainId: 1,
      verifyingContract: '0xCE0fC6C200d4653f6015b5Fa92379a5DFD095b11'
    }
    message:  {
      to: '0xd313e04a4bd954e33c6daabd7f1b277b8087a948',
      data: '0x4f899fb200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000640000000000000000000000000b83235717a536a57063035a97fcb40a0b0ac0759000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000005e000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000424b20cd77900000000000000000000000053ae4a2e6ebe51afdb21e873786fb59af3036df80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019baae0c65ef0bc41e0fa160babe605f2c1d7052000000000000000000000000935be545c327602aa17f9184deab53be5944076900000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000260000000000000000000000000ea8cb64b49a29db66e84a795dc46ebfa9b10b120000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000003039000000000000000000000000000000000000000000000000000000000128545c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000f4240fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0bdc000000000000000000000000074bc6232d7b5cf8db6dd5cb8264e9cca6beed60500000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000c2e9f25be6257c210d7adf0d4cd6e3e881ba25f800000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
    }

And here is how I'm crafting the signature:

const provider = new JsonRpcProvider(process.env.RPC_URL)    
const safeOwner = new ethers.Wallet(SAFE_WALLET_PRIVATE_KEY, provider)
const ethAdapter = new EthersAdapter({
  ethers,
  signerOrProvider: safeOwner
})
const safe = await new Safe().connect({ safeAddress: SAFE_WALLET_ADDRESS, ethAdapter, isL1SafeSingleton: true, contractNetworks: {} })
const safeMessage = safe.createMessage({types, domain, message})

const signature = await safe.signMessage(
  safeMessage, SigningMethod.ETH_SIGN_TYPED_DATA_V4
)`

1 Answer 1

0

a few reasons might explain why this does not work:

  1. Maybe the safe is not correctly initialized:

Instead of:

const safe = await new Safe().connect(...)
const safeMessage = safe.createMessage({types, domain, message})

try (as per our official doc):

const safe = await Safe.create({ ethAdapter, safeAddress })
const connected = safe.connect(...)
const safeMessage = safe.createMessage({types, domain, message})
  1. Check our guides for signatures in general, and messages in particular as some steps laid out there might have been overlooked.

  2. Make sure typed data is complete; some fields mentioned in our docs don't appear hear, it may impact the way SDK generates signatures under the hood.

Please let me know if it solved the problem! Best, Louis

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.