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).

  • 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 '18 at 23:28
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.

  • can this be done with Truffle compile? as mentioned, I tried and it does not seem to work. – Jeff Apr 10 '18 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 '18 at 23:18

Your Answer

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

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