From 0534aba4e07b70696bed277cf0124818e1c9e8ba Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 4 Jul 2025 00:45:12 +0000 Subject: [PATCH 1/3] Enhance smart account factory address validation in auth options form Co-authored-by: joaquim.verges --- .../client/auth-options-form.client.tsx | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx index 5669c5d71c9..6db59d6320f 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx @@ -90,9 +90,9 @@ export function AuthOptionsForm({ DEFAULT_ACCOUNT_FACTORY_V0_7 ? "v0.7" : ecosystem.smartAccountOptions?.accountFactoryAddress === - DEFAULT_ACCOUNT_FACTORY_V0_6 - ? "v0.6" - : "custom", + DEFAULT_ACCOUNT_FACTORY_V0_6 + ? "v0.6" + : "custom", authOptions: ecosystem.authOptions || [], customAccountFactoryAddress: ecosystem.smartAccountOptions?.accountFactoryAddress || "", @@ -133,6 +133,8 @@ export function AuthOptionsForm({ (data) => { if ( data.useSmartAccount && + data.executionMode === "EIP4337" && + data.accountFactoryType === "custom" && data.customAccountFactoryAddress && !isAddress(data.customAccountFactoryAddress) ) { @@ -145,6 +147,23 @@ export function AuthOptionsForm({ path: ["customAccountFactoryAddress"], }, ) + .refine( + (data) => { + if ( + data.useSmartAccount && + data.executionMode === "EIP4337" && + data.accountFactoryType === "custom" && + !data.customAccountFactoryAddress + ) { + return false; + } + return true; + }, + { + message: "Please enter a custom account factory address", + path: ["customAccountFactoryAddress"], + }, + ) .refine( (data) => { if (data.useSmartAccount && (data.defaultChainId ?? 0) <= 0) { From bf5b06010b71052743c0d7ed19bb71df9adf916d Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Fri, 4 Jul 2025 00:59:49 +0000 Subject: [PATCH 2/3] fix --- .../components/client/auth-options-form.client.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx index 6db59d6320f..6bdb36c2707 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx @@ -231,7 +231,7 @@ export function AuthOptionsForm({ } let smartAccountOptions: Ecosystem["smartAccountOptions"] | null = null; - if (data.useSmartAccount) { + if (data.useSmartAccount && data.executionMode === "EIP4337") { let accountFactoryAddress: string; switch (data.accountFactoryType) { case "v0.6": From 4842fe21be4b13274ca55f667dd1be7940454994 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Fri, 4 Jul 2025 01:12:54 +0000 Subject: [PATCH 3/3] lint --- .../components/client/auth-options-form.client.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx index 6bdb36c2707..6288aaa6b1f 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx @@ -90,9 +90,9 @@ export function AuthOptionsForm({ DEFAULT_ACCOUNT_FACTORY_V0_7 ? "v0.7" : ecosystem.smartAccountOptions?.accountFactoryAddress === - DEFAULT_ACCOUNT_FACTORY_V0_6 - ? "v0.6" - : "custom", + DEFAULT_ACCOUNT_FACTORY_V0_6 + ? "v0.6" + : "custom", authOptions: ecosystem.authOptions || [], customAccountFactoryAddress: ecosystem.smartAccountOptions?.accountFactoryAddress || "",