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 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
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 | |
| splitEnabled | boolean | |
| pausableEnabled | boolean | |
| 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. |
Example
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.