Git Source

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.

function callAnotherFacet(bytes4 _functionSelector, bytes memory _callData)
    internal
    returns (bool success, bytes memory res);

Parameters

NameTypeDescription
_functionSelectorbytes4The function selector of the target function in the other facet.
_callDatabytesThe encoded call data to pass to the target function.

Returns

NameTypeDescription
successboolA boolean indicating whether the delegate call was successful.
resbytesThe returned data from the delegate call.