Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add info for vyper lib configuration #1334

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/config/vyper.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,34 @@ Otherwise, you can set the path to `vyper` in your `foundry.toml` by adding the
path = "/path/to/vyper"
```

#### Vyper libraries via `forge install`

If you want an import like the following to work in your Vyper contract:

```vyper
from snekmate.utils import eip712_domain_separator
```

You can install Vyper the desired library via `forge install` e.g. `forge install pcaversaccio/snekmate`.

You then need to adjust your `foundry.toml` as follows (replacing "snemkate" with the name of your
Philogy marked this conversation as resolved.
Show resolved Hide resolved
desired package):

```toml
skip = ["**/lib/snekmate/**"]
libs = ["lib", "lib/snekmate/src"]
```

#### Vyper libraries via `pip`

Alternatively if you want to install the package via `pip` into your system's python configuration
or a virtual environment you can point foundry to it by modifying your `foundry.toml` as follows:
Philogy marked this conversation as resolved.
Show resolved Hide resolved

```toml
# Assuming you have a virtual environment in `.venv` and are using Python 3.12
libs = ["lib", ".venv/lib/python3.12/site-packages/"]
```


### 2. Solidity tests

Expand Down