The Rule Processor Diamond Facets are where rule adding and rule check functions are stored in the protocol. Storage facets store the add rule functions for each rule type. Processor facets store the rule check functions and are called by an application’s handler contracts. Facets can be added or removed by the diamond to allow for upgrades to functionality of the diamond. Application contracts never call the facets directly and will only ever interact with the Rule Processor Proxy.
Note: it is not encourage to upgrade a facet manually. Instead, try the upgrade scripts as explained in the previous section. If a manual upgrade is preferred, make sure to record the deployment in the deployment/diamonds.json directory.
The new facet that is to be added to the diamond should first be deployed to the network the Rule Processor Diamond is deployed to.
The new facet address and function selectors are used as parameters for the DiamondCut function.
Once the new facet is deployed and the function selectors are known, call diamondCut on the Rule Processor Diamond contract. This is the address of the Rule Processor Proxy.