-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
forge script deploys libraries used outside of vm.start/stopBroadcast #3924
Comments
Here's a simpler example. When i run this script it deploys SomeLibrary - why?
|
If i change SomeLibrary into an abstract contract and make the script inherit from it, this doesn't happen. So libraries and forge script don't mix? This is unfortunate as there are things I can't do with abstract contracts that I can do with libraries. For example, the try-catch pattern. |
I am getting the same issue! Thanks for reporting this. |
I have also gotten this issue recently. It looks like it only affects external libraries, as internal libraries are inlined. |
Ref #5194 |
Closing—fixed with several linker fixes |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
No response
What command(s) is the bug in?
forge script
Operating System
Windows
Describe the bug
I have some libraries with convenience functions that I like to use in my scripts.
For example, a
readableNum
library that lets me log numbers in decimal format (for easier debugging), or astdJsonDB
library that lets me serialize/write data to a file in a single call. Despite me using these utilities outside the the bounds ofvm.startBroadcast(privKey)
andvm.stopBroadcast()
, forge script still manages to include their deployments among the broadcasted transactions.For an example:
I expect this script to broadcast only the operations I marked but forge script also cues up and deploys the
stdJsonDB
library.The text was updated successfully, but these errors were encountered: