parseEffect(Defined in: src/parsing/parsing-utilities.ts:457 Parses an effect string and extracts its type, text, instruction set, parameter type, and parameter value. The function supports three types of effects: “emit”, “revert”, and general expressions.effect,names,placeholders,trackerNameToID):Maybe<EffectDefinition>
Parameters
| Parameter | Type | Description |
|---|---|---|
effect | string | The effect string to parse. |
names | any[] | An array of names used for interpreting expressions. |
placeholders | PlaceholderStruct[] | An array to store placeholder structures extracted during parsing. |
trackerNameToID | NameToID[] | A mapping of tracker index names used for interpreting expressions. |
Returns
Maybe<EffectDefinition>
An object containing:
type: The type of the effect (e.g.,EffectType.REVERT,EffectType.EVENT, orEffectType.EXPRESSION).text: The extracted text of the effect.instructionSet: An array of instructions for expression effects.pType: The parameter type (0 for address, 1 for string, 2 for numeric).parameterValue: The extracted parameter value (address, string, or numeric).