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

useComplianceRoleConstants

Read a compliance-manager clone's role identifiers.

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

Description

Read a compliance-manager clone's role identifiers. address is the CLONE.

Both values are bytecode constants, so this is cacheable indefinitely (staleTime: Infinity by default, overridable through query). Feed them into useComplianceHasRole, useComplianceRoleMembers and the role mutations rather than hand-hashing keccak256("DELEGATION_ADMIN_ROLE") client-side, which would turn a constant renamed in a future contract version into a grant of a role nothing checks.

Bundled despite being only two reads, so the shape matches useAirdropRoleConstants and the factory equivalent - and because two one-line hooks for two constants is the pattern this subpath avoids.

Signature

@tokenops/sdk/fhe-airdrop/react
ts
function useComplianceRoleConstants(args: UseComplianceRoleConstantsArgs): UseQueryResult<ComplianceRoleConstants, 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 useComplianceRoleConstants; pick another from the dropdown if you'd rather start there.

Example

@tokenops/sdk/fhe-airdrop/react · @example
tsx
const { data: roles } = useComplianceRoleConstants({ address: managerAddress });
const { data: canDelegate } = useComplianceHasRole({
  address: managerAddress,
  role: roles?.DELEGATION_ADMIN_ROLE,
  holder: account,
});

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

See also

Other Introspection hooks in airdrop v2: