Documentation Index
Fetch the complete documentation index at: https://docs.forterulesengine.io/llms.txt
Use this file to discover all available pages before exploring further.
Git Source
Author:
@mpetersoCode55, @ShaneDuncan602, @TJ-Everett, @VoR0220
This library is a critical component of the Rules Engine, enabling modular and efficient storage management.
This library provides functions to access and manage storage positions for various components of the Rules Engine.
It defines fixed storage slots for initialized flags, foreign calls, trackers, calling functions, rules, policies,
and policy associations. These storage slots are used to ensure consistent and conflict-free storage management
across the diamond proxy pattern.
State Variables
DIAMOND_CUT_STORAGE_ENGINE_POS
bytes32 constant DIAMOND_CUT_STORAGE_ENGINE_POS = bytes32(uint256(keccak256("diamond-cut.storage-engine")) - 1);
INITIALIZED_POSITION
bytes32 constant INITIALIZED_POSITION = bytes32(uint256(keccak256("initialized-position")) - 1);
FOREIGN_CALL_POSITION
bytes32 constant FOREIGN_CALL_POSITION = bytes32(uint256(keccak256("foreign-call-position")) - 1);
PERMISSIONED_FOREIGN_CALL_POSITION
bytes32 constant PERMISSIONED_FOREIGN_CALL_POSITION =
bytes32(uint256(keccak256("permissioned-foreign-call-position")) - 1);
TRACKER_POSITION
bytes32 constant TRACKER_POSITION = bytes32(uint256(keccak256("tracker-position")) - 1);
CALLING_FUNCTION_POSITION
bytes32 constant CALLING_FUNCTION_POSITION = bytes32(uint256(keccak256("calling-function-position")) - 1);
RULE_POSITION
bytes32 constant RULE_POSITION = bytes32(uint256(keccak256("rule-position")) - 1);
POLICY_POSITION
bytes32 constant POLICY_POSITION = bytes32(uint256(keccak256("policy-position")) - 1);
POLICY_ASSOCIATION_POSITION
bytes32 constant POLICY_ASSOCIATION_POSITION = bytes32(uint256(keccak256("policy-association-position")) - 1);
bytes32 constant FOREIGN_CALL_METADATA_POSITION = bytes32(uint256(keccak256("foreign-call-metadata-position")) - 1);
bytes32 constant CALLING_FUNCTION_METADATA_POSITION =
bytes32(uint256(keccak256("calling-function-metadata-position")) - 1);
bytes32 constant TRACKER_METADATA_POSITION = bytes32(uint256(keccak256("tracker-metadata-position")) - 1);
bytes32 constant RULES_METADATA_POSITION = bytes32(uint256(keccak256("rules-metadata-position")) - 1);
bytes32 constant POLICY_METADATA_POSITION = bytes32(uint256(keccak256("policy-metadata-position")) - 1);
CALLING_CONTRACT_ADMIN_POSITION
bytes32 constant CALLING_CONTRACT_ADMIN_POSITION = bytes32(uint256(keccak256("calling-contract-admin-position")) - 1);
POLICY_ADMIN_POSITION
bytes32 constant POLICY_ADMIN_POSITION = bytes32(uint256(keccak256("policy-admin-position")) - 1);
Functions
_initializedStorage
Retrieves the storage for the initialized flag.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _initializedStorage() internal pure returns (InitializedStorage storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | InitializedStorage | The storage structure for the initialized flag. |
_getForeignCallStorage
Retrieves the storage for foreign calls.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getForeignCallStorage() internal pure returns (ForeignCallStorage storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | ForeignCallStorage | The storage structure for the foreign call map. |
_getPermissionedForeignCallStorage
Retrieves the storage for permissioned foreign calls.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getPermissionedForeignCallStorage() internal pure returns (PermissionedForeignCallStorage storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | PermissionedForeignCallStorage | The storage structure for the foreign call map. |
Retrieves the storage for foreign call metadata.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getForeignCallMetadataStorage() internal pure returns (ForeignCallMetadataMappingStruct storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | ForeignCallMetadataMappingStruct | The storage structure for the foreign call metadata map. |
_getTrackerStorage
Retrieves the storage for trackers.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getTrackerStorage() internal pure returns (TrackerStorage storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | TrackerStorage | The storage structure for the tracker map. |
Retrieves the storage for tracker metadata.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getTrackerMetadataStorage() internal pure returns (TrackerMetadataMappingStruct storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | TrackerMetadataMappingStruct | The storage structure for the tracker metadata map. |
_getCallingFunctionStorage
Retrieves the storage for calling functions.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getCallingFunctionStorage() internal pure returns (CallingFunctionStruct storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | CallingFunctionStruct | The storage structure for the calling function map. |
Retrieves the storage for calling function metadata.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getCallingFunctioneMetadataStorage() internal pure returns (CallingFunctionMetadataStruct storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | CallingFunctionMetadataStruct | The storage structure for the calling function metadata map. |
_getRuleStorage
Retrieves the storage for rules.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getRuleStorage() internal pure returns (RuleStorage storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | RuleStorage | The storage structure for the rule map. |
Retrieves the storage for rules metadata.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getRulesMetadataStorage() internal pure returns (RulesMetadataStruct storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | RulesMetadataStruct | The storage structure for the rules metadata map. |
_getPolicyStorage
Retrieves the storage for policies.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getPolicyStorage() internal pure returns (PolicyStorage storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | PolicyStorage | The storage structure for the policy map. |
Retrieves the storage for policy metadata.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getPolicyMetadataStorage() internal pure returns (PolicyMetadataStruct storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | PolicyMetadataStruct | The storage structure for the policy metadata map. |
_getPolicyAssociationStorage
Retrieves the storage for policy associations.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getPolicyAssociationStorage() internal pure returns (PolicyAssociationStorage storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | PolicyAssociationStorage | The storage structure for the policy association map. |
_getCallingContractAdminStorage
Retrieves the storage for calling contracts per admin.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getCallingContractAdminStorage() internal pure returns (CallingContractAdminStorage storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | CallingContractAdminStorage | the storage structure for the calling contracts per admin. |
_getPolicyAdminStorage
Retrieves the storage for policy admin.
Uses a fixed storage slot to avoid conflicts with other contracts.
function _getPolicyAdminStorage() internal pure returns (PolicyAdminStorage storage _ds);
Returns
| Name | Type | Description |
|---|
_ds | PolicyAdminStorage | The storage structure for the admin per policy. |