0

I got the refundReceiver working (had been passing the separate transactions into the encodeMulti function instead of the array of transactions into createTransaction) but I get an "out of gas" revert inside the multisend contract no matter what combination of params I seem to use inside createTransaction and executeTransaction are. I guess I am still confused about which params to use inside createTransaction and executeTransaction functions. At this point the transactions I want to execute aren't happening. I would like to get that working and also reimburse the signer the exact amount of the gas fee for the transaction they are executing.

There is a delegate call to the multisend contract that seems to have a gas limit set at 0 no matter what I have tried:

https://rinkeby.etherscan.io/tx/0x72a6491ff9dc8294d14620c41e4baa25b5b3d0e5c0929b3ce7cbe1008dfe50e0#internal

  const txOptions = {
    gasPrice: getGasPrice,
    gasToken: "0x0000000000000000000000000000000000000000",
    refundReceiver: signer.address,
    safeTxGas: 1000000,
    baseGas: 1000000,
    gasLimit: 10000000,
  };
  const safeTransaction = await safeSdk.createTransaction(
    multiSendTx,
    txOptions
  );

  const execOptions = {
    gasLimit: 10000000,
  };

  const executeTxResponse = await safeSdk.executeTransaction(
    safeTransaction,
    execOptions
  );

Thanks!

2 Answers 2

0

In the transaction you linked, the safeTxGas param is 0, and so it passes 0 gas to the underlying transaction. Therefore, you need to specify the correct amount of gas for the underlying transaction via the safeTxGas param when using a gas refund.

For the particular snippet, you need to move safeTxGas to the options object because when you pass an array of transactions for multisend it expects it to be in the second options parameter.

Check docs for multisend transactions section:
https://github.com/gnosis/safe-core-sdk/tree/63df6c6c770f387f8e4939c4c75112ceb490b3b8/packages/safe-core-sdk

5
  • But safeTxGas is specified, why is it not taken?
    – Richard
    Jan 1, 2022 at 23:39
  • good catch, updated the answer
    – mikheevm
    Jan 1, 2022 at 23:51
  • According to github.com/gnosis/safe-core-sdk/tree/… it is already in the correct place (assuming multiSendTx is an array of txs)
    – Richard
    Jan 2, 2022 at 0:02
  • If you look at etherscan you can also see that the other params are correctly applied, just safeTxGas is 0
    – Richard
    Jan 2, 2022 at 0:03
  • Ah sorry, I misread the code, then no idea. It should be taken into account. It'd help if we could check the full snippet and try to reproduce it.
    – mikheevm
    Jan 2, 2022 at 18:32
0

Have had the same issue. Looks like there's an issue with the safe-core-sdk on github which is likely causing SafeTxGas to be 0 regardless of what it is in options.

https://github.com/gnosis/safe-core-sdk/issues/139

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.