11import {
2- http ,
32 type Address ,
43 type Assign ,
54 type EncodeDeployDataParameters ,
87 type TypedDataDefinition ,
98 concatHex ,
109 createNonceManager ,
11- createWalletClient ,
1210 encodeFunctionData ,
1311 getTypesForEIP712Domain ,
1412 hashMessage ,
@@ -28,11 +26,7 @@ import {
2826 entryPoint07Address ,
2927 toSmartAccount
3028} from "viem/account-abstraction"
31- import {
32- type SignAuthorizationReturnType ,
33- privateKeyToAccount
34- } from "viem/accounts"
35- import { getChainId , getCode , sendTransaction } from "viem/actions"
29+ import { getChainId } from "viem/actions"
3630import { getAction } from "viem/utils"
3731import {
3832 getAccountNonce ,
@@ -52,10 +46,8 @@ import type {
5246 KernelPluginManagerParams ,
5347 PluginMigrationData
5448} from "../../types/kernel.js"
55- import type { Signer } from "../../types/utils.js"
5649import { KERNEL_FEATURES , hasKernelFeature } from "../../utils.js"
5750import { validateKernelVersionWithEntryPoint } from "../../utils.js"
58- import { toSigner } from "../../utils/toSigner.js"
5951import {
6052 isKernelPluginManager ,
6153 toKernelPluginManager
@@ -104,7 +96,6 @@ export type KernelSmartAccountImplementation<
10496 bytecode
10597 } : EncodeDeployDataParameters ) => Promise < Hex >
10698 signMessage : ( parameters : SignMessageParameters ) => Promise < Hex >
107- eip7702Auth ?: SignAuthorizationReturnType
10899 }
109100>
110101
@@ -131,9 +122,6 @@ export type CreateKernelAccountParameters<
131122 kernelVersion : GetKernelVersion < entryPointVersion >
132123 initConfig ?: KernelVerion extends "0.3.1" ? Hex [ ] : never
133124 useMetaFactory ?: boolean
134- eip7702 ?: boolean
135- eip7702Auth ?: SignAuthorizationReturnType
136- eip7702SponsorAccount ?: Signer
137125 pluginMigrations ?: PluginMigrationData [ ]
138126}
139127
@@ -379,9 +367,7 @@ export async function createKernelAccount<
379367 kernelVersion,
380368 initConfig,
381369 useMetaFactory : _useMetaFactory = true ,
382- eip7702Auth,
383- eip7702SponsorAccount,
384- pluginMigrations
370+ pluginMigrations
385371 } : CreateKernelAccountParameters < entryPointVersion , KernelVersion >
386372) : Promise < CreateKernelAccountReturnType < entryPointVersion > > {
387373 let useMetaFactory = _useMetaFactory
@@ -489,35 +475,6 @@ export async function createKernelAccount<
489475 version : entryPoint ?. version ?? "0.7"
490476 } as const
491477
492- if ( eip7702Auth ) {
493- let code = await getCode ( client , { address : accountAddress } )
494- const isEip7702Authorized =
495- code ?. length && code . length > 0 && code . startsWith ( "0xef" )
496- if ( ! isEip7702Authorized ) {
497- const sponsorAccount = eip7702SponsorAccount
498- ? await toSigner ( { signer : eip7702SponsorAccount } )
499- : privateKeyToAccount (
500- // NOTE: Don't worry about this private key, it's just for testing
501- "0x688b84097239bc2bca41079d02fae599964a5844bc9e64f524206ad53a927bb9"
502- )
503- const sponsorWalletClient = createWalletClient ( {
504- account : sponsorAccount ,
505- chain : client . chain ,
506- transport : http ( client . transport . url )
507- } )
508- await sendTransaction ( sponsorWalletClient , {
509- to : accountAddress ,
510- data : "0x" ,
511- authorizationList : [ eip7702Auth ] ,
512- chain : client . chain
513- } )
514- code = await getCode ( client , { address : accountAddress } )
515- while ( code ?. length === undefined || code . length === 0 ) {
516- code = await getCode ( client , { address : accountAddress } )
517- }
518- }
519- }
520-
521478 // Cache for plugin installation status
522479 const pluginCache : PluginInstallationCache = {
523480 pendingPlugins : pluginMigrations || [ ] ,
@@ -551,7 +508,6 @@ export async function createKernelAccount<
551508 await checkPluginInstallationStatus ( )
552509
553510 return toSmartAccount < KernelSmartAccountImplementation < entryPointVersion > > ( {
554- eip7702Auth,
555511 kernelVersion,
556512 kernelPluginManager,
557513 accountImplementationAddress,
0 commit comments