You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using forge with create-eth, and when I run forge install it installs in the lib folder in the root of my project.
I appear to be having an issue with paths though. My packages/foundry/remappings.txt file has the line: oz-upgradeable=/lib/hypercerts/contracts/contracts/lib/openzeppelin-contracts-upgradeable/contracts/
It's throwing an error:
hyperstaker-mono git:(feat-basic-staking) ✗ yarn test
[⠊] Compiling...
Error:
Failed to resolve file: "/Users/james/code/hyperstaker-mono/packages/foundry/lib/hypercerts/contracts/contracts/lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol": No such file or directory (os error 2).
Check configured remappings..
--> "/Users/james/code/hyperstaker-mono/lib/hypercerts/contracts/contracts/HypercertMinter.sol"
"oz-upgradeable/security/PausableUpgradeable.sol"
Which basically shows that it's looking for the lib folder relative to the foundry folder:
packages/foundry
I'm stuck on how to get around this.
I've tried:
passing in a flag - yarn test --lib-paths ./lib
adding the flag to packages/foundry/package.json ---> "test": "forge test",
The only way I have been been able to get it working is to hard code the path to the folder like this: oz-upgradeable=/Users/me/code/hyperstaker-mono/lib/hypercerts/contracts/lib/openzeppelin-contracts-upgradeable/contracts/
This is problematic as it's a shared repo which others work on, and I'm a bit confused by this behaviour altogether, and wonder if I'm doing something wrong, or if it's a bug?
The text was updated successfully, but these errors were encountered:
positonic
changed the title
Clarification around forge install, and the lib folder
Bug, or clarification needed around forge install, and the lib folder
Apr 21, 2024
I'm using forge with create-eth, and when I run forge install it installs in the lib folder in the root of my project.
I appear to be having an issue with paths though. My packages/foundry/remappings.txt file has the line:
oz-upgradeable=/lib/hypercerts/contracts/contracts/lib/openzeppelin-contracts-upgradeable/contracts/
It's throwing an error:
Which basically shows that it's looking for the lib folder relative to the foundry folder:
packages/foundry
I'm stuck on how to get around this.
I've tried:
yarn test --lib-paths ./lib
The only way I have been been able to get it working is to hard code the path to the folder like this:
oz-upgradeable=/Users/me/code/hyperstaker-mono/lib/hypercerts/contracts/lib/openzeppelin-contracts-upgradeable/contracts/
This is problematic as it's a shared repo which others work on, and I'm a bit confused by this behaviour altogether, and wonder if I'm doing something wrong, or if it's a bug?
The text was updated successfully, but these errors were encountered: