FacetUtils.sol
FacetUtils
Author: @mpetersoCode55, @ShaneDuncan602, @TJ-Everett, @VoR0220
This contract is intended to be used internally by facets in the Rules Engine to streamline cross-facet interactions.
This contract provides utility functions for interacting with other facets in the Rules Engine. It includes functionality for performing delegate calls to other facets using their function selectors.
Functions
callAnotherFacet
Performs a delegate call to another facet in the Rules Engine.
Uses the function selector to locate the target facet and executes the provided call data. Reverts with the returned error message if the delegate call fails.
Parameters
Name | Type | Description |
---|---|---|
_functionSelector | bytes4 | The function selector of the target function in the other facet. |
_callData | bytes | The encoded call data to pass to the target function. |
Returns
Name | Type | Description |
---|---|---|
success | bool | A boolean indicating whether the delegate call was successful. |
res | bytes | The returned data from the delegate call. |