0

Im having an issue compiling my first contract with brownie. I run the following.

  • mkdir brownie
  • cd brownie
  • brownie init
  • touch contracts/SimpleStorage.sol

Contents of SimpleStorage.sol

pragma solidity >=0.4.22 <0.12.0;

contract SimpleStorage {

    uint256 storedData;
} 

When I run

  • brownie compile

I get no errors.

enter image description here

But the build/contracts directory does not populate with SimpleStorage.json

enter image description here

I have tried this workflow with the token bake as follows with no issues.

  • mkdir brownie
  • cd brownie
  • brownie init
  • brownie bake token
  • cd token
  • brownie compile

This results in a properly compiled set of .json documents in the token/build/contracts directory.

I'm very hopeful someone will be able to help me figure out what I am not doing correctly. I have found some materials indicating that my solidity compiler may not be correct but I can not make much sense of the material I have found. My compiler does not seem to be an issue as I get no errors and the second workflow executes without issue.

1 Answer 1

0

Well , I was correct in that it was not an issue with my compiler.

I simply needed to save the .sol file before running brownie compile. Silly me and shout out to this answer to a similar question I found on traditional StackOverflow.

To eliminate the obvious, make sure you have saved the .sol file. I had the same issue, and realized that the .sol file with the contract code hadn't been saved only when looking at the contents of the directory and noticing the file was 0 bytes.

Your Answer

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

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