-
Notifications
You must be signed in to change notification settings - Fork 221
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
Function execTransaction is failing #768
Comments
`const provider = new ethers.providers.JsonRpcProvider( const ethAdapterOwner1 = new EthersAdapter({ const safeService = new SafeApiKit({ const value = ethers.utils const tokenContract = new ethers.Contract(token.contractAddress, erc20Abi, provider) const data = tokenContract.interface.encodeFunctionData('transfer', [address, value]); const safeTransactionData: SafeTransactionDataPartial = { const safeSdk: Safe = await Safe.create({ // Create a Safe transaction with the provided parameters // Deterministic hash based on transaction parameters // Sign transaction to verify that the transaction is coming from owner 1 const owner2Signer = new ethers.Wallet(this.configService.get('OWNER_2_PRIVATE_KEY'), provider) const safeSdkOwner2 = await Safe.create({ const signature = await safeSdkOwner2.signTransactionHash(safeTxHash) const safeSdk: Safe = await Safe.create({ ethAdapter: ethAdapterOwner1, safeAddress }) const safeTransactionE = await safeService.getTransaction(safeTxHash) |
This is the code that i am using to transfer tokens from safe to a wallet. and i am getting success on the execute transaction. but when seen on block explorer there is an error in transaction like mentioned in the original issue above. |
There is an issue with the internal transaction. As the token contracts is not verified is very difficult to debug, but the error is affecting the internal transaction. Two things may be happening: 1.- The transfer function is not used correctly, or you are not fulfilling some of the transfer function Appart from the points above, there is another error. In the
Please test with this changes |
I have set the value to zero and removed the safeTxGas param and now i am getting a different error |
@dasanra https://sepolia.etherscan.io/address/0x34A50a7A272E86EE30b7A74E36f3f02AF18B1eB5 here is verified source contract |
@yagopv please! |
@Malikrehman00107 please, don't tag people like that. @faisal-anwar825 The error now is self explanatory, the account that executes the transaction (the signer) doesn't have enough ETH to execute the transaction. Add funds to 0xb55D2195F400A137Fa67EB520B13B6b951770b76 |
@dasanra |
If i remove safeTxGas param then again it fails on executeTransaction method throwing error |
I see you are executing now transactions with the correct configuration. We don't have any error like the one you describe above, so I would need to see a current version of the code to help further |
@Malikrehman00107 that contract is just a Safe contract. I would need to see either the current SDK implementation and the code of this smart contract |
`
|
@dasanra here is the updated code. I have set the eth value to zero and also safeTxGas to zero. but still getting gas estimate error while executing transaction |
@faisal-anwar825 could you remove the safeTxGas from Also, could you tell me which versions of the SDK are you using? Could you tell me which line the code is failing? Does it fails when creating the transaction or already when sending it to the blockchain? Could you leave in the queue, pending to be executed a transaction that is created with the script? |
"@safe-global/api-kit": "^1.3.1", |
Ok, those are old versions that are not supported anymore. There were some gas estimation issues that were solved in v2 specially affecting some specific RPC providers, which may be your case. To go forward with this topic you will need to upgrade to the latest version:
From v2 you will need to use ethers v6, that is the supported version. There are also some migration guides explaining bigger changes between the version you are using and the new one, just in case you are affected: https://docs.safe.global/sdk/api-kit/reference/migrating-to-v2 |
i have upgraded the versions to the latest
` but now it is giving the "Not found" error. nothing else just an error message saying not found. i have debugged the issue into the code of sdk. Error is coming from this file
when i propose transaction
this url is called from that file with this body `
` http call is made successfully but when the response is converted to json at this piece of your SDK code in the mentioned file. `
` it goes into the catch block with error
I guess there is an issue with SDK's response. response.ok is false and response.statusText is "Not Found" |
Yes, that is expected. From You can instead just leave the chainId parameter only. This will fix the current error that is displayed in your app. |
Still same. |
@dasanra sorry to bother you , Can you have a look at this, please? Best |
@germartinez can you please guide ? it seems daniel is away since few days |
@dasanra can you please review and do necessary? best |
@faisal-anwar825 I see you are creating plenty of transactions currently with 2 signatures. But is not possible to execute those transactions because the previous transactions should be executed first https://app.safe.global/transactions/queue?safe=sep:0x159bd467fafcfa348d2b5f357b23aa1d70e814a0 While all those transactions are in the queue it won't be possible for you to run the script completely, as the execute function will be locked because is not having the next nonce to execute. Also I'm not really sure how you are creating those transactions, as the nonce is increasing but with the code you shared is not modifiying the nonce |
But how can i execute the previous transactions if they keep giving gas error randomly. Whats the solution of this? should i execute transactions in chronological order. In this case all newer transactions will remain pending if one transaction gets stuck.
` |
Ok, if you call getNextNonce will just add more and more operations to the queue. You can manually set the 108 nonce for now and will overwrite the current pending 108. Once you get rid of that, you can execute all the pending directly in the web interface and then set the code as you currently have it.
|
@faisal-anwar825 all good here ? |
@dasanra we are still facing the issue with the nonce , every time transaction get stucked end up a mess in the backlog. please propose a permanent and effective solution. best regards |
@Malikrehman00107 from what I can see in the Safe you shared in the thread transactions are being executed sucessfully, so unless you provide more context we are not able to see any issue. |
After checking there are several transactions executed that seem automated we consider this issue as closed. |
We create a safe and when we send the funds form safe.
execTransaction( Is failing .
Here is Trx Hash: https://sepolia.etherscan.io/tx/0x02cbb2c32af0ae333d90e704a630d3638b53005ba9dbb3022028521b8fe9d71d
Safe Smart Contract : https://sepolia.etherscan.io/address/0x159bd467fafcfa348d2b5f357b23aa1d70e814a0
need your attention here please
The text was updated successfully, but these errors were encountered: