Nachoxt17 / Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans

106 stars 53 forks source link

Issue on npm start after deploying contract to ropsten testnet #3

Open ericscottmarquez opened 2 years ago

ericscottmarquez commented 2 years ago

I have successfully deployed the contract on the Ropsten test network.

0x582C29C954f4C6dB9D63Ab16b80a0b17Ea4174E6

When running npm start, I receive this error stating that the getPair function may be having an issue? I have the index.js file configured as default from the repository. Seems that the script index.js is failing in the provider.on("block", async (blockNumber) => { try block, but I can't sort out exactly why this error is occurring. Any help is greatly appreciated, and thanks for putting this code out there!

$ npm start

Error:

DAI Amount:_ 500
Bot started!
(node:42905) UnhandledPromiseRejectionWarning: Error: call revert exception (method="getPair(address,address)", errorSignature=null, errorArgs=[null], reason=null, code=CALL_EXCEPTION, version=abi/5.1.2)
    at Logger.makeError (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/logger/lib/index.js:180:21)
    at Logger.throwError (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/logger/lib/index.js:189:20)
    at Interface.decodeFunctionResult (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/abi/lib/interface.js:289:23)
    at Contract.<anonymous> (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/contracts/lib/index.js:329:56)
    at step (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/contracts/lib/index.js:48:23)
    at Object.next (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/contracts/lib/index.js:29:53)
    at fulfilled (/home/eric/Desktop/projects/crypto_shit/Arbitrage-Bot-between-UniSwap-and-SushiSwap-with-FlashLoans/node_modules/@ethersproject/contracts/lib/index.js:20:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:42905) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:42905) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.