import { type Address, type Hex } from "viem";
/**
 * Safe v1.4.1 `execTransaction` — the entry point through which the Safe calls
 * another contract *as itself* (msg.sender == Safe). Full ABI:
 * https://github.com/safe-global/safe-deployments/tree/main/src/assets/v1.4.1
 */
export declare const gnosisSafeExecAbi: readonly [{
    readonly type: "function";
    readonly name: "execTransaction";
    readonly stateMutability: "payable";
    readonly inputs: readonly [{
        readonly name: "to";
        readonly type: "address";
    }, {
        readonly name: "value";
        readonly type: "uint256";
    }, {
        readonly name: "data";
        readonly type: "bytes";
    }, {
        readonly name: "operation";
        readonly type: "uint8";
    }, {
        readonly name: "safeTxGas";
        readonly type: "uint256";
    }, {
        readonly name: "baseGas";
        readonly type: "uint256";
    }, {
        readonly name: "gasPrice";
        readonly type: "uint256";
    }, {
        readonly name: "gasToken";
        readonly type: "address";
    }, {
        readonly name: "refundReceiver";
        readonly type: "address";
    }, {
        readonly name: "signatures";
        readonly type: "bytes";
    }];
    readonly outputs: readonly [{
        readonly name: "success";
        readonly type: "bool";
    }];
}];
/**
 * Minimal Safe contract ABI — only what's needed to encode the setup
 * initializer. Full ABI: https://github.com/safe-global/safe-deployments
 */
export declare const gnosisSafeAbi: readonly [{
    readonly type: "function";
    readonly name: "setup";
    readonly stateMutability: "nonpayable";
    readonly inputs: readonly [{
        readonly name: "_owners";
        readonly type: "address[]";
    }, {
        readonly name: "_threshold";
        readonly type: "uint256";
    }, {
        readonly name: "to";
        readonly type: "address";
    }, {
        readonly name: "data";
        readonly type: "bytes";
    }, {
        readonly name: "fallbackHandler";
        readonly type: "address";
    }, {
        readonly name: "paymentToken";
        readonly type: "address";
    }, {
        readonly name: "payment";
        readonly type: "uint256";
    }, {
        readonly name: "paymentReceiver";
        readonly type: "address";
    }];
    readonly outputs: readonly [];
}];
/**
 * SafeModuleEnabler — `enable(module)` is delegatecalled via Safe.setup's
 * `to`/`data` hook to enable a module on a freshly deployed Safe in the same
 * transaction. Deployed once per chain (SailDeployment.safeModuleEnabler).
 */
export declare const safeModuleEnablerAbi: readonly [{
    readonly type: "function";
    readonly name: "enable";
    readonly stateMutability: "nonpayable";
    readonly inputs: readonly [{
        readonly name: "module";
        readonly type: "address";
    }];
    readonly outputs: readonly [];
}];
/**
 * Canonical Safe v1.4.1 deployment addresses (CREATE2 — same on all EVM chains).
 * https://github.com/safe-global/safe-deployments/tree/main/src/assets/v1.4.1
 */
export declare const SAFE_V141: {
    readonly proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67";
    readonly singletonL2: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762";
    readonly fallbackHandler: "0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99";
};
/**
 * Build the `Safe.setup()` initializer for a Safe that will be registered with
 * SailKernel via `kernel.createAccount()`.
 *
 * Wires the `to`/`data` delegatecall hook to the SafeModuleEnabler so the
 * kernel is enabled as a Safe module *during* setup. Without this, the kernel's
 * `createAccount` reverts with `ModuleNotEnabled()` after deploying the Safe.
 */
export declare function buildSafeSetupInitializer(params: {
    owners: Address[];
    threshold: bigint;
    kernel: Address;
    safeModuleEnabler: Address;
    fallbackHandler?: Address;
}): Hex;
/**
 * Build a Safe "pre-validated" (approved-hash) signature for `owner`.
 *
 * Safe's `checkNSignatures` treats a signature with `v == 1` as pre-validated:
 * it passes when the recovered owner address (`r`, left-padded to 32 bytes) is
 * either the `msg.sender` or has previously called `approveHash`. So when the
 * sole owner of a 1-of-1 Safe submits `execTransaction` themselves, this 65-byte
 * blob authorises the call with NO off-chain Safe-tx EIP-712 signature and no
 * dependency on the Safe nonce. Layout: r = owner(32) ‖ s = 0(32) ‖ v = 1(1).
 */
