Error running demo environment

4
open
cffiebigc
cffiebigc
Posted 4 months ago

Error running demo environment #7

Hi 👋 Thanks @6eer for your work. Your code looks really promising.

I followed your instructions to deploy the demo environment. I ran ganache successfully (by forking mainnet), created the .env file and also ran demo_environment.js without issues, but when I either run bot_normalswap.js or bot_flashswap.js I'm getting the following error:

UnhandledPromiseRejectionWarning: Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.

Can you point me in the right direction or help me find out what is failling?

6eer
6eer
Created 4 months ago

Hey Carlos, read this thread and let me know if it helped you!

cffiebigc
cffiebigc
Created 4 months ago

Thanks @6eer I found the answer in the thread you shared. The demo environment is now working!

interzone2
interzone2
Created 3 months ago

Hi - first thanks for your great work and for sharing it!

I'm having the same issue as above and have - to some extent - tried to remove gasNedeed references after commenting out line 144 (or as it is now line 143)

This led me to think this issue might have been resolved - i.e. 144 is already commented out and you have new code at 143..?

Anyway, I commented out line 143 AND 144 and tried to rewrite further statements to make sense without gasNedeed - unfortunately I still receive all of the errors above such as:

"Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.

Let me know if I should resolve this in another way. Thank you!!

interzone2
interzone2
Created 3 months ago

I discovered that the gasNeeded issue has been solved and no need to comment out the lines. Line 143 fixes the issue.

The problem with my running the bot related to not replacing the below fields in the .env file with the results from running :

node ./src/demo_environment.js -a
#or
node ./src/demo_environment.js -b

.env

**ADDR_ARBITRAGE_CONTRACT** = '0xD3167f135a9e003B1bF2CB81c0738Fdbc0C9124F'

**ADDR_TOKEN0** = '0x20526CEd6B8e4601B45Ec931b6B68b72c0DB249C'
**ADDR_TOKEN1** = '0x3806F6B92F899ACD32C8285Df70cB0f379A38713'

**ADDR_UTILS** = '0x79F86fDb626533F6ed19722D7CC3784ED24876dd'