Skip to content

Add support for kernel 0.3.2 & 0.3.3 #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/forty-jeans-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"permissionless": patch
---

Added support for kernel 0.3.2 & 0.3.3
223 changes: 0 additions & 223 deletions packages/permissionless-test/mock-aa-infra/alto/constants.ts

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions packages/permissionless-test/mock-aa-infra/alto/constants/core.ts

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions packages/permissionless-test/mock-aa-infra/alto/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export * from "./core"
export * from "./accounts/biconomy"
export * from "./accounts/etherspot"
export * from "./accounts/kernel"
export * from "./accounts/light"
export * from "./accounts/nexus"
export * from "./accounts/safe"
export * from "./accounts/simple"
export * from "./accounts/thirdweb"
export * from "./accounts/trust"
54 changes: 50 additions & 4 deletions packages/permissionless-test/mock-aa-infra/alto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ import {
KERNEL_V07_V3_1_ECDSA_VALIDATOR_V3_CREATECALL,
KERNEL_V07_V3_1_FACTORY_CREATECALL,
KERNEL_V07_V3_1_WEB_AUTHN_VALIDATOR_CREATECALL,
KERNEL_V07_V3_2_ACCOUNT_V3_LOGIC_CREATECALL,
KERNEL_V07_V3_2_FACTORY_CREATECALL,
KERNEL_V07_V3_3_ACCOUNT_V3_LOGIC_CREATECALL,
KERNEL_V07_V3_3_FACTORY_CREATECALL,
LIGHT_ACCOUNT_FACTORY_V110_CREATECALL,
LIGHT_ACCOUNT_FACTORY_V200_CREATECALL,
NEXUS_ACCOUNT_BOOTSTRAPPER_CREATECALL,
Expand Down Expand Up @@ -72,7 +76,7 @@ import {
TRUST_FACTORY_V06_CREATECALL,
TRUST_SECP256K1_VERIFICATION_FACET_CREATECALL,
TRUST_TOKEN_RECEIVER_FACET_CREATE_CALL
} from "./constants"
} from "./constants/index"

