ethereum-contract-sexy-manager
v0.1.5
Published
This CLI Manage Your Ethereum Contract With Upgradable
Downloads
4
Readme
Ethereum Contract Upgrade Manager
This is CLI to deploy your contract with upgradeable architecture.
Install
$ npm install -g ethereum-contract-sexy-manager
Architecture
Jargon
- Implementation
The implementation is one or more contracts to be deployed. This repository has a sample contract. - Proxy
This contract uses delegate call for implementation contract when it is called by user. - Proxy Admin
This contract manages Proxy contract. This contract changes the implementation address stored on Proxy contract and the administrator.
Flow
There are three steps when the contract is deployed.
Deploy the implementation you indicate with option.
Deploy the Proxy Admin contract and store your address as the administrator.
Deploy the Proxy and store the Proxy Admin address as manager.
Commands
$ sexydynamite init
Create .sexydynamite directory and admin.json you can set your wallet and private key here, and add admin.json file to .gitignore in order not to push your private information.
$ sexydynamite create -c {Contract Name V1}
Deploy your contract with above architecture. The contract needs to be compiled build/contracts directory. The project information is emited on .sexydynamite/deployed.json.
$ sexydynamite upgrade -c {Contract Name V2}
Upgrade your implementation to indicated contract. Your new implementation will be deployed and Proxy will use delegate call for new implementation.
Structure
(ProjectRoot)
--/.sexydynamite
|--admin.json <- Please fill in address and pribate key information.
|--deployed.json <- This will be emited when new implementation is deployed. This has contract address and owner of this architecture.
Test
$ truffle test