usePredictManagerAddress
CREATE2 the manager clone address before deploying — pre-flight UI flows.
@tokenops/sdk/fhe-vesting/advanced/react{ data, isLoading, error, refetch }Description
Compute the deterministic CREATE2 clone address the factory would deploy, at
the latest state or at blockNumber. Runs once token, userSalt and
deployer are set; blockNumber is optional.
Advanced surface. The registered factories pack a constant 0 into the
clone's block-number slot, so the prediction does not depend on the block.
It does depend on the deployer's fee settings, packed into the clone args
too, which can change before a deploy mines. A legacy factory (an address
override) that packs the deployment block is block-dependent; pass
blockNumber there, or to reproduce a past prediction.
For the "deploy a clone and learn its address" flow, prefer
useCreateManagerAndGetAddress on the headline React subpath: it reads the
address from the executed transaction's ManagerCreated event.
Signature
function usePredictManagerAddress(args?: UsePredictManagerAddressArgs): UseQueryResult<Address, Error>;Parameters
Shape of the options object passed to the hook itself.
| Property | Type | Description |
|---|---|---|
| token | Address | |
| userSalt | Hex | |
| deployer | Address | |
| blockNumber | bigint | Block to predict at. Omit it to predict at the latest state. |
| splitEnabled | boolean | |
| pausableEnabled | boolean | |
| publicClient | PublicClient | undefined | Override the viem PublicClient, bypassing the wagmi context. The one hook that takes it: a lookup at a past blockNumber may target an archive node the wagmi config does not carry. |
Example
import { usePredictManagerAddress } from "@tokenops/sdk/fhe-vesting/advanced/react";
const { data: predictedAddress } = usePredictManagerAddress({ token, userSalt, deployer });Pulled directly from the hook's TSDoc block — the same snippet your IDE shows on hover.