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
name
must be unique within the policy’s Trackers arraytype
must be a supported tracker typeinitialValue
must 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
name
must be unique within the policy’s MappedTrackers arraykeyType
must be a supported tracker key typevalueType
must be a supported tracker typeinitialKeys
andinitialValues
arrays must have the same lengthinitialKeys
must contain unique values (no duplicates)- Each value in
initialValues
must match the specified valueType - Each key in
initialKeys
must 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.
Reading from a Tracker
Once defined, you can reference any tracker in any expression in the policy. For example, you can use a tracker in a rule’s condition expression, or use a tracker in a tracker’s update expression (its own or another’s).Updating a Tracker
Trackers are updated by using the update tracker effect in a rule. When using this effect, you’ll provide the name of the tracker and the update expression. Updating a mapped tracker requires the name of the tracker, the key, and the update expression. For full details on how to use trackers in your policy, see our Trackers Guide.Be mindful of the ordering of your rules that use and update trackers. Trackers are updated as
rule effects, so the new value is only visible in later rules—not the one that triggered the
update. Also, if multiple rules update the same tracker, make sure it’s deliberate.