import { type ContractFunctionArgs, type Hex } from "viem"; import { BASE_CHAIN_ID } from "./chains.js"; import type { EvmAddress, HexBytes } from "./evm.js"; import { goalFactoryAbi } from "./protocol-abis.js"; import { type ProtocolExecutionPlan } from "./protocol-plans.js"; import { type ProtocolNetwork } from "./protocol-addresses.js"; export declare const GOAL_FACTORY_DEPLOY_REQUIRED_KEYS: readonly ["revnet", "timing", "success", "flowMetadata", "underwriting", "budgetTCR", "goalSpendPolicy"]; export declare const GOAL_FACTORY_DEPLOY_OPTIONAL_KEYS: readonly ["preset", "managedSafe", "managedBudgetGatePolicy", "funding"]; declare const GOAL_PRESET_VALUES: { readonly open: 0; readonly managed: 1; }; type GoalFactoryDeployParamsRecord = Record; type GoalPresetValue = (typeof GOAL_PRESET_VALUES)[keyof typeof GOAL_PRESET_VALUES]; type GoalFactoryOpenGoalContractParams = ContractFunctionArgs[0]; type GoalFactoryManagedGoalContractParams = ContractFunctionArgs[0]; export type GoalFactoryDeployParams = { preset: GoalPresetValue; managedSafe: EvmAddress; managedBudgetGatePolicy: EvmAddress; funding: { paymentToken: EvmAddress; paymentRevnetId: bigint; }; revnet: { name: string; ticker: string; uri: string; initialIssuance: bigint; cashOutTaxRate: number; reservedPercent: number; durationSeconds: number; }; timing: { minRaise: bigint; minRaiseDurationSeconds: number; }; success: { successResolver: EvmAddress; successAssertionLiveness: bigint; successAssertionBond: bigint; successOracleSpecHash: HexBytes; successAssertionPolicyHash: HexBytes; }; flowMetadata: { title: string; description: string; image: string; tagline: string; url: string; }; underwriting: { budgetPremiumPpm: number; budgetSlashPpm: number; }; budgetTCR: { allocationMechanismAdmin: EvmAddress; invalidRoundRewardsSink: EvmAddress; submissionDepositStrategy: EvmAddress; submissionBaseDeposit: bigint; removalBaseDeposit: bigint; submissionChallengeBaseDeposit: bigint; removalChallengeBaseDeposit: bigint; registrationMetaEvidence: string; clearingMetaEvidence: string; challengePeriodDuration: bigint; arbitratorExtraData: HexBytes; budgetBounds: { minFundingLeadTime: bigint; maxFundingHorizon: bigint; minExecutionDuration: bigint; maxExecutionDuration: bigint; minActivationThreshold: bigint; maxActivationThreshold: bigint; maxRunwayCap: bigint; }; oracleBounds: { liveness: bigint; bondAmount: bigint; }; budgetSuccessResolver: EvmAddress; budgetSpendPolicy: EvmAddress; arbitratorParams: { votingPeriod: bigint; votingDelay: bigint; revealPeriod: bigint; arbitrationCost: bigint; wrongOrMissedSlashBps: bigint; slashCallerBountyBps: bigint; }; }; goalSpendPolicy: EvmAddress; }; export type GoalFactoryDeployParamsInput = GoalFactoryDeployParams | GoalFactoryDeployParamsRecord; export type GoalCreateTransaction = { to: EvmAddress; data: Hex; valueEth: "0"; }; export type GoalCreateWriteContractRequest = { address: EvmAddress; abi: typeof goalFactoryAbi; functionName: "deployOpenGoal"; args: readonly [GoalFactoryOpenGoalContractParams]; } | { address: EvmAddress; abi: typeof goalFactoryAbi; functionName: "deployManagedGoal"; args: readonly [GoalFactoryManagedGoalContractParams]; }; export type GoalCreatePlan = { chainId: typeof BASE_CHAIN_ID; network: ProtocolNetwork; goalFactory: EvmAddress; deployParams: GoalFactoryDeployParams; transaction: GoalCreateTransaction; writeContract: GoalCreateWriteContractRequest; }; export type GoalCreateProtocolPlan = ProtocolExecutionPlan<"goal.create"> & { chainId: typeof BASE_CHAIN_ID; goalFactory: EvmAddress; deployParams: GoalFactoryDeployParams; }; export type GoalDeployedStack = { goalRevnetId: bigint; goalToken: EvmAddress; goalSuperToken: EvmAddress; goalTreasury: EvmAddress; goalFlow: EvmAddress; goalAllocatorStrategy: EvmAddress; goalFlowAllocationLedgerPipeline: EvmAddress; stakeVault: EvmAddress; budgetStakeLedger: EvmAddress; splitHook: EvmAddress; jurorSlasherRouter: EvmAddress; underwriterSlasherRouter: EvmAddress; successResolver: EvmAddress; budgetController: EvmAddress; budgetTCR: EvmAddress; arbitrator: EvmAddress; }; export type GoalDeployedEvent = { caller: EvmAddress; goalRevnetId: bigint; stack: GoalDeployedStack; }; export declare function isGoalFactoryDeployParamsInput(value: unknown): value is GoalFactoryDeployParamsInput; export declare function normalizeGoalFactoryDeployParams(raw: unknown): GoalFactoryDeployParams; export declare function extractGoalFactoryDeployParams(raw: unknown): GoalFactoryDeployParams; export declare function encodeGoalFactoryDeployGoalData(deployParams: unknown): Hex; export declare function buildGoalCreatePlan(params: { deployParams: unknown; factoryAddress?: string; network?: ProtocolNetwork | string; }): GoalCreatePlan; export declare function buildGoalCreateProtocolPlan(params: { deployParams: unknown; factoryAddress?: string; network?: ProtocolNetwork | string; }): GoalCreateProtocolPlan; export declare function buildGoalCreateWriteContractRequest(params: { deployParams: unknown; factoryAddress?: string; network?: ProtocolNetwork | string; }): GoalCreateWriteContractRequest; export declare function buildGoalCreateTransaction(params: { deployParams: unknown; factoryAddress?: string; network?: ProtocolNetwork | string; }): GoalCreateTransaction; export declare function decodeGoalDeployedEvent(logs: readonly unknown[]): GoalDeployedEvent | null; export declare function serializeGoalDeployedEvent(event: GoalDeployedEvent): Record; export {};