Replies: 1 comment 1 reply
-
Please everyone leave a clap on Medium for @n4n0b1t3 and this wonderful article! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The following solution is written for Windows, but Mac should be very similar with minor changes in the path.
Please keep in mind that lint it is not necessary for the code to work, this is just for lint to recognize the libraries.
Please check if you have the desired packages already installed with
brownie pm list
If the package is not listed you will need to install it first. Here an example for OpenZeppelin
brownie pm install OpenZeppelin/openzeppelin-contracts@3.0.0
Regardless of whether you installed the package under a virtual environment, Brownie will store the package as follows.
C:\Users\Username\.brownie\packages ...
or more specific in
C:\Users\Zarathustra\.brownie\packages\OpenZeppelin\openzeppelin-contracts@3.0.0
or here is the path for chainlink
C:\Users\Zarathustra\.brownie\packages\smartcontractkit\chainlink-brownie-contracts@0.3.0
Copy the path, for Windows remove the drive letter and revert the backslashes into (forwad) slashes, the Chainlink path should now look like this:
/Users/Zarathustra/.brownie/packages/smartcontractkit/chainlink-brownie-contracts@0.3.0
In Visual Studio Code press

Ctrl + ,
and type into the search boxsolidity.remap
Click the small link (see screenshot) and open the settings file
Adapt the following lines to your needs and add them to the settings file.
The logic is as follows: Whenever VSC lint encounters "@chainlink/" it will seach for the library in the path which is written after the equal sign. So @chainlink/contracts will look at the path and add /contracts etc.
You can add more solidity.remappings into the data structure separated by commas and enclosed in double quotation marks.
Here just for comparison my settings.json file (do not blindly copy it)
The changes should take effect immediately.
Beta Was this translation helpful? Give feedback.
All reactions