fhe-vesting/advanced
Classes
ConfidentialVestingFactoryAdvancedClient
Defined in: fhe-vesting/advanced/factory-advanced.ts:37
Advanced extension of ConfidentialVestingFactoryClient that re-exposes the CREATE2 address prediction read.
Why this is "advanced" surface. predictManagerAddress is
block-dependent on a live chain — the
factory packs the deployment block number into the clone's immutable args,
which feed into the CREATE2 init-code hash. Predict at block N, mine at
N+1, and the addresses differ. The vast majority of consumers want
createManager (rich-return, { hash, manager }) — the address is parsed
from the ManagerCreated event in the tx receipt with no block guessing.
Genuine use cases for the predict read:
- Historical lookups (verifying a clone deployed at a known past block).
- Tightly-coupled same-tx flash flows (rare).
For everything else, the headline factory's createManager is the right
entry point.
Example
import { createConfidentialVestingFactoryAdvancedClient } from "@tokenops/sdk/fhe-vesting/advanced";
const factory = createConfidentialVestingFactoryAdvancedClient({ publicClient });
const predicted = await factory.predictManagerAddress({
token, userSalt, deployer, blockNumber: 10_852_182n,
});
Extends
Constructors
Constructor
new ConfidentialVestingFactoryAdvancedClient(config): ConfidentialVestingFactoryAdvancedClient;
Defined in: fhe-vesting/factory.ts:127
Parameters
| Parameter | Type |
|---|---|
config | ConfidentialVestingFactoryClientConfig |
Returns
ConfidentialVestingFactoryAdvancedClient
Inherited from
ConfidentialVestingFactoryClient.constructor
Properties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
publicClient | readonly | { } | ConfidentialVestingFactoryClient.publicClient | fhe-vesting/factory.ts:122 |
walletClient? | readonly | ... | ... | ConfidentialVestingFactoryClient.walletClient | fhe-vesting/factory.ts:123 |
address | readonly | `0x${(...)}` | ConfidentialVestingFactoryClient.address | fhe-vesting/factory.ts:124 |
Methods
predictManagerAddress()
predictManagerAddress(args): Promise<...>;
Defined in: fhe-vesting/advanced/factory-advanced.ts:49
Compute the deterministic CREATE2 clone address as the factory would have
computed it at args.blockNumber.
Block-dependent. See class TSDoc — predict at block N, mine at N+1, the addresses differ.
For the common "deploy a clone and learn its address" flow, prefer the
headline factory.createManager, which parses the address from the tx
receipt's ManagerCreated event.
Parameters
| Parameter | Type |
|---|---|
args | PredictManagerArgs |
Returns
Promise<...>
createManager()
createManager(args): Promise<...>;
Defined in: fhe-vesting/factory.ts:185
Deploy a new ConfidentialVestingManager clone via the factory and return
its address, parsed from the ManagerCreated event in the tx receipt.
This is the headline factory entry point. It returns one rich-return
shape: the address is only knowable after the tx mines (the factory packs
block.number into the clone's immutable args), so a hash-only variant
would force consumers to re-derive what the SDK already had to compute.
Calls createManagerWithOptions when splitEnabled or pausableEnabled
is provided; otherwise calls the simpler createManager entry point.
Internally: writeContract → PublicClient.waitForTransactionReceipt →
parseEventLogs({ eventName: "ManagerCreated" }).
Pre-mine prediction is exposed only on
ConfidentialVestingFactoryAdvancedClient from
@tokenops/sdk/fhe-vesting/advanced — predict at block N, mine at N+1,
the addresses differ.
Parameters
| Parameter | Type |
|---|---|
args | CreateManagerArgs |
Returns
Promise<...>
Example
const { hash, manager } = await factory.createManager({
token: "0xYourToken",
userSalt: "0x0000000000000000000000000000000000000000000000000000000000000001",
});
Inherited from
ConfidentialVestingFactoryClient.createManager
createManagerAndGetAddress()
createManagerAndGetAddress(args): Promise<...>;
Defined in: fhe-vesting/factory.ts:218
Deploy a new manager clone and return its address, parsed from the
ManagerCreated event in the tx receipt.
This is the recommended entry point for the common "deploy a clone and use its address" flow. ConfidentialVestingFactoryClient.predictManagerAddress is unreliable on a live chain because the factory packs the deployment block number into the clone's immutable args — predict at block N, mine at N+1, and the addresses differ.
Internally: ConfidentialVestingFactoryClient.createManager →
PublicClient.waitForTransactionReceipt →
parseEventLogs({ eventName: "ManagerCreated" }).
Parameters
| Parameter | Type |
|---|---|
args | CreateManagerArgs |
Returns
Promise<...>
Example
const { hash, manager } = await factory.createManagerAndGetAddress({
token, userSalt,
});
Inherited from
ConfidentialVestingFactoryClient.createManagerAndGetAddress
setDefaultGasFee()
setDefaultGasFee(fee, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:227
Set the factory-wide default gas fee (in wei). Factory admin only.
Parameters
| Parameter | Type | Description |
|---|---|---|
fee | bigint | Fee in wei charged per claim on FeeType.Gas managers. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.setDefaultGasFee
setDefaultTokenFee()
setDefaultTokenFee(feeBps, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:239
Set the factory-wide default token fee in basis points. Factory admin only.
Parameters
| Parameter | Type | Description |
|---|---|---|
feeBps | bigint | Basis points (1 bps = 0.01 %). Deducted from the claimed token amount on FeeType.DistributionToken managers. |
account? | ... | ... | ... | - |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.setDefaultTokenFee
setDefaultFeeType()
setDefaultFeeType(feeType, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:246
Set the default fee model (FeeType.Gas or FeeType.DistributionToken) for new clones. Factory admin only.
Parameters
| Parameter | Type |
|---|---|
feeType | FeeType |
account? | ... | ... | ... |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.setDefaultFeeType
resetGasFee()
resetGasFee(account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:252
Parameters
| Parameter | Type |
|---|---|
account? | ... | ... | ... |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.resetGasFee
resetTokenFee()
resetTokenFee(account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:258
Parameters
| Parameter | Type |
|---|---|
account? | ... | ... | ... |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.resetTokenFee
setCustomFee()
setCustomFee(args, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:268
Set a per-creator fee override. The override takes precedence over the factory
defaults for all managers created by args.creator.
Parameters
| Parameter | Type |
|---|---|
args | { creator: ...; feeType: ...; gasFee: ...; tokenFee: ...; } |
args.creator | ... |
args.feeType? | ... |
args.gasFee? | ... |
args.tokenFee? | ... |
account? | ... | ... | ... |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.setCustomFee
disableCustomFee()
disableCustomFee(creator, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:281
Parameters
| Parameter | Type |
|---|---|
creator | `0x${(...)}` |
account? | ... | ... | ... |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.disableCustomFee
setFeeCollector()
setFeeCollector(newCollector, account?): Promise<...>;
Defined in: fhe-vesting/factory.ts:287
Parameters
| Parameter | Type |
|---|---|
newCollector | `0x${(...)}` |
account? | ... | ... | ... |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.setFeeCollector
implementation()
implementation(): Promise<...>;
Defined in: fhe-vesting/factory.ts:296
Current LibClone implementation address.
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.implementation
managerImplementation()
managerImplementation(): Promise<...>;
Defined in: fhe-vesting/factory.ts:310
Alias for ConfidentialVestingFactoryClient.implementation that matches
the contract's storage field name (_managerImplementation).
Named for clarity: server devs reading the Solidity reach for
factory.managerImplementation()
via autocomplete (the contract storage slot name) and hit a TS2551. The
canonical implementation() method is retained for backwards-compat and
cross-factory uniformity (fhe-airdrop exposes the same shape).
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.managerImplementation
defaultGasFee()
defaultGasFee(): Promise<...>;
Defined in: fhe-vesting/factory.ts:314
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.defaultGasFee
defaultTokenFee()
defaultTokenFee(): Promise<...>;
Defined in: fhe-vesting/factory.ts:318
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.defaultTokenFee
defaultFeeType()
defaultFeeType(): Promise<...>;
Defined in: fhe-vesting/factory.ts:322
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.defaultFeeType
feeCollector()
feeCollector(): Promise<...>;
Defined in: fhe-vesting/factory.ts:327
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.feeCollector
getCustomFee()
getCustomFee(creator): Promise<...>;
Defined in: fhe-vesting/factory.ts:331
Parameters
| Parameter | Type |
|---|---|
creator | `0x${(...)}` |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.getCustomFee
getInitCodeHash()
getInitCodeHash(args): Promise<...>;
Defined in: fhe-vesting/factory.ts:346
Parameters
| Parameter | Type |
|---|---|
args | { token: ...; deployer: ...; splitEnabled?: ...; pausableEnabled?: ...; } |
args.token | ... |
args.deployer | ... |
args.splitEnabled? | ... |
args.pausableEnabled? | ... |
Returns
Promise<...>
Inherited from
ConfidentialVestingFactoryClient.getInitCodeHash
Functions
createConfidentialVestingFactoryAdvancedClient()
function createConfidentialVestingFactoryAdvancedClient(config): ConfidentialVestingFactoryAdvancedClient;
Defined in: fhe-vesting/advanced/factory-advanced.ts:84
Create a ConfidentialVestingFactoryAdvancedClient. Mirrors viem's
create* convention.
Parameters
| Parameter | Type |
|---|---|
config | ConfidentialVestingFactoryClientConfig |
Returns
ConfidentialVestingFactoryAdvancedClient
Example
const factory = createConfidentialVestingFactoryAdvancedClient({ publicClient, walletClient });
const predicted = await factory.predictManagerAddress({ token, userSalt, deployer, blockNumber });