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

Imports not working #1

Open
hammersharkfish opened this issue Jul 8, 2024 · 0 comments
Open

Imports not working #1

hammersharkfish opened this issue Jul 8, 2024 · 0 comments

Comments

@hammersharkfish
Copy link

hammersharkfish commented Jul 8, 2024

My project structure

contractsEscrow/
├── lib/
│   ├── foundry-random/
│   └── foundry-std/   
├── remappings.txt
└── src/
    ├── SimpleEscrow.sol
    └── ISimpleEscrow.sol

My remappings.txt

@prb/test/=lib/foundry-random/lib/prb-test/src/
CramBit/=lib/foundry-random/lib/CramBit/
crambit/=lib/foundry-random/lib/CramBit/src/
ds-test/=lib/foundry-random/lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
foundry-random/=lib/foundry-random/src/
prb-test/=lib/foundry-random/lib/prb-test/src/
solidity-bytes-utils/=lib/foundry-random/lib/solidity-bytes-utils/contracts/

When I run
forge test -vvvvv --via-ir
I run into -

Compiler run failed:
Error (6275): Source "lib/foundry-random/src/ISimpleEscrow.sol" not found: File not found. Searched the following locations: "/home/ubuntu/Work Folder/Escrow/EscrowSimple/contractsEscrow".
ParserError: Source "lib/foundry-random/src/ISimpleEscrow.sol" not found: File not found. Searched the following locations: "/home/ubuntu/Work Folder/Escrow/EscrowSimple/contractsEscrow".
 --> src/SimpleEscrow.sol:4:1:
  |
4 | import './ISimpleEscrow.sol';
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "lib/foundry-random/src/SimpleEscrow.sol" not found: File not found. Searched the following locations: "/home/ubuntu/Work Folder/Escrow/EscrowSimple/contractsEscrow".
ParserError: Source "lib/foundry-random/src/SimpleEscrow.sol" not found: File not found. Searched the following locations: "/home/ubuntu/Work Folder/Escrow/EscrowSimple/contractsEscrow".
 --> test/SimpleEscrow.t.sol:7:1:
  |
7 | import "../src/SimpleEscrow.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error: 
Compilation failed

My foundry.toml

[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc_version = '0.8.26'
[fuzz]
runs = 10000

Edited to include correct project structure and foundry.toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant