AtomicArbBot icon indicating copy to clipboard operation
AtomicArbBot copied to clipboard

truffle integration

Open adityaraval opened this issue 4 years ago • 4 comments

I want to give a PR to set integration of this smart contract with truffle, but I am still getting some errors while deploying this contract via truffle, please help me to fix this and merge this PR.

adityaraval avatar Sep 24 '20 19:09 adityaraval

There are a few areas where you are likely running into trouble:

  1. There is a lot of logic in the ArbBot.sol constructor that is likely failing in your test environment because it is trying to make calls to hardcoded mainnet token addresses. Try migrating the contracts without the constructor to pin point the issue

  2. You likely need to raise the default transaction gas limit the contract is deployed as well as the default block gas limit. For example, run a test network with a higher block gas limit with ganache-cli -l 999999999999999. Raise the default gas limit in truffle-config:

      development: {
       host: "127.0.0.1",     // Localhost (default: none)
       port: 8545,            // Standard Ethereum port (default: none)
       network_id: "*",       // Any network (default: none)
       gas: 10000000,
       gasPrice: 1
      },
  1. for whatever reason, truffle does not play nice with more recent npm versions. in my tests, I installed truffle with npm 11 (use nvm to quickly change node versions)

I am no longer supporting this project, but was able to compile and migrate in a quick test using the above tweaks. Hopefully this helps.

nicholashc avatar Sep 24 '20 21:09 nicholashc

There are a few areas where you are likely running into trouble:

  1. There is a lot of logic in the ArbBot.sol constructor that is likely failing in your test environment because it is trying to make calls to hardcoded mainnet token addresses. Try migrating the contracts without the constructor to pin point the issue
  2. You likely need to raise the default transaction gas limit the contract is deployed as well as the default block gas limit. For example, run a test network with a higher block gas limit with ganache-cli -l 999999999999999. Raise the default gas limit in truffle-config:
      development: {
       host: "127.0.0.1",     // Localhost (default: none)
       port: 8545,            // Standard Ethereum port (default: none)
       network_id: "*",       // Any network (default: none)
       gas: 10000000,
       gasPrice: 1
      },
  1. for whatever reason, truffle does not play nice with more recent npm versions. in my tests, I installed truffle with npm 11 (use nvm to quickly change node versions)

I am no longer supporting this project, but was able to compile and migrate in a quick test using the above tweaks. Hopefully this helps.

Hello, I tried creating a contract but I got the error Out of gas, gas limit I set to 3000000 by default, how much do I need to increase the gas limit.

laveixzi avatar Oct 03 '20 07:10 laveixzi

try 10000000

nicholashc avatar Oct 03 '20 08:10 nicholashc

Hello guys,

Is it still worth making a profit with flash loan with many bots competing with each other?

andermarce avatar Oct 06 '20 17:10 andermarce