> ## Documentation Index
> Fetch the complete documentation index at: https://thrackle.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# buildAnEffectStruct

> **buildAnEffectStruct**(`ruleSyntax`, `trackerNameToID`, `foreignCallNameToID`, `encodedValues`, `additionalForeignCalls`, `additionalEffectForeignCalls`): [`EffectStructs`](../../types/type-aliases/EffectStructs)

Builds a structured representation of positive and negative effects based on the provided rule syntax and tracker mappings.

## Parameters

| Parameter                      | Type                                                   | Description                                                     |
| ------------------------------ | ------------------------------------------------------ | --------------------------------------------------------------- |
| `ruleSyntax`                   | [`RuleJSON`](../../validation/interfaces/RuleJSON)     | The JSON representation of the rule syntax to parse.            |
| `trackerNameToID`              | [`FCNameToID`](../../types/type-aliases/FCNameToID)\[] | An array mapping tracker names to their corresponding IDs.      |
| `foreignCallNameToID`          | [`FCNameToID`](../../types/type-aliases/FCNameToID)\[] | An array mapping foreign call names to their corresponding IDs. |
| `encodedValues`                | `string`                                               | -                                                               |
| `additionalForeignCalls`       | `string`\[]                                            | -                                                               |
| `additionalEffectForeignCalls` | `string`\[]                                            | -                                                               |

## Returns

[`EffectStructs`](../../types/type-aliases/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](https://github.com/forte-service-company-ltd/forte-rules-engine-sdk/blob/5aad4d7c3c8cc91280e4449c17ac8ea31219fbed/src/modules/contract-interaction-utils.ts#L267)
