Functions
createRule
Creates a rule in storage. Adds a new rule to the specified policy. Only accessible by policy admins.Name | Type | Description |
---|---|---|
policyId | uint256 | ID of the policy the rule will be added to. |
rule | Rule | The rule to create. |
Name | Type | Description |
---|---|---|
<none> | uint256 | ruleId The generated rule ID. |
updateRule
Updates a rule in storage. Modifies an existing rule in the specified policy. Only accessible by policy admins.Name | Type | Description |
---|---|---|
policyId | uint256 | ID of the policy the rule belongs to. |
ruleId | uint256 | The ID of the rule to update. |
rule | Rule | The updated rule data. |
Name | Type | Description |
---|---|---|
<none> | uint256 | ruleId The updated rule ID. |
getAllRules
Retrieves all rules associated with a specific policy.Name | Type | Description |
---|---|---|
policyId | uint256 | The ID of the policy. |
Name | Type | Description |
---|---|---|
<none> | Rule[][] | rules A two-dimensional array of rules grouped by calling functions. |
deleteRule
Deletes a rule from storage.Name | Type | Description |
---|---|---|
policyId | uint256 | The ID of the policy the rule belongs to. |
ruleId | uint256 | The ID of the rule to delete. |
getRule
Retrieves a rule from storage.Name | Type | Description |
---|---|---|
policyId | uint256 | The ID of the policy the rule belongs to. |
ruleId | uint256 | The ID of the rule to retrieve. |
Name | Type | Description |
---|---|---|
<none> | RuleStorageSet | ruleStorageSets The rule data. |
_storeRule
Stores a rule in storage. Validates the policy existence before storing the rule.Name | Type | Description |
---|---|---|
_data | RuleStorage | The rule storage structure. |
_policyId | uint256 | The ID of the policy the rule belongs to. |
_ruleId | uint256 | The ID of the rule to store. |
_rule | Rule | The rule to store. |
Name | Type | Description |
---|---|---|
<none> | uint256 | ruleId The stored rule ID. |