From 68fb8b2bee594d925cbdf23340b75145d3ccb076 Mon Sep 17 00:00:00 2001 From: bumi Date: Wed, 14 Mar 2018 23:26:30 +0100 Subject: [PATCH] update readme --- README.mdown | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.mdown b/README.mdown index 9528744..e8e1184 100644 --- a/README.mdown +++ b/README.mdown @@ -60,7 +60,9 @@ Some of the contracts use upgradability ideas from [zeppelinos](https://github.c The basic idea is to have a Registry contract that knows about the current implementations and a Proxy contract that uses `delegatecall` to call the current implementation. That means the Proxy contract holds the storage and the address of that one does not change but the actuall implemenation is managed through the Registry. -To deploy a new version a new contract is deployed then the version is registered (`addVersion()`) in the Registry and on the Proxy contract is "upgraded" (`upgradeTo()`) to the new version. +To deploy a new version a new contract is deployed then the version is registered (`addVersion()`) in the Registry and on the Proxy contract is "upgraded" (`upgrade()`) to the new version. + +The Registry knows about all the different contracts and implementations. Versions are stored as uint and automatically incremented for every added implementation. ### Example: @@ -71,14 +73,14 @@ Deployment is best done using the [truffle deployer]() 1. deploy the Registry 2. deploy the contract 3. register the contract at the Registry: - `registry.addVersion('Token_1.0', Token.address)` + `registry.addVersion('Token', Token.address)` 4. create the Proxy: - `registry.createProxy('Token_1.0')` + `registry.createProxy('Token', 1)` 2. Update 1. deploy a new Version of the contract 2. register the new version at the Registry: - `registry.addVersion('Token_2.0', NewToken.address)` + `registry.addVersion('Token', NewToken.address)` 3. set the new implementation address on the Proxy contract: - `proxy.upgradeTo('Token_2.0')` + `registry.upgrade('Token', 2)`