0

Background

Based on this guide, https://docs.safe.global/sdk/relay-kit/guides/4337-safe-sdk#create-a-user-operation, there is a part where it says

By default, the transaction fees will be paid in the native token and extracted from the Safe account, so there must be enough funds in the Safe address.

What I want is to have the Safe pay for the gas fees in a transaction. I am interacting with the Safe4337Pack since we want to sponsor the deployments of the Safes for our users.

Case

In a scenario where the Safes are always with a threshold larger than 1, the first signer would do:

const safeTransaction = await safe4337.createTransaction({ transactions: [safeTransactionData] })
const signedTransaction = await safe4337.signSafeOperation(safeTransaction)

And then - rightfully - I can't use this function safe4337.**executeTransaction**({ executable: signedTransaction}) since it, correctly, returns an error because the signedTransaction has only one signature.

However, what I need is to be able to first propose that transaction to the Safe Service and then have the other signer add a confirmation to that safe_operation_hash. The this is that I can't send that operation to the Safe Service because the next signature will come at a later point.

I am trying to follow the recommendation on Safe of doing PCE (Propose, Confirm, Execute) but the issue here is that I can't propose a transaction with the Safe4337Pack is the threshold is larger than 1.

Bear in mind that I am using the Safe4337Pack to have the Safe pay for the gas fees... otherwise, I would have just used the protocolKit and then propose the transaction using the apiKit.

Any ideas on how to solve this?

1 Answer 1

0

In this case, when the threshold > 1, Safe Services adopt a similar approach to transactions. You can "store" the safe operations and collect the signatures before sending the final user operation to the bundler.

You can use a more user-friendly kit for this. Here is the guide in the safe docs an you can follow the complete flow in the repo implementation here

1
  • Hey S_C, if this answer helps you, could you kindly mark the question as answered? Commented Nov 1 at 10:10

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.