INNER CODE UNIT · JavaScript
gasLimit
CleBeert/crypto-trading-bot-eth-bnb · swapWeb3.js:143
const gasLimit = Math.floor(transactionDetails.gas * 1.3)
const amountInHex = ethers.BigNumber.from(amountIn.toString()).toHexString();
const ethAmount = ethers.utils.parseEther(ETH_AMOUNT);
const amountOutMin = Math.floor(ethAmount * 0.01);
const amountOutMinHex = ethers.BigNumber.from(amountOutMin.toString()).toHexString();
const path = [token.address, weth.address];
const deadline = Math.floor(Date.now() / 1000) + 60 * 20;
const deadlineHex = ethers.BigNumber.from(deadline.toString()).toHexString();
const nonceCount = await web3.eth.getTransactionCount(ACCOUNT)
const tx = await uniswap.swapExactTokensForETH(
amountInHex,
amountOutMinHex,
path,
ACCOUNT,
deadlineHex,