Skip to content

bug(forge clone): generated remapping incorrectly maps to single files on some contracts #8499

@joshstevens19

Description

@joshstevens19

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (62cdea8 2024-07-23T00:18:49.756549000Z)

What command(s) is the bug in?

forge clone

Operating System

macOS (Apple Silicon)

Describe the bug

When you try to clone 0x06bdf212c290473dcacea9793890c5024c7eb02c it errors i am guessing it will error for other contracts, this should work out the box i think.

trace:

joshstevens@AMWM-G2136D03XG blah6 % forge clone 0x06bdf212c290473dcacea9793890c5024c7eb02c --etherscan-api-key KEY_HERE --no-commit
Downloading the source code of 0x06bDF212C290473dCACea9793890C5024c7Eb02c from Etherscan...
Initializing /Users/joshstevens/code/blah6...
Installing forge-std in /Users/joshstevens/code/blah6/lib/forge-std (url: Some("https://github.com/foundry-rs/forge-std"), tag: None)
Cloning into '/Users/joshstevens/code/blah6/lib/forge-std'...
remote: Enumerating objects: 2378, done.
remote: Counting objects: 100% (2373/2373), done.
remote: Compressing objects: 100% (845/845), done.
remote: Total 2378 (delta 1579), reused 2200 (delta 1456), pack-reused 5
Receiving objects: 100% (2378/2378), 694.09 KiB | 5.93 MiB/s, done.
Resolving deltas: 100% (1579/1579), done.
    Installed forge-std v1.9.1
    Initialized forge project
Collecting the creation information of 0x06bDF212C290473dCACea9793890C5024c7Eb02c from Etherscan...
[⠊] Compiling...
[⠒] Compiling 14 files with Solc 0.8.19
[⠑] Solc 0.8.19 finished in 610.99ms
Error:
Compiler run failed:
Error (6275): Source "IPrismaCore.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "IPrismaCore.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/PrismaOwnable.sol:5:1:
  |
5 | import "IPrismaCore.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "IERC20.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "IERC20.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/SafeERC20.sol:6:1:
  |
6 | import "IERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "draft-IERC20Permit.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "draft-IERC20Permit.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/SafeERC20.sol:7:1:
  |
7 | import "draft-IERC20Permit.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "Address.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "Address.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/SafeERC20.sol:8:1:
  |
8 | import "Address.sol";
  | ^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "IPrismaCore.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "IPrismaCore.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/SystemStart.sol:5:1:
  |
5 | import "IPrismaCore.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "SafeERC20.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "SafeERC20.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/Vault.sol:5:1:
  |
5 | import "SafeERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "Address.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "Address.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/Vault.sol:6:1:
  |
6 | import "Address.sol";
  | ^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "PrismaOwnable.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "PrismaOwnable.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/Vault.sol:7:1:
  |
7 | import "PrismaOwnable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "SystemStart.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "SystemStart.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/Vault.sol:8:1:
  |
8 | import "SystemStart.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "IPrismaToken.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "IPrismaToken.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
 --> src/Vault.sol:9:1:
  |
9 | import "IPrismaToken.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "IEmissionSchedule.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "IEmissionSchedule.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
  --> src/Vault.sol:10:1:
   |
10 | import "IEmissionSchedule.sol";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "IIncentiveVoting.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "IIncentiveVoting.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
  --> src/Vault.sol:11:1:
   |
11 | import "IIncentiveVoting.sol";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "ITokenLocker.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "ITokenLocker.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
  --> src/Vault.sol:12:1:
   |
12 | import "ITokenLocker.sol";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "IBoostDelegate.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "IBoostDelegate.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
  --> src/Vault.sol:13:1:
   |
13 | import "IBoostDelegate.sol";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "IBoostCalculator.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
ParserError: Source "IBoostCalculator.sol" not found: File not found. Searched the following locations: "/Users/joshstevens/code/blah6".
  --> src/Vault.sol:14:1:
   |
14 | import "IBoostCalculator.sol";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

joshstevens@AMWM-G2136D03XG blah6 %

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions