Function toOwnableValidator

  • Creates an Ownable module for a modular smart account.

    This function sets up an Ownable module with the specified parameters, including threshold and owners for the smart account.

    Parameters

    • parameters: ToOwnableValidatorModuleParameters

      The parameters for creating the Ownable module.

    Returns Assign_<BaseModule, undefined | object> & object

    A Module object representing the created Ownable module.

    Example

    const ownableModule = toOwnableValidator({
    account: mySmartAccount,
    signer: mySigner,
    moduleInitArgs: {
    threshold: 2,
    owners: ['0x123...', '0x456...']
    }
    });

    Remarks

    • If the module is already installed, it will use the existing threshold.
    • If not installed, it will use the threshold from the initialization parameters.
    • The function generates a mock signature based on the threshold.