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 | The name of the foreign call |
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 |
---|---|---|
<none> | 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 |
---|---|---|
<none> | 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 |
---|---|---|
<none> | 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. |
_foreignCallIndex | uint256 |
_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. |
_isForeignCallPermissioned
Checks if the foreign call is permissioned and if the caller is authorized.Name | Type | Description |
---|---|---|
_foriegnCallAddress | address | The address of the foreign call contract. |
_functionSignature | bytes4 | The function signature of the foreign call. |
addAdminToPermissionList
Adds an admin to the permission list for a foreign call. This function can only be called by an existing foreign call admin.Name | Type | Description |
---|---|---|
foriegnCallAddress | address | The address of the foreign call contract. |
policyAdminsToAdd | address | The address of the admin to add to the permission list. |
selector | bytes4 | The function selector of the foreign call to add the admin to. |
updatePermissionList
Updates the permission list for a foreign call. This function can only be called by an existing foreign call admin.Name | Type | Description |
---|---|---|
foriegnCallAddress | address | The address of the foreign call contract. |
selector | bytes4 | The function selector of the foreign call to update the permission list for. |
policyAdminsToAdd | address[] | The addresses of the admins to add to the permission list. |
getForeignCallPermissionList
Retrieves the permission list for a foreign call.Name | Type | Description |
---|---|---|
foriegnCallAddress | address | The address of the foreign call contract. |
selector | bytes4 | The function selector of the foreign call to retrieve the permission list for. |
Name | Type | Description |
---|---|---|
<none> | address[] | An array of addresses that are permissioned for the foreign call. |
removeAllFromPermissionList
Removes all addresses from the permission list for a foreign call. This function resets the permission list to only include the foreign call admin. This function can only be called by an existing foreign call admin.Name | Type | Description |
---|---|---|
foriegnCallAddress | address | The address of the foreign call contract. |
selector | bytes4 | The function selector of the foreign call to remove all permissions from. |
removeFromPermissionList
Removes a specific address from the permission list for a foreign call. This function can only be called by an existing foreign call admin.Name | Type | Description |
---|---|---|
_foriegnCallAddress | address | The address of the foreign call contract. |
_selector | bytes4 | The function selector of the foreign call to remove the address from. |
policyAdminToRemove | address | The address of the admin to remove from the permission list. |
removeForeignCallPermissions
Removes foreign call permissions from the contract address and selector pair. This function can only be called by an existing foreign call admin.Name | Type | Description |
---|---|---|
_foriegnCallAddress | address | The address of the foreign call contract. |
_selector | bytes4 | The function selector of the foreign call to remove permissions for. |
getAllPermissionedFCs
Retrieves all permissioned foreign calls.Name | Type | Description |
---|---|---|
<none> | PermissionedForeignCallStorage | The PermissionedForeignCallStorage structure containing all permissioned foreign calls. |
_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. |
_foreignCallAdminOnly
Checks that the caller is a policy adminName | Type | Description |
---|---|---|
_foreignCallAddr | address | The ID of the foreign call. |
_address | address | The address to check for policy admin status. |
_functionSelector | bytes4 | The function selector to check for policy admin status. |
_validateForeignCall
Validates a foreign call.Name | Type | Description |
---|---|---|
_foreignCall | ForeignCall | The foreign call to validate. |
_validateParamType
Validates a paramType.Name | Type | Description |
---|---|---|
paramType | ParamTypes | The paramType to validate. |