General FAQs - Instadapp Docs

These are the general FAQs related to the Instadapp Documentation.

Q. Does Instadapp supports test networks like ropsten, rinkeby?

A. No, it does not.

Q. How do I configure my DSA?

A. Use dsa.setInstance(dsaId); to set the DSA you want to work with.

Q. How much gasPrice is enough?

A. Use our gist to fetch gas price from ETH Gas Station, or you can use ETH Gas Station directly.

Q. Whats the best way of calculating gas costs, on a per spell basis?

A. Use this gist to get estimated gas cost.

Q. Which address shall I give to origin ?

A. You can use any address you own to get the details of the transactions that went through you or your service. It’s basically a unique ID you are passing to track your transactions.

Q. I am getting the following error: Error: Signer Error: gas limit is too low. Need at least 47576 when using dsa.cast(spells).then(console.log) . What should I do?

A. Use:

  spells: spells,
  gas: 'value'

Q. I am getting the following error: Error: Returned error: transaction underpriced . What should I do?

A. Use this gist to get rid of the error. It’s basically adding arguments like: gasPrice , nonce , gasLimit .

Q. I am getting the following error while executing the cast spell: Uncaught (in promise) 'to' address is 0x0000000000000000000000000000000000000000 . What should I do?

A. This means you have not set up your account properly, make sure to run dsa.getAccounts(address).then(console.log); .

Q. I am getting the following error while casting: UnhandledPromiseRejectionWarning: Error: Returned error: gas required exceeds allowance (9990217) . What should I do?

A. This means your transaction need allowance, and you need to provide allowance of USDC to DSA first. Or you could directly transfer USDC to DSA address without allowance using the dsa.transfer() function, but we discourage allowance for security reasons. Transferring tokens directly to the DSA will be recommended way.

Q. The transaction gas price is minimal, and the transaction is still pending. Is there a way to change the default gas fee parameter for dsa.transfer ?

A. This might be due to lower gas cost. You can cast the transaction again with the addition of the following argument;

      token: "dai",
      amount: dsa.tokens.fromDecimal(1, "dai"),
      gasPrice: "20000000000", // 20 GWei,
      nonce: 756, // nonce of the transaction

Q. How do I convert token amount to wei and decimal?

A. To convert the token amount to wei use: dsa.tokens.fromDecimal(amount, tokenName); and to convert it into decimal use: dsa.tokens.toDecimal(amount, token);

Q. How do I get addresses of tokens?

A. Simply call:["tokenName"].address to get the address of any token.

Q. Where do I get the value of “ETH_NODE_URL” in the following snippet: const web3 = new Web3(new Web3.providers.HttpProvider("ETH_NODE_URL")); ?

A. You can get the URL in free tier from Infura.

Q. What is .env() , how do I use it and why should I use it?

A. Check out this package on npm: dotenv. The reason to use this library to keep your private key and address in a separate file so that you don’t share it by mistake when sharing the code.

Q. Can I use other languages other than Javascript?

A. Unfortunately, the SDK is only in Javascript right now, however you can interact with the contracts directly in the web3 library. If you’re interested in making a version of the SDK in another language - feel free to create a pull request and we’ll review and add it!

dsa.token -> dsa.tokens

1 Like