DEV Community

Cover image for Update: What's New in the Diamond Standard EIP?

Update: What's New in the Diamond Standard EIP?

Nick Mudge
Updated on ・2 min read

The Diamond Standard has just had its largest revision in months published.

See it here:

So what's new?

The standard tries to do a better job at introducing diamonds and explaining how they work. Did it succeed?

The Diamond Standard was originally written before diamond storage existed. Parts of the standard have been rewritten to introduce and show diamond storage and its use in facets. The standard also explains the flexibility, composability and modularity of facets.

The standard now features three diagrams showing the structure of a diamond and diamond storage, and how facets can be reused.

The standard has been modified to make it clearer that the diamondCut function is optional and just exists for interoperability with tools. People can create their own custom functions or different versions of diamondCut with different parameter types that add/replace/remove functions.

The diamondCut function has two new arguments. These new arguments exist to enable a function to be executed to initialize or setup or tear down things after functions have been added/updated/removed from a diamond.

The example of a diamond in the standard was removed. Look at the reference implementation for an example.

The way a diamond is defined and explained has changed. In the past a diamond was described as a proxy contract that supported multiple logic/delegated contracts. Now the standard describes a diamond as a contract that gets its external functions from other contracts. It is a conceptual difference. The word "proxy" is no longer used anywhere in the standard to describe a diamond.

The standard includes a compiled list of diamond benefits.

A new "Learning & References" sections has been added to the standard that provides links to useful diamond resources.

Discussion (0)

Forem Open with the Forem app