Not understanding overwrite syntax? #1537
Unanswered
Atomzwieback
asked this question in
Q&A
Replies: 1 comment 3 replies
-
The overrides allow you to supply custom settings. You can find list of overrides here. For example if you want to use a custom gas price instead of default value. const tx = await contact.swapExactTokensForTokens(
amountIn,
amountOutMin,
[tokenIn, tokenOut],
addresses.recipient,
Date.now() + 1000 * 60 * 10, // 10 minutes
{
gasPrice: ethers.utils.parseUnits('120', 'gwei')
}
);
Oh, if it gives you an error that goes like cannot estimate gas price, then it is likely that your transaction is failing with a revert. As a guess, are you sure that your account has enough |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
i do not quiet understand the overwrite syntax: https://docs.ethers.io/v5/api/contract/contract/
contract.METHOD_NAME( ...args [ , overrides ] )
my code:
As i understand i have to pass them as last value as object or im wrong? Because atm my code throws no error but also stuck there. I took a look at the pending transactions in the testnet and there is no so i guess my transaction did not arrived there. If i do no override it tells me to set it because it could not etstimated.
I searched already and found this:
#40
but not help me so may someone has a hint for me?
Beta Was this translation helpful? Give feedback.
All reactions