useIsAirdrop
Ask the canonical factory whether it created candidate - the genuineness check.
@tokenops/sdk/fhe-airdrop/react{ data, isLoading, error, refetch }Description
Ask the canonical factory whether it created candidate - the genuineness
check.
Run this before trusting an address a user pasted, a link carried, or an indexer returned. A look-alike instance with the same ABI, the same events and a pool the attacker controls is cheap to deploy, and nothing readable at the instance tells it apart. A claim against one succeeds and delivers nothing.
The factory this asks is the one resolved from src/core/addresses.ts for
the connected chain, which is what makes the answer worth anything: an
instance that names its own factory names a fake one.
Only a `true` is cached. The registry is append-only, so a true can
never become false and is safe to hold forever. A false is not stable:
the address can be created later by another tab, another service, or the
headless client, none of which reaches this hook's invalidations - so caching
it would serve a stale false negative indefinitely and, for a security check,
in the direction that blocks a legitimate claim. Negative answers therefore
stay fresh and refetch normally. Override either with query.staleTime.
The `address` override is the trust root. Like every factory hook this
accepts address, and useMemoAirdropFactoryClient prefers it over
src/core/addresses.ts. That is what makes the hook usable on a local chain,
but it also means an attacker-supplied factory address would answer true
for its own look-alike. Pass address only from a source you trust at least
as much as the registry; when in doubt, omit it.
Signature
function useIsAirdrop(args?: UseIsAirdropArgs): UseQueryResult<boolean, Error>;Parameters
Shape of the options object passed to the hook itself.
| Property | Type | Description |
|---|---|---|
| candidate | Address | The address to check against the factory's registry. |
Example
const { data: genuine } = useIsAirdrop({ candidate: fromUrl });
if (genuine === false) return <Warning address={fromUrl} />;Pulled directly from the hook's TSDoc block — the same snippet your IDE shows on hover.
See also
Other Read hooks in airdrop v2:
useAirdropTokenRead the ERC-7984 token an airdrop instance distributes.useAirdropWindowRead an airdrop instance's claim-window snapshot in one round trip.useAirdropGasFeeRead the per-claim ETH fee (wei) an instance charges; 0n on a fee-free campaign.useMerkleRootRead a MerkleConfidentialAirdrop instance's currently published root.