export declare function buildApprovedHashSignature(owner: Address): Hex;
/** ABI for SafeProxyFactory.proxyCreationCode() — pure view returning SafeProxy creation bytecode. */
export declare const safeProxyFactoryAbi: readonly [{
    readonly type: "function";
    readonly name: "proxyCreationCode";
    readonly stateMutability: "pure";
    readonly inputs: readonly [];
    readonly outputs: readonly [{
        readonly name: "";
        readonly type: "bytes";
    }];
}];
/**
 * Compute the CREATE2 address SafeProxyFactory.createProxyWithNonce() assigns.
 *
 * Factory formula (from SafeProxyFactory source):
 *   initCode     = proxyCreationCode ++ abi.encode(singleton)
 *   salt         = keccak256(keccak256(initializer) ++ uint256(saltNonce))
 *   deployedAddr = CREATE2(factory, salt, keccak256(initCode))
 *
 * `proxyCreationCode` must be read once from the factory via `safeProxyFactoryAbi`;
 * it is identical on every chain since SAFE_V141.proxyFactory is the same address everywhere.
 *
 * This is the LOW-LEVEL factory primitive: `saltNonce` is the value handed to
 * `createProxyWithNonce` verbatim. When the deployer is SailKernel.createAccount,
 * the kernel does NOT use the caller's nonce directly — it binds it to the
 * deployer + principals first. To predict a Sail SMA address, use
 * `computeSailSmaAddress` (which applies `computeKernelBoundSalt`), NOT this
 * function with the raw nonce.
 *
 * NOTE: the `initializer` encodes chain-specific addresses (kernel, safeModuleEnabler)
 * via `buildSafeSetupInitializer`. Different initializers per chain → different CREATE2 salts
 * → different deployed addresses, even with the same `saltNonce`. Cross-chain same-address
 * requires the Sail Protocol to deploy kernel + safeModuleEnabler at identical addresses on
 * every chain (deterministic CREATE2 deployment), or a registerExisting() flow that
 * accepts a plain Safe deployed with a chain-agnostic initializer.
 */
export declare function computeSafeProxyAddress(params: {
    initializer: Hex;
    saltNonce: bigint;
    proxyCreationCode: Hex;
}): Address;
/**
 * Derive the salt SailKernel.createAccount actually passes to the factory.
 *
 * The kernel does NOT forward the caller's `saltNonce` directly — it binds it to
 * the deployer (`msg.sender`) and the account principals to prevent address
 * front-running (SailKernel.sol):
 *
 *   boundSalt = uint256(keccak256(abi.encode(
 *     saltNonce, msg.sender, permissionSigner, manager, feePolicy)))
 *
 * In the standard onboarding flow `deployer === permissionSigner === owner`
 * (the owner's EOA submits createAccount and is also the Safe's permission
 * signer), while `manager` is the agent wallet and `feePolicy` is the chain's
 * StandardFeePolicy.
 */
export declare function computeKernelBoundSalt(params: {
    saltNonce: bigint;
    /** `msg.sender` of createAccount — the EOA that deploys (the owner). */
    deployer: Address;
    permissionSigner: Address;
    manager: Address;
    feePolicy: Address;
}): bigint;
/**
 * Compute the deterministic SMA (Safe) address that SailKernel.createAccount
 * will deploy for the given owner/manager/feePolicy and salt.
 *
 * This is the address `sailor account predict` should show: it applies the
 * kernel's salt binding (`computeKernelBoundSalt`) before the factory's CREATE2
 * formula (`computeSafeProxyAddress`). Because the bound salt mixes in the
 * deployer, permission signer, manager, and fee policy, the address changes if
 * ANY of those change — not just the `initializer`.
 */
export declare function computeSailSmaAddress(params: {
    initializer: Hex;
    saltNonce: bigint;
    deployer: Address;
    permissionSigner: Address;
    manager: Address;
    feePolicy: Address;
    proxyCreationCode: Hex;
}): Address;
/** ABI-encode the kernel's `setManager(newManager)` call. */
export declare function encodeSetManager(newManager: Address): Hex;
/**
 * Build the `Safe.execTransaction` calldata that rotates an SMA's delegated
 * signer by calling `kernel.setManager(newManager)` *as the Safe*.
 *
 * `setManager` is gated by `msg.sender == account`, so it cannot be sent
 * straight from the owner's EOA (as createAccount/dispatch are) — it must be
 * wrapped in a Safe transaction. For the 1-of-1 Safes Sailor creates, the owner
 * submits this tx from their own wallet and authorises it with a pre-validated
 * signature (see `buildApprovedHashSignature`); no separate Safe-tx signing
 * round-trip is needed. Returns the tx the owner sends: `{ to: safe, data }`.
 */
export declare function buildSetManagerExecTransaction(params: {
    /** The SMA (Safe) whose manager is being rotated; also the tx `to`. */
    safe: Address;
    /** The SailKernel the Safe will call. */
    kernel: Address;
    /** The new delegated signer (manager) address. */
    newManager: Address;
    /** The sole Safe owner who will submit this tx. */
    owner: Address;
}): {
    to: Address;
    data: Hex;
};
//# sourceMappingURL=safe.d.ts.map