> ## 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.

# generateModifier

> **generateModifier**(`policyS`, `outputFileName`): `void`

Generates Solidity modifiers and inserts them into a template file.

This function takes a JSON string representing rule data and generates two Solidity modifiers:
`checkRulesBefore` and `checkRulesAfter`. These modifiers are then inserted into a Solidity
template file at the placeholder `// Modifier Here`. The modified Solidity code is written
to the specified output file.

## Parameters

| Parameter        | Type     | Description                                                                                                                             |
| ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `policyS`        | `string` | A JSON string representing the policy data. It must include an `encodedValues` property containing the argument list for the modifiers. |
| `outputFileName` | `string` | The path to the output file where the modified Solidity code will be written.                                                           |

## Returns

`void`

## Throws

Will throw an error if the input JSON string is invalid or if file operations fail.

## Defined in

[src/codeGeneration/generate-solidity.ts:55](https://github.com/forte-service-company-ltd/forte-rules-engine-sdk/blob/5aad4d7c3c8cc91280e4449c17ac8ea31219fbed/src/codeGeneration/generate-solidity.ts#L55)
