Reader
Git Source (opens in a new tab)
Utility contract: implements multicall like batch reading functionality
Multicall src: https://github.com/mds1/multicall (opens in a new tab)
Functions forgo validation assuming correct off-chain inputs are used
State Variables
COORDINATOR
Coordinator
Coordinator
used over EIP712Coordinator
since no EIP-712 functionality consumed
Coordinator private immutable COORDINATOR;
Functions
constructor
Initializes new Reader
constructor(Registry registry);
Parameters
Name | Type | Description |
---|---|---|
registry | Registry | registry contract |
readSubscriptionBatch
Reads Subscription
(s) from Coordinator
in batch
Does not validate that subscriptions between startId
and endId
exist
Does not validate that startId
is at least 0
Does not validate that endId
is greater than startId
function readSubscriptionBatch(uint32 startId, uint32 endId) external view returns (Subscription[] memory);
Parameters
Name | Type | Description |
---|---|---|
startId | uint32 | start subscription ID (inclusive) |
endId | uint32 | end subscription ID (exclusive) |
Returns
Name | Type | Description |
---|---|---|
<none> | Subscription[] | Subscription (s) |
readRedundancyCountBatch
Given Subscription
ids and intervals, collects redundancy count of (subscription, interval)-pair
By default, if a (subscription ID, interval)-pair does not exist, function will return redundancyCount == 0
Does not validate ids.length == intervals.length
function readRedundancyCountBatch(uint32[] calldata ids, uint32[] calldata intervals)
external
view
returns (uint16[] memory);
Parameters
Name | Type | Description |
---|---|---|
ids | uint32[] | array of subscription IDs |
intervals | uint32[] | array of intervals to check where each ids[idx] corresponds to intervals[idx] |
Returns
Name | Type | Description |
---|---|---|
<none> | uint16[] | array of redundancy counts for (subscription ID, interval)-pairs |