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

Comments

Projects
None yet
4 participants
@johannbarbie
Member

johannbarbie commented Nov 5, 2018

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

This comment has been minimized.

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

This comment has been minimized.

eshavkun commented Nov 15, 2018

@eezcjkr

This comment has been minimized.

Collaborator

eezcjkr commented Dec 6, 2018

Done #81

@eezcjkr eezcjkr closed this Dec 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment