0

Let's say I have a system made up of four different sections with contracts, proxies, node files, etc:

1---------
          |
          |
          |
2---------
          |
          |
          |
3---------
          |
          |
          |
4---------

I'm literally just pressing ENTER on the command line, run after run, or arrow up + ENTER for npx hardhat run scripts/begin.js, nothing else, no modifications on any of my files, no commenting/uncommenting lines...and the system sometime runs until #3 or #2 or goes the full way without issues to #4.

Why does this happen?

I checked the code and it seems ok (otherwise it wouldn't go to #4, right? -the system starts with the default state of a pinned mainnet fork on every run-). I've counted the times this happens and I'd say that 60% of the runs the code goes to #4 as expected, and the other 40% it fails on #2 or #3, which is pretty annoying (with a custom error I set up on a CALL so not helpful).

I'm heavily using console.log on my node files and a bit on the contracts themselves, so I don't know if that's the cause of the problem. Perhaps a memory leakage (??).

I did notice that if I added more console.logs, the percentage of successful runs increased and if I removed some, it would decrease instead.

Thanks beforehand for any insights!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.