State Variables
FLAG_FOREIGN_CALL
FLAG_TRACKER_VALUE
MASK_GLOBAL_VAR
SHIFT_GLOBAL_VAR
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.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. |
Name | Type | Description |
---|---|---|
_success | bool | A boolean indicating whether the delegate call was successful. |
_res | bytes | The returned data from the delegate call. |
_isForeignCall
Checks if the foreign call flag is set in a Placeholder using assembly Uses optimized assembly to extract the flag bit directly from memoryName | Type | Description |
---|---|---|
placeholder | Placeholder | The Placeholder struct to check |
Name | Type | Description |
---|---|---|
result | bool | True if the foreign call flag is set, false otherwise |
_isTrackerValue
Checks if the tracker value flag is set in a Placeholder using assembly Uses optimized assembly to extract the flag bit directly from memoryName | Type | Description |
---|---|---|
placeholder | Placeholder | The Placeholder struct to check |
Name | Type | Description |
---|---|---|
result | bool | True if the tracker value flag is set, false otherwise |
_extractFlags
Helper function to extract flags from a placeholderName | Type | Description |
---|---|---|
placeholder | Placeholder | The placeholder to extract flags from |
Name | Type | Description |
---|---|---|
isTrackerValue | bool | Whether the tracker value flag is set |
isForeignCall | bool | Whether the foreign call flag is set |
globalVarType | uint8 | The global variable type |
_isThereDuplicatesInCalldataValueTypeArray
this is only useful for an array passed as an argument to an external/public function and the function explicitely uses the calldata keyword. This won’t work if the array is stored in memory. this is a type-agnostic solution for determining if an array of value types from calldata contains duplicates in itName | Type | Description |
---|---|---|
len | uint256 | the length of the array. Can be easily retrieved in Solidity by using array.length; |
start | uint256 | the location in the calldata of the first element of the array. Can be retrieved with Yul by doing array.offset |
Name | Type | Description |
---|---|---|
duplicatesFound | bool | true if at least one element is repeated in the array. False otherwise |