OpenZeppelin / openzeppelin-labs

A space for the community to interact and exchange ideas on the OpenZeppelin platform. Do not use in production!
https://openzeppelin.com/
MIT License
376 stars 116 forks source link

Discuss moving wrappers to zos-lib and refactoring zos-cli #105

Closed spalladino closed 6 years ago

spalladino commented 6 years ago

We currently have all logic for managing contracts in zos-cli, including convenient js wrappers around Kernel and AppManager.

These classes are useful for writing deployment scripts (see complex-example), which involve setting up the app manager, creating proxies, etc. They are also helpful in testing.

It would be useful to move these libraries that wrap the contracts and provide simple access to their methods to either zos-lib or a separate zos-lib-js project, so they can be used from any project without requiring usage of the CLI.

As for the CLI itself, several commands would be more useful when invoked from a script rather than via command line, for example, when creating proxies that require some complex initialization, or when deploying all the contracts listed in a package.zos.json. Using a middle layer as suggested by @ajsantander here could be a good option, if invoking the CLI commands by importing them is too cumbersome.

This could imply:

A user writing a script could then rely on these middle-ground classes, or use the ones provided by the zos-lib directly if they don't want to use tha package.zos files structure.