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) );


[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?

I know I could manually change the version numbers in the contract with linked libraries to comply but there is a very large/nested number of contracts involved that would have to be changed (>10).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.