1

I am building a project which is divided into separate .sol files, one per contract or interface. The tutorial shows a single file cryptozombies_abi.js which appears to me to be something like the json of all the separate of files found in the build folder after the compile concatenated but I am not sure. My question is, is there a way to create a single ABI from multiple sol files -- I have attempted with no success the --abi option of truffle compile which does not fail but also does not produce one large ABI -- it does produce the json still (which I am guessing are in fact ABIs for each sol file).

1
  • EDIT: Not sure that the JSON created by Truffle compilation is meant to be ABI files although I think they look like ABIs.
    – Jeff
    Apr 10, 2018 at 23:28

1 Answer 1

1

Run solc --abi on whatever source files, and any imports will be pulled in my solc, and also compiled giving all the ABIs of every contract that was imported into that source file.

2
  • can this be done with Truffle compile? as mentioned, I tried and it does not seem to work.
    – Jeff
    Apr 10, 2018 at 21:43
  • I tried solcjs command line tool -- I do not see how to create a single ABI file from the ABI files produced for multiple contracts. Are they simple concatenated into a single file in a separate step?
    – Jeff
    Apr 10, 2018 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.