GithubHelp home page GithubHelp logo

Safe-AA Error: My tx only get succeed if I increase safeTxGas and BaseGas manually in code. otherwise it gets fails about safe-core-sdk HOT 5 CLOSED

sunnyRK avatar sunnyRK commented on September 14, 2024
Safe-AA Error: My tx only get succeed if I increase safeTxGas and BaseGas manually in code. otherwise it gets fails

from safe-core-sdk.

Comments (5)

dasanra avatar dasanra commented on September 14, 2024

Hi @sunnyRK

we are about to release a version of the SDK where you shouldn't need to specify gas parameters in order to get a successful transaction. Although I would like to get some details that could help us to understand your specific case

Which SDK version are you using?
Which kit are you using?
Which SDK method are you calling with that data?
Which network were you trying to execute?

Thank you!

from safe-core-sdk.

sunnyRK avatar sunnyRK commented on September 14, 2024

Hey @dasanra

I am using auth-kit and relay-kit
Initially i was using latest sdk vesions but it was failing and then i shift to below,
So now, I am using these sdk versions as metioned in account-abstraction-demo-ui repo,

"@safe-global/account-abstraction-kit-poc": "^1.0.1",
 "@safe-global/auth-kit": "^1.2.0",
 "@safe-global/onramp-kit": "^1.3.0",
 "@safe-global/relay-kit": "^1.0.0",
 "@safe-global/safe-react-components": "^2.0.3",
 "@web3auth/base": "^4.6.0",
 "@web3auth/modal": "^4.6.2",
 "@web3auth/openlogin-adapter": "^4.6.0",

I am calling relayTransaction method to execute like below,
const gelatoTaskId = await safeAccountAbstraction.relayTransaction(dumpSafeTransafer, options);

from safe-core-sdk.

sunnyRK avatar sunnyRK commented on September 14, 2024

Hey @dasanra, any update on above?

from safe-core-sdk.

dasanra avatar dasanra commented on September 14, 2024

Hey @sunnyRK we published a new version of the relay-kit.

To sync all we will need you to set

"@safe-global/account-abstraction-kit-poc":  "^1.3.0"
"@safe-global/relay-kit":  "^1.3.0"

I recommend also using our types library, that may help you to use our kits

"@safe-global/safe-core-sdk-types":  "^2.3.0"

import {
  MetaTransactionData,
  MetaTransactionOptions,
} from '@safe-global/safe-core-sdk-types'

Currently the account-abstraction-kit as its name suggest it's a PoC so you can sort this using directly that package, with less intervention or directly using the relay-kit. With account-abstraction-kit it will be possible to use Safes having only one signature required.

If you try to send a transaction paying with balance of a native token that you hold in your Safe I recommend you tweak the transaction object like this:

const dumpSafeTransafer: MetaTransactionData[] = [
      {
          to: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
          data: approveTx.data,
          value: ethers.utils.parseUnits("0").toString()
      },
  ];

And then call it like this:

const gelatoTaskId = await safeAccountAbstraction.relayTransaction(dumpSafeTransafer)

If you try to use 1Balance or using an ERC20 that you hold in your Safe you will need to tweak the options a bit:

  // options for using 1Balance
  const options: MetaTransactionOptions = {
    isSponsored: true
  }
  // options for using an ERC20
  const options: MetaTransactionOptions = {
    gasToken: GAS_TOKEN_ADDRESS
  }

You can find compatible GAS_TOKENS_ADDRESS for each chain
https://docs.gelato.network/developer-services/relay/payment-and-fees/syncfee-payment-tokens

And then call it like this:

const gelatoTaskId = await safeAccountAbstraction.relayTransaction(dumpSafeTransafer, options)

Please test this and hope all works as expected now.

from safe-core-sdk.

dasanra avatar dasanra commented on September 14, 2024

This issue should be completely solved in relay-kit v2.0.0 as there is no need to set the gas for relaying any more.
If you still find issues please feel free to open a new ticket.

from safe-core-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.