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

ParameterTypeDescription
policySstringA JSON string representing the policy data. It must include an encodedValues property containing the argument list for the modifiers.
outputFileNamestringThe 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:57