Source not found: File outside of allowed directories.solidity(6275) #322
-
Why do i keep getting this warning or error even if i have allowed them in my foundry.toml These are my import in (PuppyRaffle.sol) -: import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {Base64} from "lib/base64/base64.sol"; Also in my Test File (PuppyRaffleTest.t) -: import {Test, console} from "forge-std/Test.sol";
import {PuppyRaffle} from "../src/PuppyRaffle.sol"; My Toml File -: [profile.default]
src = "src"
out = "out"
libs = ["lib"]
allow_paths = ["src", "lib"]
remappings = ['@openzeppelin/contracts=lib/openzeppelin-contracts/contracts']
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options The Error Like this in all of my imports.-: May be this is an silly issue because I came from hardhat background. I'll be glad if someone helped me. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
What does |
Beta Was this translation helpful? Give feedback.
-
Solution:The issue occurred because I was writing code in the wrong directory. I was inside the /web3Security/ directory instead of the correct directory, /web3Security/4-puppy-raffle-audit. How I fixed the error:
This was a silly mistake which took me one day to fix lol. This should help others facing a similar problem in the future ! |
Beta Was this translation helpful? Give feedback.
Solution:
The issue occurred because I was writing code in the wrong directory.
I was inside the /web3Security/ directory instead of the correct directory, /web3Security/4-puppy-raffle-audit.
How I fixed the error:
I navigated to the correct directory:
cd /web3Security/4-puppy-raffle-audit
Once I was inside the 4-puppy-raffle-audit directory, the error
Source not found: File outside of allowed directories.solidity(6275)
was resolved.This was a silly mistake which took me one day to fix lol.
This should help others facing a similar problem in the future !