1

I'm following freecodecamp's solidity course but am unable to import Ownable from OpenZeppelin into my contract.

Using brownie, this is what I have so far:

enter image description here

and in the config.yaml file:

remapping

And when I try $ brownie compile, I get this error message:

enter image description here

From what I can tell, it should be working but idk, I'm pretty new to all this.

2

2 Answers 2

0

I had a similar problem today and downgrading my solidity extension to a later version (0.0135) as recommended by this youtube solution fixed the issue for me:

https://youtu.be/5qTdQNCMwk8

I hope this helps the next person faced with this problem. It's not your code that's wrong, it's the extension. We move!

0

Remappings can be tricky, and a little bit buggy in VSCode.

There are a few different things you can try to fix the issue:

  1. Comment and un-comment the import lines. Helps "refresh" the import.

  2. Restart your VS Code completely, including all opened windows. Worked for me a couple of times.

  3. Try creating a 'remappings.txt' file, and add the same line without brackets and "".

For me, writing the remappings in a .txt file helped, this is how it looks in mine:

@openzeppelin/=lib/openzeppelin-contracts/

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.