# Truffle Error: The requested contract was not found. Make sure the source code is available for compilation

**URL:** <https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746>\
**Category:** Upgrades\
**Tags:** proxies\
**Created:** [July 19, 2021, 1:42pm UTC](https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746 "2021-07-19T13:42:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![temMartik](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/temmartik/32/7724_2.png) [@temMartik](https://forum.openzeppelin.com/u/temMartik)\
**Post date:** [July 19, 2021, 1:42pm UTC](https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746/1 "2021-07-19T13:42:01Z")

</div>

Trying to deploy Upgradeable contract i get an error.  
Also i get strange warnings during the compilation, but i don't have any duplicates in my truffle project.  
I didn't catch such problems before.

#### 🔢 Code to reproduce

```auto
Error: The requested contract was not found. Make sure the source code is available for compilation

```

```auto
> Duplicate contract names found for IAirdrop.
> This can cause errors and unknown behavior. Please rename one of your contracts.

> Duplicate contract names found for IERC20Mintable.
> This can cause errors and unknown behavior. Please rename one of your contracts.

> Duplicate contract names found for IMasterChief.
> This can cause errors and unknown behavior. Please rename one of your contracts.

```

#### 💻 Environment

Truffle v5.4.1 (core: 5.4.1)  
Solidity - 0.8.4 (solc-js)  
Node v14.17.0  
Web3.js v1.4.0  
@openzeppelin/truffle-upgrades 1.8.0  
@openzeppelin/contracts-upgradeable 4.2.0

---

<div class="post-metadata">

**Author:** ![Lino\_The\_Creator](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/lino_the_creator/32/7686_2.png) [@Lino\_The\_Creator](https://forum.openzeppelin.com/u/Lino_The_Creator)\
**Post date:** [July 19, 2021, 2:16pm UTC](https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746/2 "2021-07-19T14:16:53Z")

</div>

add the source code to your post so we can see the problem

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [July 19, 2021, 7:20pm UTC](https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746/3 "2021-07-19T19:20:48Z")

</div>

Try cleaning your artifacts directory. If it doesn’t help please share a repository where we can reproduce the issue.

This is related to some shortcomings of Truffle. The Upgrades plugin for Hardhat will not have the same issue.

---

<div class="post-metadata">

**Author:** ![temMartik](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/temmartik/32/7724_2.png) [@temMartik](https://forum.openzeppelin.com/u/temMartik)\
**Post date:** [July 20, 2021, 10:55am UTC](https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746/4 "2021-07-20T10:55:09Z")

</div>

Deleted build directory multiple times. Nothing ve changed. But i can 't share my repo because it’s closed as comercial project

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [July 20, 2021, 1:47pm UTC](https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746/5 "2021-07-20T13:47:59Z")

</div>

Has anything changed in your Solidity code since you started running into this error?

---

<div class="post-metadata">

**Author:** ![Godwin](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@Godwin](https://forum.openzeppelin.com/u/Godwin)\
**Post date:** [February 24, 2022, 10:12pm UTC](https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746/6 "2022-02-24T22:12:06Z")

</div>

What is this so called short coming?

It works ok until I start to inherit another local solidity file.  
If I stop inheriting anything locally, the deployProxy works.  
Everything is using inheriting from upgradeable contracts except for when it is inheriting something local, but those are also inheriting upgradeable contracts.  
I have tried deleing the abi jsons folder which didn't help. I don't know where is the build folder.  
When I use truffle compile --all && truffle migrate --reset I get "Artifacts are from different compiler runs"  
I tried to declare all the contracts in the main contract folder but I get another error: "Cannot read property 'layout' of undefined".  
Any help is appreciated! tia.

Truffle v5.4.1  
Solidity v0.8.9  
Node v16.5.0  
Web3 v1.0.0  
truffle-upgrades v^1.12.0  
Windows 10

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [March 2, 2022, 8:07pm UTC](https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746/7 "2022-03-02T20:07:44Z")

</div>

@Godwin Can you share a repo where we could reproduce the issue?

---

<div class="post-metadata">

**Author:** ![Godwin](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@Godwin](https://forum.openzeppelin.com/u/Godwin)\
**Post date:** [March 3, 2022, 9:55am UTC](https://forum.openzeppelin.com/t/truffle-error-the-requested-contract-was-not-found-make-sure-the-source-code-is-available-for-compilation/12746/8 "2022-03-03T09:55:15Z")

</div>

I was able to get it to work after reinstallign truffle-upgrades.
