From ec604acba8f6c2065e130fa4b913034bcdae8cba Mon Sep 17 00:00:00 2001 From: Nick Mudge Date: Wed, 26 Aug 2020 05:30:19 -0400 Subject: [PATCH] Update eip-2535.md --- EIPS/eip-2535.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/EIPS/eip-2535.md b/EIPS/eip-2535.md index d038e8bb2b967a..4a6e98981646e0 100644 --- a/EIPS/eip-2535.md +++ b/EIPS/eip-2535.md @@ -64,9 +64,11 @@ A diamond has four standard external functions that can be called to show what f ## Upgrades and Immutability -A diamond can be immutable by not adding an external function to it that can add/replace/remove functions or by removing such functions. +A diamond can be immutable from inception by not adding any external functions that can add/replace/remove functions. [There are number of reasons to do this.](#different-kinds-of-diamonds) -A diamond can be upgraded if has a `diamondCut` external function or other function(s) that can add/replace/remove functions. +A diamond that is mutable can be made immutable by removing such functions. + +A diamond can be upgraded if it has a diamondCut external function or other function(s) that can add/replace/remove functions. ## Facets and State Variables @@ -232,9 +234,7 @@ An upgradeable diamond has the `diamondCut` function and/or possibly other funct A finished diamond was an upgradeable diamond and had a number of upgrades. Then its `diamondCut` function and/or other upgrade functions were removed and upgrades are no longer possible. It is no longer possible to add/replace/remove functions. It has become an immutable diamond. **Single Cut Diamond** -The specification section of the standard is careful not to say that a diamond *has* a `diamondCut` function. Instead it says a diamond *uses* a `diamondCut` function. This careful wording makes single cut diamonds and other patterns possible. A single cut diamond uses the `diamondCut` function in the constructor function of the diamond to add all functions to the diamond, but it does not add the `diamondCut` function to the diamond. This means that a single cut diamond is fully created in its constructor and once created can never be upgraded. It has the same immutability and trustless guarantees as a regular vanilla contract. Why would someone do this? There may be a number of reasons. The two use cases below are really good reasons. - -The two use cases below assume that you want an immutable diamond: +A single cut diamond adds all functions to itself in its constructor function, but it does not add the `diamondCut` function or any other function that can add/replace/remove functions. This means that a single cut diamond is fully created in its constructor and once created can never be upgraded. It has the same immutability and trustless guarantees as a regular vanilla contract. Why would someone do this? There may be a number of reasons. The two use cases below are good reasons. 1. Your contract hits the max contract size limit. Make it into a single cut diamond. You still break your big contract into smaller facets, modularizing your code. 2. You start with an upgradeable diamond in your development and testing and upgrade it to your heart's delight. Reap the advantages of easy upgrading and a stable address as you work out new features, bugs and kinks. Release the upgradeable diamond on a test network with your application for beta testing and upgrade it when needed. This is iterative development. When it is solid then deploy it as a single cut diamond on the main network.