#Diamond
The diamond structure itself can be configured:
#Initialization contract
The initialization contract - diamond.init
config - is optional, and is only needed if you wish to execute custom initialization code on-chain when doing a new deployment of your Diamond.
#Core facets
Core facets are contracts whose selectors are considered sacrosanct such that they will never be removed from the diamond in upgrade by Gemforge. Gemforge will also complain if you create a contract that has one of these names.
The default core facets in the config file are the ones provided by the standard diamond library and are essential to the correct working of the deployment and upgrade mechanisms:
DiamondLoupe
- An interface for querying the diamond. Essential to making upgrades work.DiamondCut
- The upgrade mechanism for the diamond.Ownership
- Verification and transfer of diamond ownership.
#Protected methods
Protected methods are similar to core facets in that they will NEVER be removed from the Diamond during an upgrade. This allows you to protect specific methods in your own facets. The default list contains the external methods in the core facets as additional protection.
Note, however, that protected methods can still be overridden and replaced.
Unless you really know what you're doing, we recommend leaving coreFacets
and protectedMethods
unchanged.