DEV Community

loading...

Discussion on: Addressing Josselin Feist's Concern's of EIP-2535 Diamonds

Collapse
mudgen profile image
Nick Mudge Author • Edited

Hi Josselin,
I don't agree with the points of your article that are outdated or inaccurate which I address in my article. I think your article is unnecessarily negative. I think you can help with some of the informational/procedure parts you mention in your article and that would be great.

EIP-2535 Diamond Standard is a good and useful standard that applications can use.

OpenZeppelin's upgrade function can't be compared to the Diamond Standard's because they do different things. The Diamond Standard provides more functionality than OpenZeppelin's proxy. With the Diamond Standard you can have functions from multiple implementations/facets, which is a core part of what the Diamond Standard is about.

The diamondCut function that is linked to provides an important safety feature: You have to be explicit about what functions you are adding or replacing or removing. The function then checks and enforces that you don't make a mistake about that. This safety feature is a good thing and protects users.

The diamondCut code that is linked to is easy to read and is straightforward.

  1. The functions and facets are looped over.
  2. The logic is separated into three parts: Add, Replace, Remove
  3. Some safety checks are done (require statements) and then the appropriate logic is execute to add or replace or remove.

Having three different implementations does not affect the complexity of the code, since each implementation is separate.

I think that if the most complicated thing about the Diamond Standard is that people have to choose which implementation to use, that's pretty good.

There are three different implementations to meet the needs and wants of different people. It is not hard to sort out which implementation to use, and in many cases I don't think it matters much which one is used because they do the same things. These are implementations of the standard, not the standard itself. People are free to write their own implementations or use other implementations if they want to.

People that want a simple implementation should use the diamond-1 implementation:
github.com/mudgen/diamond-1

People that want a more gas-efficient implementation should use the diamond-2 implementation: github.com/mudgen/diamond-1

People willing to pay a little more gas and want the simplest loupe functions should use the diamond-3 implementation: github.com/mudgen/diamond-3

More info about this here: github.com/mudgen/diamond

Also people can contact me if they have questions.

Forem Open with the Forem app