Functions
constructor
Constructor for the Rules Engine Diamond. Initializes the diamond by performing a diamond cut operation to set up facets.Name | Type | Description |
---|---|---|
diamondCut | FacetCut[] | Array of facets to be created at deployment. |
args | RulesEngineDiamondArgs | Arguments for the facets’ initialization, including the initializer address and calldata. |
fallback
Fallback function to handle calls to functions not explicitly defined in the diamond. Finds the appropriate facet for the function selector and delegates the call to it.batch
Allows batched call to self (this contract). Taken from BoringSolidity’s Boring Batchable and modified to not be payable. Allows batched calls to the diamond contract. Taken from BoringSolidity’s Boring Batchable and modified to not be payable. Executes multiple calls in a single transaction. IfrevertOnFail
is true, the batch stops on the first failure.
Name | Type | Description |
---|---|---|
calls | bytes[] | An array of inputs for each call. |
revertOnFail | bool | If True then reverts after a failed call and stops doing further calls. |
_callDiamond
Internal function to handle fallback calls. Finds the facet for the function selector and delegates the call to it. Reverts if no facet is found or the facet has no code._getRevertMsg
Helper function to extract a revert message from a failed call. If the returned data is malformed or not correctly ABI-encoded, this function reverts with aBatchError
.
Name | Type | Description |
---|---|---|
_returnData | bytes | The returned data from the failed call. |