|
@@ -14,7 +14,7 @@ async function sendSwapTx(amountNumber, router, signer, provider, wallet, approv
|
|
let timestamp = new Date().getTime();
|
|
let timestamp = new Date().getTime();
|
|
timestamp = (timestamp / 1000 + 20 * 60).toFixed(0);
|
|
timestamp = (timestamp / 1000 + 20 * 60).toFixed(0);
|
|
const amountsOut = await router.getAmountsOut(amountIn, path, stable);
|
|
const amountsOut = await router.getAmountsOut(amountIn, path, stable);
|
|
- const amountOut = (amountsOut[1].toNumber() * 995 / 1000).toFixed(0);
|
|
|
|
|
|
+ const amountOut = (amountsOut[1].mul(995).div(1000));
|
|
const swapTx = await router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountIn, amountOut, path, signer.address, timestamp, stable)
|
|
const swapTx = await router.swapExactTokensForETHSupportingFeeOnTransferTokens(amountIn, amountOut, path, signer.address, timestamp, stable)
|
|
await swapTx.wait();
|
|
await swapTx.wait();
|
|
const swapReceipt = await provider.getTransactionReceipt(swapTx.hash);
|
|
const swapReceipt = await provider.getTransactionReceipt(swapTx.hash);
|