const DETERMINISTIC_DEPLOYER = "0x4e59b44847b379578588920ca78fbf26c0b4956c"
const SAFE_SINGLETON_FACTORY = "0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7"
Expand Down Expand Up @@ -266,6 +270,30 @@ export const setupContracts = async (rpc: string) => {
gas: 15_000_000n,
nonce: nonce++
}),
walletClient.sendTransaction({
to: DETERMINISTIC_DEPLOYER,
data: KERNEL_V07_V3_2_ACCOUNT_V3_LOGIC_CREATECALL,
gas: 15_000_000n,
nonce: nonce++
}),
walletClient.sendTransaction({
to: DETERMINISTIC_DEPLOYER,
data: KERNEL_V07_V3_2_FACTORY_CREATECALL,
gas: 15_000_000n,
nonce: nonce++
}),
walletClient.sendTransaction({
to: DETERMINISTIC_DEPLOYER,
data: KERNEL_V07_V3_3_ACCOUNT_V3_LOGIC_CREATECALL,
gas: 15_000_000n,
nonce: nonce++
}),
walletClient.sendTransaction({
to: DETERMINISTIC_DEPLOYER,
data: KERNEL_V07_V3_3_FACTORY_CREATECALL,
gas: 15_000_000n,
nonce: nonce++
}),
walletClient.sendTransaction({
to: DETERMINISTIC_DEPLOYER,
data: LIGHT_ACCOUNT_FACTORY_V110_CREATECALL,
Expand Down Expand Up @@ -587,6 +615,20 @@ export const setupContracts = async (rpc: string) => {
data: "0x6e7dbabb000000000000000000000000aac5D4240AF87249B3f71BC8E4A2cae074A3E4190000000000000000000000000000000000000000000000000000000000000001"
})

// register 0x7a1dBAB750f12a90EB1B60D2Ae3aD17D4D81EfFe
await sendTransaction(walletClient, {
account: kernelFactoryOwner,
to: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5" /* kernel factory v0.7 */,
data: "0x6e7dbabb0000000000000000000000007a1dBAB750f12a90EB1B60D2Ae3aD17D4D81EfFe0000000000000000000000000000000000000000000000000000000000000001"
})

// register 0xE30c76Dc9eCF1c19F6Fec070674E1b4eFfE069FA
await sendTransaction(walletClient, {
account: kernelFactoryOwner,
to: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5" /* kernel factory v0.7 */,
data: "0x6e7dbabb000000000000000000000000E30c76Dc9eCF1c19F6Fec070674E1b4eFfE069FA0000000000000000000000000000000000000000000000000000000000000001"
})

await sendTransaction(walletClient, {
account: kernelFactoryOwner,
to: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5" /* kernel factory v0.7 */,
Expand Down Expand Up @@ -644,19 +686,23 @@ export const setupContracts = async (rpc: string) => {
"0x000000a56Aaca3e9a4C479ea6b6CD0DbcB6634F5", // Biconomy Factory Address
"0x0bBa6d96BD616BedC6BFaa341742FD43c60b83C1", // Biconomy Default Fallback Handler
"0xf048AD83CB2dfd6037A43902a2A5Be04e53cd2Eb", // Kernel 0.2.1 Account Logic
"0xd9AB5096a832b9ce79914329DAEE236f8Eea0390", // Kernel v0.2.2 ECDSA Valdiator
"0xd9AB5096a832b9ce79914329DAEE236f8Eea0390", // Kernel v0.2.2 ECDSA Validator
"0x0DA6a956B9488eD4dd761E59f52FDc6c8068E6B5", // Kernel v0.2.2 Account Logic
"0xD3F582F6B4814E989Ee8E96bc3175320B5A540ab", // Kernel v0.2.3 Account Logic
"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3", // Kernel v0.2.2 Factory
"0xd3082872F8B06073A021b4602e022d5A070d7cfC", // Kernel v0.2.4 Factory
"0x8104e3Ad430EA6d354d013A6789fDFc71E671c43", // Kernel v0.3.0 ECDSA Valdiator
"0x8104e3Ad430EA6d354d013A6789fDFc71E671c43", // Kernel v0.3.0 ECDSA Validator
"0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27", // Kernel v0.3.0 Account Logic
"0x6723b44Abeec4E71eBE3232BD5B455805baDD22f", // Kernel v0.3.0 Factory
"0xd703aaE79538628d27099B8c4f621bE4CCd142d5", // Kernel v0.3.0 & v0.3.1 Meta Factory
"0x845ADb2C711129d4f3966735eD98a9F09fC4cE57", // Kernel v0.3.1 ECDSA Valdiator
"0x845ADb2C711129d4f3966735eD98a9F09fC4cE57", // Kernel v0.3.1 ECDSA Validator
"0xBAC849bB641841b44E965fB01A4Bf5F074f84b4D", // Kernel v0.3.1 Account Logic
"0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419", // Kernel v0.3.1 Factory
"0xbA45a2BFb8De3D24cA9D7F1B551E14dFF5d690Fd", // Kernel v0.3.1 WebAuthn Validator
"0xD830D15D3dc0C269F3dBAa0F3e8626d33CFdaBe1", // Kernel v0.3.2 Account Logic
"0x7a1dBAB750f12a90EB1B60D2Ae3aD17D4D81EfFe", // Kernel v0.3.2 Factory
"0xE264dCCc54e4b6906c0D1Fee11D4326c06D33c80", // Kernel v0.3.3 Account Logic
"0xE30c76Dc9eCF1c19F6Fec070674E1b4eFfE069FA", // Kernel v0.3.3 Factory
"0x00004EC70002a32400f8ae005A26081065620D20", // LightAccountFactory v1.1.0
"0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba", // LightAccount v1.1.0 implementation
"0x0000000000400CdFef5E2714E63d8040b700BC24", // LightAccountFactory v2.0.0
Expand Down
56 changes: 56 additions & 0 deletions packages/permissionless-test/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,62 @@ export const getCoreSmartAccounts = () => [
supportsEntryPointV07: true,
isEip1271Compliant: true
},
{
name: "Kernel 7579 0.3.2",
getSmartAccountClient: async <entryPointVersion extends "0.6" | "0.7">(
conf: AAParamType<entryPointVersion>
) =>
getBundlerClient({
account: await getKernelEcdsaClient({
...conf,
version: "0.3.2" as KernelVersion<entryPointVersion>
}),
...conf
}),
getErc7579SmartAccountClient: async <
entryPointVersion extends "0.6" | "0.7"
>(
conf: AAParamType<entryPointVersion>
) =>
getSmartAccountClient({
account: await getKernelEcdsaClient({
...conf,
version: "0.3.2" as KernelVersion<entryPointVersion>
}),
...conf
}),
supportsEntryPointV06: false,
supportsEntryPointV07: true,
isEip1271Compliant: true
},
{
name: "Kernel 7579 0.3.3",
getSmartAccountClient: async <entryPointVersion extends "0.6" | "0.7">(
conf: AAParamType<entryPointVersion>
) =>
getBundlerClient({
account: await getKernelEcdsaClient({
...conf,
version: "0.3.3" as KernelVersion<entryPointVersion>
}),
...conf
}),
getErc7579SmartAccountClient: async <
entryPointVersion extends "0.6" | "0.7"
>(
conf: AAParamType<entryPointVersion>
) =>
getSmartAccountClient({
account: await getKernelEcdsaClient({
...conf,
version: "0.3.3" as KernelVersion<entryPointVersion>
}),
...conf
}),
supportsEntryPointV06: false,
supportsEntryPointV07: true,
isEip1271Compliant: true
},
{
name: "Biconomy",
getSmartAccountClient: async <entryPointVersion extends "0.6" | "0.7">(
Expand Down
22 changes: 19 additions & 3 deletions packages/permissionless/accounts/kernel/toKernelSmartAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const createAccountAbi = [
export type KernelVersion<entryPointVersion extends "0.6" | "0.7"> =
entryPointVersion extends "0.6"
? "0.2.1" | "0.2.2" | "0.2.3" | "0.2.4"
: "0.3.0-beta" | "0.3.1"
: "0.3.0-beta" | "0.3.1" | "0.3.2" | "0.3.3"

/**
* Default addresses map for different kernel smart account versions
Expand Down Expand Up @@ -140,6 +140,18 @@ export const KERNEL_VERSION_TO_ADDRESSES_MAP: {
FACTORY_ADDRESS: "0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419",
META_FACTORY_ADDRESS: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5",
WEB_AUTHN_VALIDATOR: "0xbA45a2BFb8De3D24cA9D7F1B551E14dFF5d690Fd"
},
"0.3.2": {
ECDSA_VALIDATOR: "0x845ADb2C711129d4f3966735eD98a9F09fC4cE57",
ACCOUNT_LOGIC: "0xD830D15D3dc0C269F3dBAa0F3e8626d33CFdaBe1",
FACTORY_ADDRESS: "0x7a1dBAB750f12a90EB1B60D2Ae3aD17D4D81EfFe",
META_FACTORY_ADDRESS: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5"
},
"0.3.3": {
ECDSA_VALIDATOR: "0x845ADb2C711129d4f3966735eD98a9F09fC4cE57",
ACCOUNT_LOGIC: "0xE264dCCc54e4b6906c0D1Fee11D4326c06D33c80",
FACTORY_ADDRESS: "0xE30c76Dc9eCF1c19F6Fec070674E1b4eFfE069FA",
META_FACTORY_ADDRESS: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5"
}
}

Expand Down Expand Up @@ -616,7 +628,9 @@ export async function toKernelSmartAccount<
owner,
message,
accountAddress: await this.getAddress(),
kernelVersion,
kernelVersion:
// TODO: remove this once 0.3.3 is released
kernelVersion === "0.3.3" ? "0.3.2" : kernelVersion,
chainId: await getMemoizedChainId()
})

Expand All @@ -635,7 +649,9 @@ export async function toKernelSmartAccount<
chainId: await getMemoizedChainId(),
...(typedData as TypedDataDefinition),
accountAddress: await this.getAddress(),
kernelVersion
kernelVersion:
// TODO: remove this once 0.3.3 is released
kernelVersion === "0.3.3" ? "0.3.2" : kernelVersion
})

if (isKernelV2(kernelVersion)) {
Expand Down
Loading