import { GasValue } from '../token-registry-functions/types.js'; import { CHAIN_ID } from '../utils/supportedChains/index.js'; import { ContractReceipt, ContractTransaction as ContractTransaction$1, Signer } from 'ethers'; import { ContractTransactionReceipt, ContractTransactionResponse, Signer as Signer$1 } from 'ethersV6'; import '../utils/gasStation/index.js'; import '../utils/network/index.js'; /** * Token Registry Deployment Module * * This module provides functionality to deploy TradeTrust Token Registry contracts * with support for both ethers v5 and v6 signers. It handles two deployment modes: * * 1. **Quick-start mode** (default): Uses a pre-deployed deployer contract and implementation * - Faster deployment with lower gas costs * - Requires network to have deployer and implementation contracts * * 2. **Standalone mode**: Deploys a fresh Token Registry contract from scratch * - Works on any network with a supported Title Escrow Factory * - Higher gas costs but more flexible */ /** * Union type for transaction receipts from both ethers v5 and v6 */ type ContractTransaction = ContractTransaction$1 | ContractTransactionResponse; type TransactionReceipt = ContractReceipt | ContractTransactionReceipt | ContractTransaction; /** * Configuration options for Token Registry deployment */ interface DeployOptions { chainId?: CHAIN_ID; maxFeePerGas?: GasValue; maxPriorityFeePerGas?: GasValue; standalone?: boolean; factoryAddress?: string; tokenRegistryImplAddress?: string; deployerContractAddress?: string; } /** * Deploys a new Token Registry contract with automatic mode selection. * * **Deployment Modes:** * - **Quick-start** (default): Uses pre-deployed contracts for faster, cheaper deployment * - **Standalone**: Deploys fresh contract when quick-start is unavailable * * **Ethers Compatibility:** * - Automatically detects and handles both ethers v5 and v6 signers * - Returns appropriate receipt type based on signer version * @param {string} registryName - The name of the token registry (e.g., "My Token Registry") * @param {string} registrySymbol - The symbol of the token registry (e.g., "MTR") * @param {SignerV5 | SignerV6} signer - Signer instance that authorizes the deployment * @param {DeployOptions} options - Configuration options for deployment * @returns {Promise} Transaction receipt with deployed contract address * @throws {Error} If network is not supported and no custom addresses provided * @throws {Error} If Title Escrow Factory is not supported (standalone mode) * @throws {Error} If deployment transaction fails * @example * ```typescript * // Quick-start deployment * const receipt = await deployTokenRegistry( * "My Registry", * "MTR", * signer, * { chainId: CHAIN_ID.SEPOLIA } * ); * * // Standalone deployment with custom factory * const receipt = await deployTokenRegistry( * "My Registry", * "MYR", * signer, * { * standalone: true, * factoryAddress: "0x..." * } * ); * ``` */ declare const deployTokenRegistry: (registryName: string, registrySymbol: string, signer: Signer | Signer$1, options?: DeployOptions) => Promise; export { type DeployOptions, type TransactionReceipt, deployTokenRegistry };