Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executeTransaction "missing revert data" #891

Open
ulrickpsp opened this issue Jul 1, 2024 · 0 comments
Open

executeTransaction "missing revert data" #891

ulrickpsp opened this issue Jul 1, 2024 · 0 comments

Comments

@ulrickpsp
Copy link

ulrickpsp commented Jul 1, 2024

Hi. I'm triying to add a second confirmation and execute a safe transaction using gnosis safe sdk. The safe address is a 2/n.

`export async function signTransactionAndExecute(chainId, rpcUrlProvider, safeTxHash) {

try {
    let provider = new ethers.JsonRpcProvider(rpcUrlProvider);
    let signer = new ethers.Wallet(safeSignerPK, provider);
    const ethAdapter = new EthersAdapter({ ethers, signerOrProvider: signer });
    const safeSdk = await Safe.default.create({ ethAdapter, signer });
    const apiKit = new SafeApiKit.default({
        chainId: BigInt(chainId)
    });

    const signature = await safeSdk.signTransactionHash(safeTxHash)
    console.log('Transaction signed')
    const response = await apiKit.confirmTransaction(safeTxHash, signature.data)
    console.log('Transaction confirmed')

    const safeTransaction = await apiKit.getTransaction(safeTxHash)
    console.log('Transaction fetched: ', safeTransaction)
   
    const executeTxResponse = await safeSdk.executeTransaction(safeTransaction, { nonce: safeTransaction.nonce })
    const receipt = await executeTxResponse.transactionResponse?.wait()

    console.log('Transaction executed')

    return receipt;
} catch (error) {
    console.error('Error executing transaction:', error);
}

}`

With that code I can successfully add the second confirmation I need. In the UI I can see that the option to execute is available but I always get this error:

  code: 'CALL_EXCEPTION',
  action: 'call',
  data: null,
  reason: null,
  transaction: {
    to: '0x3E5c63644E683549055b9Be8653de26E0B4CD36E',
    data: '0xa0e67e2b',
    from: '0x254bCf789A047CAdc1fc7199c481983F84036492'
  },
  invocation: null,
  revert: null,
  shortMessage: 'missing revert data',
  info: {
    error: { message: 'invalid opcode: INVALID', code: -32000 },
    payload: { method: 'eth_call', params: [Array], id: 22, jsonrpc: '2.0' }
  }
}

The value of safeTransaction is:

   "safe":"0x50f7D2C5cab2bE90279b157bdC4E5547562Ad44B",
   "to":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
   "value":"0",
   "data":"0xa9059cbb000000000000000000000000254bcf789a047cadc1fc7199c481983f840364920000000000000000000000000000000000000000000000000000000000005a55",
   "operation":0,
   "gasToken":"0x0000000000000000000000000000000000000000",
   "safeTxGas":0,
   "baseGas":0,
   "gasPrice":"0",
   "refundReceiver":"0x0000000000000000000000000000000000000000",
   "nonce":2,
   "executionDate":null,
   "submissionDate":"2024-07-01T20:48:13.384563Z",
   "modified":"2024-07-01T20:50:11.173036Z",
   "blockNumber":null,
   "transactionHash":null,
   "safeTxHash":"0x09389b3f5060262edda362f8068bfb77c2377fb3de4aff7c2a2a37902140aa44",
   "proposer":"0xfD97c83b1563cBF92022d47e9966Ea8c24AE7393",
   "executor":null,
   "isExecuted":false,
   "isSuccessful":null,
   "ethGasPrice":null,
   "maxFeePerGas":null,
   "maxPriorityFeePerGas":null,
   "gasUsed":null,
   "fee":null,
   "origin":"BTCUSD",
   "dataDecoded":{
      "method":"transfer",
      "parameters":[
         [
            "Object"
         ],
         [
            "Object"
         ]
      ]
   },
   "confirmationsRequired":2,
   "confirmations":[
      {
         "owner":"0xfD97c83b1563cBF92022d47e9966Ea8c24AE7393",
         "submissionDate":"2024-07-01T20:48:13.428709Z",
         "transactionHash":null,
         "signature":"0x8bfcdbe38e3c777770a9d1c6b7d0be003dc58d9d230ba5ba6138bd6a0a9a189e5b804c231bd75e89c8da368b6e0cbea293c0fe5cbb35b4a9ad6823820b1a770c1f",
         "signatureType":"ETH_SIGN"
      },
      {
         "owner":"0x254bCf789A047CAdc1fc7199c481983F84036492",
         "submissionDate":"2024-07-01T20:50:11.173036Z",
         "transactionHash":null,
         "signature":"0xf76d0189649d99b044d5bc36a576fd017d53912d9e8ed4386e12b4c7ad2a5e78503b9335a0206d67508c871c0ed8fd04fea64a59f066046848b34ba1082866831f",
         "signatureType":"ETH_SIGN"
      }
   ],
   "trusted":true,
   "signatures":null
}

I have been struggling with this for several hours and I haven't been able to make it work. Any help would be really appreaciated.

"@safe-global/api-kit": "^2.0.0",
"@safe-global/protocol-kit": "^2.0.0",
"@safe-global/safe-core-sdk-types": "^2.0.0",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant