From 7bf774153cac5c6e1bcfef7d46e50b16718a66d4 Mon Sep 17 00:00:00 2001 From: Pablo Alayeto <55535804+Pabl0cks@users.noreply.github.com> Date: Fri, 22 Mar 2024 12:26:14 +0100 Subject: [PATCH 1/4] Delete askAmount from eip712 sign --- packages/nextjs/app/api/grants/new/route.ts | 2 +- packages/nextjs/app/apply/_component/Form.tsx | 1 - packages/nextjs/utils/eip712.ts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/nextjs/app/api/grants/new/route.ts b/packages/nextjs/app/api/grants/new/route.ts index 31dbb8cc..caf55c2a 100644 --- a/packages/nextjs/app/api/grants/new/route.ts +++ b/packages/nextjs/app/api/grants/new/route.ts @@ -36,7 +36,7 @@ export async function POST(req: Request) { domain: EIP_712_DOMAIN, types: EIP_712_TYPES__APPLY_FOR_GRANT, primaryType: "Message", - message: { title, description, askAmount }, + message: { title, description }, signature: signature, }); diff --git a/packages/nextjs/app/apply/_component/Form.tsx b/packages/nextjs/app/apply/_component/Form.tsx index cce4e2d9..686ace21 100644 --- a/packages/nextjs/app/apply/_component/Form.tsx +++ b/packages/nextjs/app/apply/_component/Form.tsx @@ -45,7 +45,6 @@ const Form = () => { message: { title: title, description: description, - askAmount: askAmount, }, }); diff --git a/packages/nextjs/utils/eip712.ts b/packages/nextjs/utils/eip712.ts index 7d03877c..e80261a5 100644 --- a/packages/nextjs/utils/eip712.ts +++ b/packages/nextjs/utils/eip712.ts @@ -10,7 +10,6 @@ export const EIP_712_TYPES__APPLY_FOR_GRANT = { Message: [ { name: "title", type: "string" }, { name: "description", type: "string" }, - { name: "askAmount", type: "string" }, ], } as const; From 7acbafff65c8bcf55cbb6d426d11956a425d97c3 Mon Sep 17 00:00:00 2001 From: Pablo Alayeto <55535804+Pabl0cks@users.noreply.github.com> Date: Fri, 22 Mar 2024 12:30:11 +0100 Subject: [PATCH 2/4] Remove chainId so it can be signed from any chain --- packages/nextjs/utils/eip712.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/nextjs/utils/eip712.ts b/packages/nextjs/utils/eip712.ts index e80261a5..86f1e3df 100644 --- a/packages/nextjs/utils/eip712.ts +++ b/packages/nextjs/utils/eip712.ts @@ -1,9 +1,6 @@ -import scaffoldConfig from "~~/scaffold.config"; - export const EIP_712_DOMAIN = { name: "BuidlGuidl Grants", version: "1", - chainId: scaffoldConfig.targetNetworks[0].id, } as const; export const EIP_712_TYPES__APPLY_FOR_GRANT = { From 97cf56498081e42ff9ca1be9f5594e2ab480d55b Mon Sep 17 00:00:00 2001 From: Pablo Alayeto <55535804+Pabl0cks@users.noreply.github.com> Date: Fri, 22 Mar 2024 12:35:32 +0100 Subject: [PATCH 3/4] Hide ETH amount if grant status is Proposed --- packages/nextjs/app/my-grants/page.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/nextjs/app/my-grants/page.tsx b/packages/nextjs/app/my-grants/page.tsx index 19565aad..070a5f44 100644 --- a/packages/nextjs/app/my-grants/page.tsx +++ b/packages/nextjs/app/my-grants/page.tsx @@ -40,12 +40,14 @@ const MyGrants: NextPage = () => { {grant.title} ({grant.id}) -
{grant.description}
{grant.status}
{grant.status === PROPOSAL_STATUS.APPROVED && ( From 346ad39a2906e5ef90f6107eb8ba19107a9b0388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez?=