2.0 RC docsView 1.x docs
v2.0.0-rc.1 release candidate
The API is frozen and later candidates carry fixes only, except the receipt-free and Safe create surface of /fhe-airdrop, which is @beta. Published on the next dist-tag; latest stays on 1.6.0 until 2.0.0.
IntrospectionuseQuery

useFactoryRoleConstants

Read the factory's role identifiers in one fan-out.

Import
@tokenops/sdk/fhe-airdrop/advanced/react
Return
{ data, isLoading, error, refetch }
Lifecycle
Introspection

Description

Read the factory's role identifiers in one fan-out.

Every value is a bytecode constant, so this defaults to staleTime: Infinity (overridable through query). Feed the results into useFactoryHasRole, useFactoryRoleMembers and the three factory role mutations - hand-hashing keccak256("FEE_MANAGER_ROLE") client-side would turn a constant renamed in a future factory version into a grantRole that silently grants a role nothing checks.

Bundled rather than shipped as five one-liners: a role panel needs the whole palette to render at all. Paired with useFactoryRoleMembers it is also the live check FACTORY_ROLE_CONCENTRATION_NOTE asks for - read the five roles, list each one's holders, and see for yourself whether they sit on one key on the chain you are actually connected to, rather than trusting a fixed string about one deployment at one point in time.

Signature

@tokenops/sdk/fhe-airdrop/advanced/react
ts
function useFactoryRoleConstants(args?: UseFactoryRoleConstantsArgs): UseQueryResult<FactoryRoleConstants, Error>;
Want to run a similar shape interactively? The Playground ships 12 ready presets across vesting / airdrop / disperse / faucet — deploy a manager, create a vesting, claim, and run the product equivalents. The deep-link above auto-selects the closest preset to useFactoryRoleConstants; pick another from the dropdown if you'd rather start there.

Example

@tokenops/sdk/fhe-airdrop/advanced/react · @example
tsx
const { data: roles } = useFactoryRoleConstants();
const { data: feeManagers } = useFactoryRoleMembers({ role: roles?.FEE_MANAGER_ROLE });

Pulled directly from the hook's TSDoc block — the same snippet your IDE shows on hover.

See also

Other Introspection hooks in airdrop v2: