IntrospectionuseQueryencrypts input Curated
usePredictAirdropAddress
CREATE2 the airdrop clone address before deploying.
Import
@tokenops/sdk/fhe-airdrop/advanced/reactReturn
{ data, isLoading, error, refetch }Lifecycle
IntrospectionDescription
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.
| Property | Type | Description |
|---|---|---|
| params | AirdropParams | |
| userSalt | Hex | |
| deployer | Address | |
| gasFee | bigint | Gas 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 ` |
| address | Address | undefined | Override the on-chain factory address. Defaults to { |
| chainId | number | undefined | Override the chain id used for default address resolution. Defaults to usePublicClient().chain?.id. |
| publicClient | PublicClient | undefined | Override the viem PublicClient — bypasses the wagmi context. |
| encryptor | EncryptorSource | Lazy or eager encryptor source. Not required for predict reads, accepted for client-construction symmetry. |
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.