foundry-rs / book

A book on all things Foundry, available at https://book.getfoundry.sh.
https://book.getfoundry.sh
Apache License 2.0
770 stars 602 forks source link

File not found when verify contract #1226

Closed ctb0k33 closed 6 days ago

ctb0k33 commented 2 months ago

I try to deploy my contract using UUPS proxy (ERC1967). But when i run the script, foundry can't found the file.

Error message: "Details: Fail - Unable to verify. Solidity Compilation Error: Source "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol" not found: File not found. Searched the following locations: "". Contract failed to verify."

I already click on the source and the file is still there. I also update my foundry version but it still not work.

Here is my foundry.toml file:

[profile.default]
src = "src"
out = "out"
libs = ["lib"]
ffi = true
fs_permissions = [{ access = "read", path = "./broadcast" }, {access = "read", path = "./Images/"}]
remappings = [
    '@openzeppelin/contracts=lib/openzeppelin-contracts/contracts',
    '@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/',
    '@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/',
]
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
ctb0k33 commented 2 months ago

Turn out that my remappings have some problem. Already fix that by delete the first one.

onbjerg commented 6 days ago

Please re-open the issue in the foundry repo, not the book, if this is still an issue.