convertRuleStructToString(Converts afunctionString,encodedValues,ruleS,plhArray,foreignCalls,trackers,mappings):RuleJSON
RuleStruct object into a JSON-like string representation.
Parameters
| Parameter | Type | Description |
|---|---|---|
functionString | string | The calling function signature as a string. |
encodedValues | string | A string containing encoded values for the rule. |
ruleS | RuleStruct | The RuleStruct object containing rule details such as placeholders, positive effects, and negative effects. |
plhArray | string[] | An array to store the names of placeholders extracted from the rule. |
foreignCalls | ForeignCallOnChain[] | An array of foreign calls used in the rule. |
trackers | TrackerOnChain[] | An array of trackers used in the rule. |
mappings | hexToFunctionString[] | An array of mappings that associate a hex signature with a function. |
Returns
RuleJSON
An object of type ruleJSON containing the condition, positive effects, negative effects, calling function, and encoded values.
The function processes the RuleStruct object to:
- Extract placeholder names and append them to
plhArray. - Parse and format positive and negative effects into strings.
- Reverse parse the rule’s instruction set to generate a condition string.
- Populate the
ruleJSONobject with the processed data.