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 Curated

usePredictManagerAddress

CREATE2 the manager clone address before deploying — pre-flight UI flows.

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

Description

Compute the deterministic CREATE2 clone address as the factory would have computed it at blockNumber.

Advanced surface — block-dependent. The factory packs the deployment block number into the clone's immutable args, which feed into keccak256(initCode). Predict at block N and mine at N+1 and you get different addresses. This hook is only useful for: - Historical lookups (verifying a clone deployed at a known past block). - Tightly-coupled same-tx flows (rare).

For the common "deploy a clone and learn its address" flow, prefer `useCreateManagerAndGetAddress` on the headline React subpath — it parses the address out of the ManagerCreated event in the tx receipt without any block-number guessing.

Signature

@tokenops/sdk/fhe-vesting/advanced/react
ts
function usePredictManagerAddress(args?: UsePredictManagerAddressArgs): UseQueryResult<Address, Error>;

Parameters

Shape of the options object passed to the hook itself.

PropertyTypeDescription
tokenAddress
userSaltHex
deployerAddress
blockNumberbigint
splitEnabledboolean
pausableEnabledboolean
publicClientPublicClient | undefinedOverride the viem PublicClient, bypassing the wagmi context. The one hook that takes it: a historical lookup may target an archive node the wagmi config does not carry.
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 usePredictManagerAddress; pick another from the dropdown if you'd rather start there.

Example

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

// Historical lookup
const { data: predictedAddress } = usePredictManagerAddress({
  token, userSalt, deployer, blockNumber: 10_852_182n,
});

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

See also