Trackers are persistent, on-chain variables defined within a policy. They allow you to store historical, cumulative, or computed values. Tracker values can be referenced and updated by rules in the policy. Trackers are great for scenarios like thresholds or quotas (e.g. “users can only mint X per day”), storing cumulative activity (e.g. total tokens sold, volume), and anything you want to track over time. There are 2 types of Trackers; standard Trackers that can store a single value and MappedTrackers that can store a value per key.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.
Tracker Schema
Each tracker consists of:- name: Unique identifier for the tracker
- type: Data type of the tracker value
- initialValue: Initial value(s) for the tracker
Validation Rules
namemust be unique within the policy’s Trackers arraytypemust be a supported tracker typeinitialValuemust match the specified type- String values are automatically trimmed of whitespace
Supported Tracker Types
- uint256 - Unsigned 256-bit integer
- address - Ethereum address
- bool - Boolean value (“true” / “false”)
- bytes - Bytes value (must use prefix “0x” e.g. “0x1234”)
- string - String value
- Array variants of the above types (uint256[], address[], bool[], bytes[], string[])
Type-Value Validation
- For single value types: initialValue must be a string
- For array types: initialValue must be an array of strings
- Values must be compatible with the specified type
Defining a Tracker
Standard Tracker
To add a new tracker to a policy, you’ll define:- Name (this will not be stored on-chain but is used to reference the tracker when using the SDK or the UI)
- Type
- Initial value: the tracker’s starting value.
Mapped Tracker
Mapped Tracker Schema
Each mapped tracker consists of:- name: Unique identifier for the mapped tracker
- keyType: Data type for the mapping keys
- valueType: Data type for the mapping values
- initialKeys: Array of initial keys for the mapping
- initialValues: Array of initial values corresponding to the keys
Mapped Tracker Validation Rules
namemust be unique within the policy’s MappedTrackers arraykeyTypemust be a supported tracker key typevalueTypemust be a supported tracker typeinitialKeysandinitialValuesarrays must have the same lengthinitialKeysmust contain unique values (no duplicates)- Each value in
initialValuesmust match the specified valueType - Each key in
initialKeysmust match the specified keyType
Supported Key Types
- uint256 - Unsigned 256-bit integer
- address - Ethereum address
- string - String value
- bool - Boolean value (“true” / “false”)
- bytes - Bytes value (must use prefix “0x” e.g. “0x1234”)
Supported Value Types
- Same as regular tracker types (including array variants)
Type-Value Validation for Mapped Trackers
- For single value types: each entry in initialValues must be a string
- For array value types: each entry in initialValues must be an array of strings
- All keys must be valid for the specified keyType
- All values must be valid for the specified valueType
- Name (this will not be stored on-chain but is used to reference the tracker when using the SDK or the UI)
- keyType the data type of the mapped tracker keys
- valueType the data type of the mapped tracker values
- initialKeys: the tracker’s initial keys.
- initialValues: the tracker’s initial values.