Closed ElliotFriedman closed 2 weeks ago
You should provide --rpc-url
argument matching the RPC/alias of the fork which is being selected during the script execution.
Forge does not support dynamic library linking, so it predeploys all libraries before executing the script -> before knowing which exact fork is being selected via forking cheatcodes. Because of that, library deployment transactions don't have an RPC url and this causes script to be treated as multi-chain one
Ok, I guess this would make sense why this works for some scripts and not others then. If the script deploys a library and then needs to link it with our current setup it will fail, but if the script does not deploy a library, then it will succeed.
Ok, I guess this would make sense why this works for some scripts and not others then. If the script deploys a library and then needs to link it with our current setup it will fail, but if the script does not deploy a library, then it will succeed.
It is only happening if script needs to deploy libraries. If it does not pre-deploy any libraries, then there's no need to know fork url before forking cheatcode is being called
Marking as resolved
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (82ff8ee 2024-07-10T00:22:26.618652000Z)
What command(s) is the bug in?
forge script
Operating System
macOS (Intel)
Describe the bug
Currently on this pull request at the latest commit, running this command:
DO_DEPLOY=true DO_VALIDATE=true DO_PRINT=true DO_BUILD=true DO_RUN=true forge script src/proposals/mips/mip-x01/mip-x01.sol:mipx01 -vvvvv
gives this error:
"Multi chain deployment does not support library linking at the moment."
However, the same deployment tooling works across all other deployment scripts so it's unclear why this deploy function is different. See MIP-00 which can be run with command:
It has no issues doing a multichain deployment for MIP-00 so it is unclear why this particular command is causing problems.
Update: another deployment script has this same issue even though it only deploys the contracts to a single chain.
https://github.com/moonwell-fi/moonwell-contracts-v2/pull/271
command:
fails with: