import { ParsedCallArgs } from "../../onchain/base/types.js"; import { RawTx } from "../../onchain/types/transactions.js"; import { BaseContract } from "../../onchain/base/BaseContract.js"; import "../../onchain/index.js"; import { BytecodeRepositoryContract } from "./bytecode-repository.js"; import { Address, BaseError, Chain, DecodeFunctionDataReturnType, Hex, PublicClient, Transport } from "viem"; //#region src/permissionless/bindings/kill-switch-proxy.d.ts declare const abi: readonly [{ readonly type: "constructor"; readonly inputs: readonly [{ readonly name: "_owner"; readonly internalType: "address"; readonly type: "address"; }, { readonly name: "_caller"; readonly internalType: "address"; readonly type: "address"; }]; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly inputs: readonly []; readonly name: "caller"; readonly outputs: readonly [{ readonly name: ""; readonly internalType: "address"; readonly type: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly inputs: readonly []; readonly name: "contractType"; readonly outputs: readonly [{ readonly name: ""; readonly internalType: "bytes32"; readonly type: "bytes32"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly inputs: readonly []; readonly name: "isKilled"; readonly outputs: readonly [{ readonly name: ""; readonly internalType: "bool"; readonly type: "bool"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly inputs: readonly []; readonly name: "kill"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly inputs: readonly []; readonly name: "owner"; readonly outputs: readonly [{ readonly name: ""; readonly internalType: "address"; readonly type: "address"; }]; readonly stateMutability: "view"; }, { readonly type: "function"; readonly inputs: readonly [{ readonly name: "target"; readonly internalType: "address"; readonly type: "address"; }, { readonly name: "data"; readonly internalType: "bytes"; readonly type: "bytes"; }]; readonly name: "proxyCall"; readonly outputs: readonly [{ readonly name: "result"; readonly internalType: "bytes"; readonly type: "bytes"; }]; readonly stateMutability: "nonpayable"; }, { readonly type: "function"; readonly inputs: readonly []; readonly name: "version"; readonly outputs: readonly [{ readonly name: ""; readonly internalType: "uint256"; readonly type: "uint256"; }]; readonly stateMutability: "view"; }, { readonly type: "event"; readonly anonymous: false; readonly inputs: readonly []; readonly name: "Killed"; }, { readonly type: "error"; readonly inputs: readonly [{ readonly name: "caller"; readonly internalType: "address"; readonly type: "address"; }]; readonly name: "CallerIsNotOwnerException"; }, { readonly type: "error"; readonly inputs: readonly []; readonly name: "KilledException"; }, { readonly type: "error"; readonly inputs: readonly []; readonly name: "OnlyCallerException"; }, { readonly type: "error"; readonly inputs: readonly []; readonly name: "OwnerSameAsCallerException"; }]; /** * Minor version of kill switch proxy, the latest allowed patch of it is deployed */ export declare const KILL_SWITCH_PROXY_MINOR_VERSION = 310; /** * Salt of kill switch proxy deployed together with market configurator, * makes each curator's market configurator get its own proxy */ export declare function killSwitchProxySalt(curatorName: string): Hex; /** * Thrown when bytecode repository has no allowed kill switch proxy bytecode, * so its address can't be computed and it can't be deployed */ export declare class KillSwitchProxyNotAllowedError extends BaseError { name: string; readonly bytecodeRepository: Address; constructor(bytecodeRepository: Address); } export interface PreparedKillSwitchProxyDeployment { address: Address; version: number; encodedParams: Hex; salt: Hex; isAlreadyDeployed: boolean; /** * Whether already deployed proxy is killed, always false for not yet deployed one */ isKilled: boolean; /** * Bytecode repository `deploy` transaction, must be sent by the deployer */ tx: RawTx; } /** * Kill switch proxy forwards calls of its `caller` via `proxyCall` until `owner` kills it. * It is used as market configurator's emergency admin, so that emergency powers * can be revoked instantly without going through the timelock. */ export declare class KillSwitchProxyContract extends BaseContract { #private; constructor(addr: Address, client: PublicClient); /** * Encodes `constructor(address _owner, address _caller)` params * @throws if any address is zero or owner equals caller (constructor reverts in that case) */ static encodeConstructorParams(args: { owner: Address; caller: Address; }): Hex; /** * Returns whether some patch of kill switch proxy v3.10 is allowed in bytecode repository */ static isAvailable(bcr: BytecodeRepositoryContract): Promise; /** * Computes address of kill switch proxy and prepares its deployment via bytecode repository * @param bcr - bytecode repository * @param args.deployer - address that will send deployment transaction, it is mixed into the salt * @param args.owner - address that can kill the proxy * @param args.caller - address that can call through the proxy * @param args.salt - deployment salt * @throws {KillSwitchProxyNotAllowedError} if kill switch proxy is not allowed in bytecode repository */ static prepareDeploy(bcr: BytecodeRepositoryContract, args: { deployer: Address; owner: Address; caller: Address; salt: Hex; }): Promise; isKilled(): Promise; state(): Promise<{ caller: Address; owner: Address; isKilled: boolean; }>; /** * Wraps transaction into `proxyCall`, must be sent by proxy's caller */ proxyCallTx(tx: RawTx): RawTx; /** * Permanently disables `proxyCall`, must be sent by proxy's owner */ killTx(): RawTx; protected parseFunctionParams(params: DecodeFunctionDataReturnType): ParsedCallArgs; } //#endregion export {};