foundry
foundry copied to clipboard
Documentation needed: cannot deploy contract with linked libraries using deployCode
Component
Forge
Describe the feature you would like
I need to deploy a contract with an incompatible version number to my test script. The natural solution is to use deployCode
, however, this contract also requires certain libraries. The following leads to an error:
address factory = deployCode(
“Factory.sol”,
abi.encode(arg1)
);
Error:
[FAIL. Reason: Setup failed: No bytecode for contract. Is it abstract or unlinked?]
It's a known limitation that deployCode
doesn't support library linking which prevents the Factory contract from being deployed.
What is the best alternative for deploying a contract that needs a unique version number and depends on libraries?
Additional context
No response