RulesEngineInitialFacet
Inherits: FacetCommonImports
Author: @mpetersoCode55, @ShaneDuncan602, @TJ-Everett, @VoR0220
This contract is a critical component of the Rules Engine
This contract contains worker functions and initialization functions.
State Variables
initialized
Functions
initialize
Initializes the Rules Engine with the specified owner.
This function sets the initial owner of the diamond and ensures the contract is only initialized once.
Parameters
Name | Type | Description |
---|---|---|
owner | address | The initial owner of the diamond. |
retrieveRawStringFromInstructionSet
Retrieves the raw string associated with a specific instruction set within a rule and policy.
This function is used to fetch a StringVerificationStruct
containing the raw string data.
Parameters
Name | Type | Description |
---|---|---|
policyId | uint256 | The ID of the policy containing the rule. |
ruleId | uint256 | The ID of the rule containing the instruction set. |
instructionSetId | uint256 | The ID of the instruction set to retrieve the raw string from. |
Returns
Name | Type | Description |
---|---|---|
retVal | StringVerificationStruct | A StringVerificationStruct containing the raw string data for the specified instruction set. |
retrieveRawAddressFromInstructionSet
Retrieves the raw address from a specific instruction set.
This function is used to fetch the raw address associated with a given policy ID, rule ID, and instruction set ID.
Parameters
Name | Type | Description |
---|---|---|
policyId | uint256 | The ID of the policy to which the rule belongs. |
ruleId | uint256 | The ID of the rule within the policy. |
instructionSetId | uint256 | The ID of the instruction set to retrieve the address verification structure from. |
Returns
Name | Type | Description |
---|---|---|
retVal | AddressVerificationStruct | The AddressVerificationStruct containing the raw address data. |
_retreiveRawEncodedFromInstructionSet
Retrieves the raw encoded data and instruction set value from a given instruction set ID.
Parameters
Name | Type | Description |
---|---|---|
_policyId | uint256 | The ID of the policy associated with the instruction set. |
_ruleId | uint256 | The ID of the rule associated with the instruction set. |
_instructionSetId | uint256 | The ID of the instruction set to retrieve data from. |
_pType | ParamTypes | The parameter type (PT) associated with the instruction set. |
Returns
Name | Type | Description |
---|---|---|
instructionSetValue | uint256 | The value of the instruction set. |
encoded | bytes | The raw encoded data associated with the instruction set. |
onlyOnce
Ensures that the function it modifies can only be executed once.
This modifier checks if the contract has already been initialized and prevents re-initialization. If the contract is already initialized, it reverts with “Already initialized”.