How to deploy an upgradeable contract with a linked library in Truffle?

Hi @xinya12,

One option could be to as follows:

From: How to upgrade contracts programmatically? - #8 by spalladino
You can use shelljs or child_process to call the CLI via your js code directly. You should set the OPENZEPPELIN_NON_INTERACTIVE env flag to prevent the CLI from making any interactive prompts while running on a script.

Also, when running non-interactively, you’ll have to manually call oz compile and oz push before every oz upgrade. The push command takes care of deploying your implementation contracts to the network. It is handled automatically for you when running the commands interactively, but not on a script.

1 Like