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