useFactoryRoleMembers
List who holds role on the factory, with the member count.
@tokenops/sdk/fhe-airdrop/advanced/react{ data, isLoading, error, refetch }Description
List who holds role on the factory, with the member count.
This is the live half of the role-concentration check
FACTORY_ROLE_CONCENTRATION_NOTE prescribes: run it over the five roles from
useFactoryRoleConstants and compare the holder sets, instead of
trusting a fixed string that describes one deployment at one moment.
count is bundled with the list rather than split into its own hook because
it is what a UI needs in the same render to decide whether a revoke will be
accepted: the factory floors DEFAULT_ADMIN_ROLE at one live
member, so revoking or renouncing the last holder reverts LastAdmin.
Disable the button at count === 1n rather than letting the user burn gas
discovering it.
Unpaginated: factory role sets are operator-sized, not user-sized.
Signature
function useFactoryRoleMembers(args?: UseFactoryRoleMembersArgs): UseQueryResult<FactoryRoleMembership, Error>;Parameters
Shape of the options object passed to the hook itself.
| Property | Type | Description |
|---|---|---|
| role | Hex | The role whose members to list - from { |
Example
const { data } = useFactoryRoleMembers({ role: roles?.DEFAULT_ADMIN_ROLE });
const lastAdmin = data?.count === 1n; // revoke/renounce would revert LastAdminPulled directly from the hook's TSDoc block — the same snippet your IDE shows on hover.
See also
Other Read hooks in airdrop v2:
useFactoryComplianceDelegateThe platform-designated compliance delegate the FACTORY wires into every new compliance-manager clone.useFactoryCompliancePolicyThe admin's per-creator compliance view: the stored override AND the value the factory resolves for that creator.useFactoryCustomFeeRead one creator's per-claim fee override.useFactoryImplementationsRead all three of the factory's implementation pointers in one round trip - the row an admin panel shows together, so they are bundled rather than shipped as three one-line hooks over three parallel eth_calls.