jamesbachini / DEX-Arbitrage

Example arbitrage trading bot
GNU General Public License v3.0
615 stars 350 forks source link

network does not support ENS #29

Closed IgnacioGarcia198 closed 1 year ago

IgnacioGarcia198 commented 1 year ago

I can deploy the contract, but when I try to run this step: npx hardhat run --network aurora .\scripts\trade.js I get this error:

Error: network does not support ENS (operation="ENS", network="unknown", code=UNSUPPORTED_OPERATION, version=providers/5.5.2)
    at Logger.makeError (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
    at Logger.throwError (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
    at EthersProviderWrapper.<anonymous> (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/providers/src.ts/base-provider.ts:1675:20)
    at step (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/providers/lib/base-provider.js:48:23)
    at Object.next (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/providers/lib/base-provider.js:29:53)
    at fulfilled (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/providers/lib/base-provider.js:20:58)

Maybe I am just doing something wrong?

Thanks in advance.

jamesbachini commented 1 year ago

Sounds like one of the token or router addresses is wrong. Double check you have inputted them with the correct checksum (i.e. not all lower case, starting with 0x, no quotes or something like that)

IgnacioGarcia198 commented 1 year ago

You are right, I had some extra single quote pasted in "arbContract".

Now I fixed that and still getting a different error on deployment:

"status":0,"type":0,"byzantium":true}, code=CALL_EXCEPTION, version=providers/5.5.2)
    at Logger.makeError (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
    at Logger.throwError (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
    at EthersProviderWrapper.<anonymous> (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/providers/src.ts/base-provider.ts:1336:24)
    at step (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/providers/lib/base-provider.js:48:23)
    at Object.next (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/providers/lib/base-provider.js:29:53)
    at fulfilled (/Users/ignaciogarcia/code/blockchain/arbitrage/DEX-Arbitrage/node_modules/@ethersproject/providers/lib/base-provider.js:20:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  reason: 'transaction failed',
  code: 'CALL_EXCEPTION',
  transactionHash: '0x862cc13336101f78bb9b7e2466ee98af0701d49a7bd590950928aaf4ebff83f5'

Maybe I did something else wrong? Thanks in advance.

jamesbachini commented 1 year ago

Not sure the transaction failed to go through. Perhaps another incorrect address or something wrong like using a router for a Dex which isn't a Uniswap V2 clone

IgnacioGarcia198 commented 1 year ago

For the .env private key I am using the same as was as sample, but previously I used a private key of one of Ganache test accounts. Not sure if it might have anything to do with the error.

jamesbachini commented 1 year ago

Set up a private key in metamask or another wallet provider and make sure it has a bit of the native token in the wallet to pay gas fees. Make sure you don't publish that .env file or your private key anywhere and don't hold large amounts of funds in this type of hot wallet

IgnacioGarcia198 commented 1 year ago

Finally I managed to run the sample, of course it cannot find a profitable trade. I had to remove all instances of weth address so it worked, because I was not able to send weth to the ArbContract on aurora.