-2

Error parsing C:\Users\"directory"\example.sol: ParsedContract.sol:45:1: ParserError: Expected pragma, import directive or contract/interface/library definition. } ^ Compilation failed. See above.

And yes, pragma solidity includes a ';'

1

Without showing us your full smart contract it's pretty difficult to find the root cause of the error.

However, I was able to reproduce a similar error by adding an extra } to the end of the smart contract.

Check for any extra } in your code and delete them.

| improve this answer | |
  • Yep, you're right. I've been making lot of these silly mistakes lately. Constantly working on it. – Aditya Hegde Nov 20 '18 at 9:43

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