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

bug in auto remappings #454

Open
cruzdanilo opened this issue Apr 9, 2024 · 2 comments
Open

bug in auto remappings #454

cruzdanilo opened this issue Apr 9, 2024 · 2 comments

Comments

@cruzdanilo
Copy link

auto remappings are not working for some projects. i wonder if forge auto-remappings are being used, but they should be for foundry-based projects.

with the current trend of avoiding custom remappings, this has become very important. here is a quote from the recently published coinbase solidity style guide:

1. Avoid custom remappings.

Remappings help Forge find dependencies based on import statements. Forge will automatically deduce some remappings, for example

forge-std/=lib/forge-std/src/
solmate/=lib/solmate/src/

We should avoid adding to these or defining any remappings explicitly, as it makes our project harder for others to use as a dependency. For example, if our project depends on Solmate and so does theirs, we want to avoid our project having some irregular import naming, resolved with a custom remapping, which will conflict with their import naming.

here is an example of a case where the extension fails to resolve imports that could be resolved using forge auto-remappings: https://github.com/cruzdanilo/repro-webauthn

Screenshot 2024-04-09 at 12 48 40

forge remappings output for the project:

@openzeppelin/contracts/=lib/webauthn-sol/lib/openzeppelin-contracts/contracts/
FreshCryptoLib/=lib/webauthn-sol/lib/FreshCryptoLib/solidity/src/
ds-test/=lib/webauthn-sol/lib/forge-std/lib/ds-test/src/
erc4626-tests/=lib/webauthn-sol/lib/openzeppelin-contracts/lib/erc4626-tests/
forge-std/=lib/webauthn-sol/lib/forge-std/src/
openzeppelin-contracts/=lib/webauthn-sol/lib/openzeppelin-contracts/
solady/=lib/webauthn-sol/lib/solady/src/
webauthn-sol/=lib/webauthn-sol/src/

in this issue discussion, it was mentioned that other solidity extensions for vscode do work out of the box in this case: base-org/webauthn-sol#14

@MateoEmilio1
Copy link

same issue here, i was following the https://docs.pyth.network/price-feeds/create-your-first-pyth-app/evm/part-1 and this error stoped me :/ i have installed the last version of Juan Blanco

@BTBMan
Copy link

BTBMan commented Sep 9, 2024

Same issue.

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

3 participants