Functions
createForeignCall
Creates a foreign call and stores it in the contract’s storage. Builds a foreign call structure and maps it to the associated policy ID.Name | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the foreign call will be mapped to. |
_foreignCall | ForeignCall | The definition of the foreign call to create. |
foreignCallName | string |
Name | Type | Description |
---|---|---|
<none> | uint256 | The index of the created foreign call. |
updateForeignCall
Updates a foreign call in the contract’s storage.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the foreign call is associated with. |
foreignCallId | uint256 | The ID of the foreign call to update. |
foreignCall | ForeignCall | The updated foreign call structure. |
Name | Type | Description |
---|---|---|
fc | ForeignCall | The updated foreign call structure. |
deleteForeignCall
Deletes a foreign call from the contract’s storage.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the foreign call is associated with. |
foreignCallId | uint256 | The ID of the foreign call to delete. |
getAllForeignCalls
Retrieve Foreign Call Set from storageName | Type | Description |
---|---|---|
policyId | uint256 | the policy Id of the foreign call to retrieve |
Name | Type | Description |
---|---|---|
fc | ForeignCall[] | the foreign call set structure |
getForeignCall
Retrieves a foreign call from the contract’s storage.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID of the foreign call to retrieve. |
foreignCallId | uint256 | The ID of the foreign call to retrieve. |
Name | Type | Description |
---|---|---|
fc | ForeignCall | The foreign call structure. |
getForeignCallMetadata
retrieves the foreign call metadataName | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the foreign call is associated with. |
foreignCallId | uint256 | The identifier for the foreign call |
Name | Type | Description |
---|---|---|
fcMeta | string | the metadata for the foreign call |
_storeForeignCall
Stores a foreign call in the contract’s storage. Ensures the foreign call is properly set before storing it.Name | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the foreign call is associated with. |
_foreignCall | ForeignCall | The foreign call to store. |
_incrementForeignCallIndex
Helper function to increment the foreign call index Ensures the foreign call is properly set before storing it.Name | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the foreign call is associated with. |
_storeForeignCallData
Helper function to store the foreign call data Ensures the foreign call is properly set before storing it.Name | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the foreign call is associated with. |
_foreignCall | ForeignCall | The foreign call to store. |
_foreignCallIndex | uint256 | The index of the foreign call. |
_storeForeignCallMetadata
Helper function to store the foreign call metadataName | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the foreign call is associated with. |
_foreignCallIndex | uint256 | The index of the foreign call. |
_foreignCallName | string | The name of the foreign call. |
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 | Type | Description |
---|---|---|
<none> | uint256 | trackerIndex The index of the created tracker. |
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. |
deleteTracker
Deletes a tracker from the tracker storage mapping.Name | Type | Description |
---|---|---|
policyId | uint256 | The policy ID the tracker is associated with. |
trackerIndex | uint256 | The index of the tracker to delete. |
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. |
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 |
---|---|---|
trMeta | string | the metadata for the tracker |
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 |
---|---|---|
tracker | Trackers | The tracker data. |
_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. |
_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 |
_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 |
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> | uint256 | 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. |
callingFunctionID | uint256 | The ID of the calling function to update. |
functionSignature | bytes4 | The function signature of the calling function. |
pTypes | ParamTypes[] | The new parameter types to append. |
Name | Type | Description |
---|---|---|
<none> | uint256 | 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. |
callingFunctionId | uint256 | The ID 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. |
callingFunctionId | uint256 | The ID 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. |
callingFunctionId | uint256 | The identifier 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. |
_incrementFunctionId
Helper function to increment function IDName | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the calling function is associated with. |
_storeCallingFunctionData
Helper function to store calling function dataName | Type | Description |
---|---|---|
_policyId | uint256 | The policy ID the calling function is associated with. |
_functionId | uint256 | The ID of the function |
_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. |
_functionId | uint256 | The ID of the function |
_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. |