import type { Account, Address, Chain, Client, EncodeFunctionDataErrorType, Hash, Hex, Transport, WriteContractErrorType } from 'viem'; import type { Prettify, WriteTransactionParameters } from '../../../../types/index.js'; import { type ClientWithOverridesErrorType } from '../../../../utils/clientWithOverrides.js'; export type DeployVerifiableProxyWriteParametersParameters = { /** The factory contract address */ factoryAddress: Address; /** The implementation contract address */ implAddress: Address; /** * The initialization calldata. * If omitted, defaults to * `initialize([{ account: client.account.address, roleBitmap }])`. * * A `PermissionedResolver` proxy needs its own initializer (it takes a * trailing `bytes[] calls`), so pass explicit `callData` encoded with * `permissionedResolverInitializeSnippet` for those. */ callData?: Hex; /** * The role bitmap granted to the proxy admin when generating default * calldata. Ignored when `callData` is provided. Defaults to a bitmap * containing every role. */ roleBitmap?: bigint; /** * The salt for proxy deployment. * If omitted, a random 256-bit salt is drawn on every call, so each call * encodes a different deploy. Pass one when the same deploy has to be built * more than once (e.g. for a gas estimate and then the send). * * The factory derives the proxy address from `(msg.sender, salt)`, so an * account reusing a salt targets an address it already occupies and the * deploy reverts. */ salt?: bigint; }; export type DeployVerifiableProxyWriteParametersReturnType = ReturnType; export type DeployVerifiableProxyWriteParametersErrorType = EncodeFunctionDataErrorType; export declare const deployVerifiableProxyWriteParameters: (client: Client, { factoryAddress, implAddress, callData, roleBitmap, salt, }: DeployVerifiableProxyWriteParametersParameters) => { readonly address: `0x${string}`; readonly abi: readonly [{ readonly inputs: readonly [{ readonly name: "implementation"; readonly type: "address"; }, { readonly name: "salt"; readonly type: "uint256"; }, { readonly name: "data"; readonly type: "bytes"; }]; readonly name: "deployProxy"; readonly outputs: readonly [{ readonly name: ""; readonly type: "address"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }, { readonly inputs: readonly [{ readonly indexed: true; readonly name: "sender"; readonly type: "address"; }, { readonly indexed: true; readonly name: "proxyAddress"; readonly type: "address"; }, { readonly indexed: false; readonly name: "salt"; readonly type: "uint256"; }, { readonly indexed: false; readonly name: "implementation"; readonly type: "address"; }]; readonly name: "ProxyDeployed"; readonly anonymous: false; readonly type: "event"; }]; readonly functionName: "deployProxy"; readonly args: readonly [`0x${string}`, bigint, `0x${string}`]; readonly chain: chain; readonly account: Account; }; export type DeployVerifiableProxyParameters = Prettify>; export type DeployVerifiableProxyReturnType = Hash; export type DeployVerifiableProxyErrorType = DeployVerifiableProxyWriteParametersErrorType | ClientWithOverridesErrorType | WriteContractErrorType; /** * Deploys a verifiable proxy contract. * @param client - {@link Client} * @param options - {@link DeployVerifiableProxyParameters} * @returns Transaction hash. {@link DeployVerifiableProxyReturnType} * * @example * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * import { addEnsContracts } from '@ensdomains/ensjs' * import { deployVerifiableProxy } from '@ensdomains/ensjs/wallet/v2' * * const [account] = await window.ethereum.request({ method: 'eth_requestAccounts' }) * const wallet = createWalletClient({ * account, * chain: addEnsContracts(mainnet), * transport: custom(window.ethereum), * }) * const hash = await deployVerifiableProxy(wallet, { * factoryAddress: '0x24e32c34effb021cc360b6a4e1de2850dcc59956', * implAddress: '0xc3ae19b222d527d3cdda617953ab878a35527e54', * }) * // 0x... */ export declare function deployVerifiableProxy(client: Client, { factoryAddress, implAddress, callData, roleBitmap, salt, ...txArgs }: DeployVerifiableProxyParameters): Promise; //# sourceMappingURL=deployVerifiableProxy.d.ts.map