Roles · RBACuseQuery

useAirdropHasRole

Read AccessControl: is account a member of role on this airdrop clone? The role hashes are stable across deployments (DEFAULT_ADMIN_ROLE, FEE_COLLECTOR_ROLE, etc.).

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

Description

Read AccessControl: is account a member of role on this airdrop clone?

The role hashes are stable across deployments (DEFAULT_ADMIN_ROLE, FEE_COLLECTOR_ROLE, etc.).

Signature

@tokenops/sdk/fhe-airdrop/react
ts
function useAirdropHasRole(args: UseAirdropHasRoleArgs): UseQueryResult<boolean, Error>;

Parameters

Shape of the options object passed to the hook itself.

PropertyTypeDescription
roleHex
accountAddress
Want to run a similar shape interactively? The Playground ships 8 ready presets across vesting / airdrop / disperse — deploy a manager, create a vesting, claim, and the airdrop / disperse equivalents. The deep-link above auto-selects the closest preset to useAirdropHasRole; pick another from the dropdown if you'd rather start there.

Example

components/useAirdropHasRoleExample.tsx
tsx
"use client";
import { useAirdropHasRole } from "@tokenops/sdk/fhe-airdrop/react";

export function Example() {
  const { data, isLoading } = useAirdropHasRole(/* args */);

  if (isLoading) return "loading…";
  return <pre>{JSON.stringify(data, null, 2)}</pre>;
}

Auto-generated from the hook's shape (the SDK doesn't carry a TSDoc @example here yet).

See also

Other Roles · RBAC hooks in airdrop: