Functions
createTracker
Adds a tracker to the tracker storage mapping. Creates a new tracker and associates it with the specified policy ID.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the tracker is associated with. |
tracker | Trackers | The tracker to add. |
trackerName | string | Name of the tracker |
arrayType | TrackerArrayTypes |
Name | Type | Description |
---|---|---|
<none> | uint256 | trackerIndex The index of the created tracker. |
createMappedTracker
Adds a mapped tracker to tracker storage. Creates a new tracker and associates it with the specified policy ID and assigns the tracker to addresses.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the tracker is associated with. |
tracker | Trackers | The tracker to add. |
trackerName | string | Names of the trackers |
trackerKeys | bytes[] | |
trackerValues | bytes[] | |
arrayType | TrackerArrayTypes |
Name | Type | Description |
---|---|---|
<none> | uint256 | trackerIndex The index of the created tracker. |
_validateTrackerType
_validateCallingFunctionPType
_incrementTrackerIndex
Helper function to increment tracker indexName | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the tracker is associated with. |
_storeTrackerData
Helper function to store tracker dataName | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the tracker is associated with. |
_trackerIndex | uint256 | The index of the tracker to store |
_tracker | Trackers | The tracker to store. |
_trackerKey | bytes | The key for the tracker mapping. |
_trackerValue | bytes | The value for the tracker mapping. |
_storeTrackerMetadata
Helper function to store tracker metadataName | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the tracker is associated with. |
_trackerIndex | uint256 | The index of the tracker |
_trackerName | string | Name of the tracker |
initialValue | bytes | |
arrayType | TrackerArrayTypes |
_storeMappedTrackerMetadata
_storeTracker
Stores a tracker in the tracker storage mapping. Sets the tracker data and marks it as active.Name | Type | Description |
---|---|---|
_data | TrackerStorage | The tracker storage structure. |
_policyId | uint256 | The policy ID the tracker is associated with. |
_trackerIndex | uint256 | The index of the tracker to store. |
_tracker | Trackers | The tracker data to store. |
_storeTrackerMapping
Stores mapping data in the tracker storage mapping. Sets the tracker mapped bool to active.Name | Type | Description |
---|---|---|
_data | TrackerStorage | The tracker storage structure. |
_policyId | uint256 | The policy ID the tracker is associated with. |
_trackerIndex | uint256 | The index of the tracker to store. |
_tracker | Trackers | The tracker data to store. |
_trackerKey | bytes | The keys for the tracker mapping. |
_trackerValue | bytes | The values for the tracker mapping. |
_storeTrackerData
Helper function to store tracker dataName | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the tracker is associated with. |
_trackerIndex | uint256 | The index of the tracker to store |
_tracker | Trackers |
getTrackerMetadata
retrieves the tracker metadataName | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the tracker is associated with. |
trackerId | uint256 | The identifier for the tracker |
Name | Type | Description |
---|---|---|
<none> | TrackerMetadataStruct | the metadata for the tracker |
getAllTrackers
Retrieves all trackers associated with a specific policy ID.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the trackers are associated with. |
Name | Type | Description |
---|---|---|
<none> | Trackers[] | trackers An array of tracker data. |
getTracker
Retrieves a tracker from the tracker storage mapping.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the tracker is associated with. |
index | uint256 | The index of the tracker to retrieve. |
Name | Type | Description |
---|---|---|
<none> | Trackers | The tracker data. |
getTrackerToRuleIds
Retrieves the rule IDs associated with a specific tracker index for a given policy ID.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the tracker is associated with. |
trackerIndex | uint256 | The index of the tracker to retrieve rule IDs for. |
Name | Type | Description |
---|---|---|
<none> | uint256[] | An array of rule IDs associated with the specified tracker index. |
getMappedTrackerValue
Retrieves a tracker from the tracker storage mapping.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the tracker is associated with. |
index | uint256 | The index of the tracker to retrieve. |
trackerKey | bytes |
Name | Type | Description |
---|---|---|
<none> | bytes | tracker The tracker data. |
updateTracker
Updates an existing tracker in the tracker storage mapping. Modifies the tracker associated with the specified policy ID and tracker index.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the tracker is associated with. |
trackerIndex | uint256 | The index of the tracker to update. |
tracker | Trackers | The updated tracker data. |
updateTracker
Updates an existing tracker in the tracker storage mapping. Modifies the tracker associated with the specified policy ID and tracker index.Name | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the tracker is associated with. |
_trackerIndex | uint256 | The index of the tracker to update. |
_tracker | Trackers | The updated tracker data. |
_trackerKey | bytes | The keys for the tracker mapping. |
_trackerValue | bytes | The values for the tracker mapping. |
deleteTracker
Tracker mappings are not deleted, since trackerIds are not reused that data will never clash with new trackers. Helper function to store tracker dataName | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the tracker is associated with. |
trackerIndex | uint256 | The index of the tracker to store |
createCallingFunction
Creates a new calling function and stores it in the calling function storage mapping. Associates the calling function with the specified policy ID and parameter types.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the calling function is associated with. |
functionSignature | bytes4 | The function signature of the calling function. |
pTypes | ParamTypes[] | The parameter types for the calling function. |
callingFunctionName | string | the name of the calling function (to be stored in metadata) |
encodedValues | string | the string representation of the values encoded with the calling function (to be stored in metadata) |
Name | Type | Description |
---|---|---|
<none> | bytes4 | functionId The index of the created calling function. |
updateCallingFunction
Updates an existing calling function by appending new parameter types. Ensures that the new parameter types are compatible with the existing ones.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the calling function is associated with. |
functionSignature | bytes4 | The function signature of the calling function. |
pTypes | ParamTypes[] | The new parameter types to append. |
Name | Type | Description |
---|---|---|
<none> | bytes4 | functionId The updated calling function ID. |
deleteCallingFunction
Deletes a calling function from storage. Removes the calling function and its associated rules and mappings.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the calling function is associated with. |
sig | bytes4 | The selector of the calling function to delete. |
getCallingFunction
Retrieves a calling function from storage.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the calling function is associated with. |
sig | bytes4 | The selector of the calling function to retrieve. |
Name | Type | Description |
---|---|---|
<none> | CallingFunctionStorageSet | CallngFunctionStorageSet The calling function data. |
getCallingFunctionMetadata
retrieves the calling function metadataName | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the calling function is associated with. |
sig | bytes4 | The selector for the calling function |
Name | Type | Description |
---|---|---|
<none> | CallingFunctionHashMapping | the metadata for the calling function |
getAllCallingFunctions
Retrieves all calling functions associated with a specific policy ID.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the calling functions are associated with. |
Name | Type | Description |
---|---|---|
<none> | CallingFunctionStorageSet[] | CallingFunctionStorageSet An array of calling function data. |
_storeCallingFunctionData
Helper function to store calling function dataName | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the calling function is associated with. |
_functionSignature | bytes4 | The function signature of the calling function |
_pTypes | ParamTypes[] | The parameter types for the calling function. |
_storeCallingFunctionMetadata
Helper function to store calling function metadataName | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the calling function is associated with. |
_functionSignature | bytes4 | The function signature of the calling function |
_callingFunctionName | string | Name of the calling function |
_encodedValues | string | Arguments to be encoded |
addClosedPolicySubscriber
Adds an address to the subscriber list of a specified policy. Only callable by a policy admin. The policy must not be cemented.Name | Type | Description |
---|---|---|
policyId | uint256 | The ID of the policy. |
subscriber | address | The address to add to the policy subscription. |
removeClosedPolicySubscriber
Removes an address from the subscriber list of a specified policy. Only callable by a policy admin. The policy must not be cemented.Name | Type | Description |
---|---|---|
policyId | uint256 | The ID of the policy. |
subscriber | address | The address to remove from the policy subscription. |
isClosedPolicySubscriber
Checks if an address is a subscriber of the specified policy.Name | Type | Description |
---|---|---|
policyId | uint256 | The ID of the policy. |
subscriber | address | The address to check for policy subscription. |
Name | Type | Description |
---|---|---|
<none> | bool | bool True if the address is a subscriber, false otherwise. |
_notCemented
Checks that a policy is not cemented.Name | Type | Description |
---|---|---|
_policyId | uint256 | The ID of the policy. |
_policyAdminOnly
Checks that the caller is a policy adminName | Type | Description |
---|---|---|
_policyId | uint256 | The ID of the policy. |
_address | address | The address to check for policy admin status. |