safe-apps-sdk icon indicating copy to clipboard operation
safe-apps-sdk copied to clipboard

Support `gs_multi_send` in the `safe-apps-provider`

Open mmv08 opened this issue 3 years ago • 5 comments

We are migrating the wallet-connect safe app to the safe-apps-provider: https://github.com/safe-global/safe-react-apps/pull/537

The only thing the safe-apps-provider lacks is the support for the OG gs_multi_send method for batching transactions. Supporting this method has some complexity because under the hood, the safe-apps-provider stores a fake transaction that includes the recipient address, data, etc. Since the transactions passed to the gs_multi_send method will be encoded and sent to the multisend contract, we need somehow to get the encoded data and the address of the multisend contract.

I see two options to achieve this:

  1. Replicate the encoding/address retrieval logic from our interfaces in the safe-apps-provider
  2. Change the txs.send return type to return the whole safe transaction object

I lean towards 2)

mmv08 avatar Sep 30 '22 11:09 mmv08

Is this the MultiSend contract that you referred to here, @mmv08?

PaulRBerg avatar Mar 24 '25 12:03 PaulRBerg

Is this the MultiSend contract that you referred to here, @mmv08?

Yes and no. When I created the issue, we likely would've used that contract. Today, the contract of choice would be the MultiSendCallOnly contract because it doesn't allow nested delegate calls and is easier to reason about regarding the security of the transaction. The addresses it is deployed to can be found here and the source code is available here

I don't think this issue is relevant given that we support ERC-5792 nowadays

mmv08 avatar Mar 24 '25 12:03 mmv08

Thanks for the quick answer @mmv08!

Related issue: https://github.com/safe-global/safe-core-sdk/issues/1182

PaulRBerg avatar Mar 24 '25 12:03 PaulRBerg

Thanks for the quick answer @mmv08!

Related issue: https://github.com/safe-global/safe-deployments/blob/d72ccc6c4cf11b2085153ca1a4a24dff738ba3ad/src/assets/v1.4.1/multi_send_call_only.json

is the link correct?

mmv08 avatar Mar 24 '25 12:03 mmv08

Haha no, it wasn't.

PaulRBerg avatar Mar 24 '25 12:03 PaulRBerg