Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(node:10292) UnhandledPromiseRejectionWarning: ReferenceError: amounOutMin is not defined #70

Open
duartemdoria opened this issue May 23, 2021 · 1 comment

Comments

@duartemdoria
Copy link

Hi guys,

I'm getting this error:

(node:10292) UnhandledPromiseRejectionWarning: ReferenceError: amounOutMin is not defined

CODE:
//We buy for 0.1 BNB of the new token
//ethers was originally created for Ethereum, both also work for BSC
//'ether' === 'bnb' on BSC
const amountIn = ethers.utils.parseUnits('0.0001', 'ether');
console.log(amountIn);
const amounts = await router.getAmountsOut(amountIn, [tokenIn, tokenOut]);
console.log(amounts);
//Our execution price will be a bit different, we need some flexbility
const amountOutMin = amounts[1].sub(amounts[1].div(10));
console.log(Buying new token ================= tokenIn: ${amountIn.toString()} ${tokenIn} (WBNB) tokenOut: ${amounOutMin.toString()} ${tokenOut});

@Genray100
Copy link

console.log(Buying new token ================= tokenIn: ${amountIn.toString()} ${tokenIn} (WBNB) tokenOut: ${amounOutMin.toString()} ${tokenOut}

There is a typo at ${amounOutMin.toString()}

You need to change it to ${amountOutMin.toString()}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants