Search code examples
soliditynodesroutersmartcontractsabi

var error = new Error(message); Why am I getting this message in the terminal?


Everything works effectively until I add the const amountOut to the file.

Code with Error & location of function that breaks code


Solution

  • You are passing 2 parameters into a function that is expecting 3. The second parameter is one value because you have it as an array in brackets - [AddressFrom, AddressTo].

    You will need to either modify how you are passing in the parameters to the getAmountsOut function or modify the getAmountsOut function to accept 2 parameters, with one being an array.