Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add contract upgradeability #66

Closed
johannbarbie opened this issue Nov 5, 2018 · 3 comments
Closed

add contract upgradeability #66

johannbarbie opened this issue Nov 5, 2018 · 3 comments

Comments

@johannbarbie
Copy link
Member

we want to be able to upgrade the contract with protocol changes of the Plasma chain. But the community should have the ability to veto each upgrade. Process envisioned like this:

  1. new contract code is deployed and registered for upgrade.
  2. timer runs down over x days.
  3. if no majority of token holders veto'ed the upgrade, new contract code is enabled.
@johannbarbie johannbarbie added this to the 🚣 1.0 The Raft milestone Nov 5, 2018
@eshavkun
Copy link
Contributor

eshavkun commented Nov 14, 2018

Contracts are now upgradable with ZeppelinOS
New branch pushed: https://github.com/leapdao/leap-contracts/tree/UpgradableContracts

Summary of changes

  • Contracts are now Initializable (see /contracts/Initializable.sol)
  • Constructors changed to initializers
  • Initial values for variables are moved into initializers
  • Imports changed from 'openzeppelin-solidity' to 'openzeppelin-eth'
  • zos.json created with LeapBridge and ExitToken added
  • Basic test: deployed on local (ganache) network and called functions from truffle console

TODO

  • Update test suite
  • Add upgradability governance - TBD
  • Add mock contracts to zos.json - TBD
  • Add uint256[50] private ______gap; to the end of contracts that may be inherited from - TBD
  • Link to openzeppelin-eth as EVM package - TBD
  • Check if libraries and Interfaces - TBD

Deployment

  1. Precondition: ZeppelinOS is globally installed (npm install --global zos)
  2. zos push --network NETWORK_NAME
  3. zos create CONTRACT_NAME --network NETWORK_NAME --init --args "CONSTRUCTOR_PARAMETERS"

Important Notes

  • Constructors are not working with ZeppelinOS. Initializers (function initialize() initializer public) are used instead. Initializers are never called automatically (e.g. on contract creation).
  • Deployer of the contract becomes its admin. Admin can only call proxy functions (e.g. update contract) but not logic functions. Therefore logic functions must be called from other (non-admin) account

@eshavkun
Copy link
Contributor

eshavkun commented Nov 15, 2018

@eezcjkr
Copy link
Contributor

eezcjkr commented Dec 6, 2018

Done #81

@eezcjkr eezcjkr closed this as completed Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants