buildAnEffectStruct(ruleSyntax, trackerNameToID, foreignCallNameToID, encodedValues, additionalForeignCalls, additionalEffectForeignCalls): EffectStructs
Builds a structured representation of positive and negative effects based on the provided rule syntax and tracker mappings.

Parameters

ParameterTypeDescription
ruleSyntaxRuleJSONThe JSON representation of the rule syntax to parse.
trackerNameToIDFCNameToID[]An array mapping tracker names to their corresponding IDs.
foreignCallNameToIDFCNameToID[]An array mapping foreign call names to their corresponding IDs.
encodedValuesstring-
additionalForeignCallsstring[]-
additionalEffectForeignCallsstring[]-

Returns

EffectStructs An object containing arrays of positive and negative effects, each represented as structured objects. The returned object has the following structure:
  • positiveEffects: An array of objects representing the positive effects.
  • negativeEffects: An array of objects representing the negative effects.
Each effect object includes:
  • valid: A boolean indicating whether the effect is valid.
  • dynamicParam: A boolean indicating whether the parameter is dynamic.
  • effectType: The type of the effect.
  • pType: The parameter type (e.g., address, string, bytes, uint).
  • param: The encoded parameter value.
  • text: A hexadecimal representation of the effect’s text.
  • errorMessage: The error message associated with the effect.
  • instructionSet: The cleaned instruction set for the effect.

Defined in

src/modules/contract-interaction-utils.ts:267