eth-sri / ilf

AI based fuzzer based on imitation learning
Apache License 2.0
149 stars 32 forks source link

How to use ILF on multiple contracts #3

Closed saarshah closed 4 years ago

saarshah commented 4 years ago

Is it possible that we can use your tool on multiple contracts ? if yes, then for each contract , we must provide a truffle contract format ? Another question: I have download this Contract from etherscan.io and do all thing to make it as truffle contract . But when i ran script/extract.py , it show following deployment error

  1. if i don't give constructor arguments in migration folder (02_deploy_contract.js) , it cause (and must show) deployment error as shown below: "MarketPlace" -- Invalid number of parameters for "undefined". Got 0 expected 5!.
  2. If i give just dummy arguments as per constructor definition , then it still can't be deployed and cause ( and also must show) deployment error as shown below;
    Error:  *** Deployment Failed ***
    "MarketPlace" hit a require or revert statement somewhere in its constructor. Try:
    * Verifying that your constructor params satisfy all require conditions.
    * Adding reason strings to your require statements.

    So, keeping in view the above fact, my question is that How could then we run any contract (s) automatically (as you claimed in your research paper), if we supposed to give all valid values as per contract logic ?

LostBenjamin commented 4 years ago

Hi,

Yes, ILF can run on multiple contracts (given that the input truffle project deploys multiple contracts).

Constructor parameters are necessary inputs because they define the initial storage of the deployed contract(s), from which automatic fuzzing starts (i.e., automatic generation of transactions). This is a valid design choice because, in a real-world setting, the users of ILF would only like to fuzz:

Your errors are caused by improperly entered constructor parameters, not a limitation of ILF. To resolve the errors, please find appropriate parameters.

Best, Jingxuan

saarshah commented 4 years ago

thanks for detailed answer..