IntrospectionuseQueryencrypts input Curated

usePredictAirdropAddress

CREATE2 the airdrop clone address before deploying.

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

Description

Compute the deterministic CREATE2 address the factory would produce for an airdrop clone without deploying it.

Advanced surface. This hook lives on the advanced subpath because the common "deploy and learn the address" flow is better served by useCreateConfidentialAirdropAndGetAddress on the headline React subpath — which parses the address from the ConfidentialAirdropCreated event and never has to guess the gasFee that was active at deploy time.

The hook is disabled until all four of params, userSalt, deployer, and gasFee are set.

Signature

@tokenops/sdk/fhe-airdrop/advanced/react
ts
function usePredictAirdropAddress(args?: UsePredictAirdropAddressArgs): UseQueryResult<Address, Error>;

Parameters

Shape of the options object passed to the hook itself.

PropertyTypeDescription
paramsAirdropParams
userSaltHex
deployerAddress
gasFeebigintGas fee in wei to embed into the CREATE2 salt computation. Must match the fee that will be (or was) active for deployer at deploy time: custom fee if getCustomFee(deployer).enabled, otherwise defaultGasFee. Passing the wrong value produces a different address than the deployed clone — use useAirdropFactoryCustomFee and useAirdropFactoryDefaultGasFee from the headline `
addressAddress | undefinedOverride the on-chain factory address. Defaults to {
chainIdnumber | undefinedOverride the chain id used for default address resolution. Defaults to usePublicClient().chain?.id.
publicClientPublicClient | undefinedOverride the viem PublicClient — bypasses the wagmi context.
encryptorEncryptorSourceLazy or eager encryptor source. Not required for predict reads, accepted for client-construction symmetry.
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 usePredictAirdropAddress; pick another from the dropdown if you'd rather start there.

Example

@tokenops/sdk/fhe-airdrop/advanced/react · @example
tsx
import { usePredictAirdropAddress } from "@tokenops/sdk/fhe-airdrop/advanced/react";

const { data: predictedAddress } = usePredictAirdropAddress({
  params, userSalt, deployer, gasFee: defaultGasFee,
});

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

See also