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 Answer
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.– JeffApr 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?– JeffApr 10, 2018 at 23:18