I had the same problem and tried a variety of approaches to force brownie to compile my code. There was no error. I just did not produce anything even though the output of the compile command indicated compilation had completed.
When else does brownie compile
say it succeeded but nothing happens? When there is nothing in the contracts
directory.
Solution:
It turns out that I had created my Solidity contract file with a .Sol
contract extension instead of .sol
. Compilation succeeded without any issue once I renamed the file to have a lower-case 's' in the extension.
The lesson:
brownie is looking for files in the contracts
folder with all lower-case .sol
as a filename extension. If there is nothing in the contracts folder
or no file with a lower-case .sol
filename extension, brownie will say it compiled successfully but really do nothing.