OpenZeppelin / openzeppelin-sdk

OpenZeppelin SDK repository for CLI and upgrades.js. No longer actively developed.
MIT License
431 stars 200 forks source link

Transpiler integration into CLI #1497

Closed ylv-io closed 4 years ago

ylv-io commented 4 years ago

Fixes https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1300

This PR integrates Transpiler into SDK. It is a joined effort with @frangio.

Highlights:

Architecture Overview @frangio came up with a brilliant idea to add upgradeable filed to Contract interface which contains an upgradeable instance of a contract. During the loading process of a contract method getFromPathWithUpgradeable will look for a matching upgradeable contract and load it into upgradeable field. All the existing code will be able to access the upgradeable version of a contract just by tapping into the upgradeable field. This approach allows for minimization of the impact of supporting transpiled contracts. Transpilation of the contracts itself happens during push command. This requires two compilations, first to compile vanilla contracts for Transpiler and second to compile transpiled contracts to deploy them to blockchain.

frangio commented 4 years ago

Thank you all!