---
title: "Discussion on \"Adding Dependencies to your Contracts in Foundry\" | Hashnode"
description: "Discussion on \"Adding Dependencies to your Contracts in Foundry\". In building smart contracts a very common thing you will need to do is add dependencies to take advantage of code other people have already written. One of the most common dependencies/smart contract libraries to use is OpenZeppelin's contracts. They..."
url: "https://hashnode.com/posts/adding-dependencies-to-your-contracts-in-foundry/6276b351dc122f5a4f21e793"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Adding Dependencies to your Contracts in Foundry](https://sooryak.hashnode.dev/adding-dependencies-to-your-contracts-in-foundry?utm_source=hashnode&utm_medium=feed)

In building smart contracts a very common thing you will need to do is add dependencies to take advantage of code other people have already written. One of the most common dependencies/smart contract libraries to use is OpenZeppelin's contracts. They...

May 7, 2022 · 3 min read · sooryak.hashnode.dev  
Read the article

-   [#web3](https://hashnode.com/tag/web3)
-   [#solidity](https://hashnode.com/tag/solidity)

## Written by

[Soorya Kumar](https://hashnode.com/@SooryaK)

@SooryaK

  
[View profile](https://hashnode.com/@SooryaK)

## Responses 3

Markdown supported · ⌘↵ to post

[Guido Giuntoli](https://hashnode.com/@gagiuntoli)

[Oct 1, 2022](https://hashnode.com/posts/adding-dependencies-to-your-contracts-in-foundry/6276b351dc122f5a4f21e793/comment/633805dbfa20fa4bc8e56f97)

In my case works but with a slight modification of the path:

```
import "openzeppelin-contracts/token/ERC20/ERC20.sol";
```

The path you mention:

```
import "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
```

throws me this error:

```
Error: 
Compiler run failed
error[6275]: ParserError: Source "lib/openzeppelin-contracts/contracts/contracts/token/ERC20/ERC20.sol" not found: File not found.
```

[Yves Boutellier](https://hashnode.com/@sagaciousyves)

[Aug 25, 2022](https://hashnode.com/posts/adding-dependencies-to-your-contracts-in-foundry/6276b351dc122f5a4f21e793/comment/6307c53a0e45d758b7f84137)

and cool tutorial btw - very helpful actually

[Yves Boutellier](https://hashnode.com/@sagaciousyves)

[Aug 25, 2022](https://hashnode.com/posts/adding-dependencies-to-your-contracts-in-foundry/6276b351dc122f5a4f21e793/comment/6307c34479f56556d0cbb5de)

the @ sign is for "scoped packages" in npm - unfortunately, hashnode doesn't let me add a link in this comment :( dm me on twitter @boutellier\_yves for a link ;)
