From a0d00bb5a3615e7d4a9df72990cf894a3d1b0fc8 Mon Sep 17 00:00:00 2001 From: Carlos Fontes Date: Thu, 12 Dec 2024 12:51:04 +0000 Subject: [PATCH 1/2] chore: added loc on vault editor --- packages/shared/src/types/editor.ts | 1 + packages/shared/src/types/types.ts | 1 + packages/web/src/languages/en.json | 5 ++++- .../InScopeSection/InScopeSection.tsx | 12 ++++++++++++ .../SetupSteps/VaultDetailsForm/VaultDetailsForm.tsx | 11 +++++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/types/editor.ts b/packages/shared/src/types/editor.ts index ce2d0bdc1..b654d3c00 100644 --- a/packages/shared/src/types/editor.ts +++ b/packages/shared/src/types/editor.ts @@ -88,6 +88,7 @@ export interface IBaseEditedVaultDescription { emails: IEditedCommunicationEmail[]; oneLiner?: string; intendedCompetitionAmount?: number; + loc?: number; curator?: { username: string; role: CuratorRole; diff --git a/packages/shared/src/types/types.ts b/packages/shared/src/types/types.ts index 73b437641..1413c83f1 100644 --- a/packages/shared/src/types/types.ts +++ b/packages/shared/src/types/types.ts @@ -148,6 +148,7 @@ interface IBaseVaultDescription { starttime?: number; oneLiner?: string; intendedCompetitionAmount?: number; + loc?: number; curator?: { username: string; role: CuratorRole; diff --git a/packages/web/src/languages/en.json b/packages/web/src/languages/en.json index 8de73b919..097e37f0c 100644 --- a/packages/web/src/languages/en.json +++ b/packages/web/src/languages/en.json @@ -749,6 +749,7 @@ "bonusPointsReminder": "Remember, you have 12 hours to submit after claiming. Happy fixing and testing!", "bonusPointsEnabled": "Enable bonus points?", "claimFixAndTest": "Claim fix and test", + "linesOfCode": "Lines of code (LoC)", "MyWallet": { "overview": "Overview", "pointValue": "Point value", @@ -1650,7 +1651,9 @@ "curator-placeholder": "Select curator of the vault", "curatorRole": "Curator role", "curatorRole-placeholder": "Select the role of the curator", - "clearCurator": "Clear curator" + "clearCurator": "Clear curator", + "loc-placeholder": "Enter number of lines of code", + "loc": "Lines of code" }, "signatureMessage": "I hereby confirm the details in ipfs hash {{ipfsHash}}.", "committee-details": "Committee Details", diff --git a/packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx b/packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx index acd44f81d..bf1c324f6 100644 --- a/packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx +++ b/packages/web/src/pages/Honeypots/VaultDetailsPage/Sections/VaultScopeSection/InScopeSection/InScopeSection.tsx @@ -10,6 +10,7 @@ import ArrowForwardIcon from "@mui/icons-material/ArrowForward"; import DocumentIcon from "@mui/icons-material/DescriptionOutlined"; import DiffIcon from "@mui/icons-material/DifferenceOutlined"; import OpenIcon from "@mui/icons-material/LaunchOutlined"; +import HashtagIcon from "@mui/icons-material/NumbersOutlined"; import OverviewIcon from "@mui/icons-material/SelfImprovementOutlined"; import TerminalIcon from "@mui/icons-material/Terminal"; import ContractsIcon from "@mui/icons-material/ViewInAr"; @@ -215,6 +216,17 @@ export const InScopeSection = ({ vault }: InScopeSectionProps) => { )} + {/* LoC */} + {vault.description["project-metadata"].loc && ( + <> +

+ + {t("linesOfCode")}: + {vault.description["project-metadata"].loc} +

+ + )} + {/* Overview */} {vault.description.scope?.description && ( <> diff --git a/packages/web/src/pages/VaultEditor/VaultEditorFormPage/SetupSteps/VaultDetailsForm/VaultDetailsForm.tsx b/packages/web/src/pages/VaultEditor/VaultEditorFormPage/SetupSteps/VaultDetailsForm/VaultDetailsForm.tsx index 2ac9c2b0d..a5393f5a5 100644 --- a/packages/web/src/pages/VaultEditor/VaultEditorFormPage/SetupSteps/VaultDetailsForm/VaultDetailsForm.tsx +++ b/packages/web/src/pages/VaultEditor/VaultEditorFormPage/SetupSteps/VaultDetailsForm/VaultDetailsForm.tsx @@ -204,6 +204,17 @@ export function VaultDetailsForm() { helper={watch("project-metadata.oneLiner") ? `${watch("project-metadata.oneLiner")?.length ?? 0} characters` : ""} /> +
+ +
+ {requireMessageSignature && ( <>

{t("VaultEditor.vault-details.messageToSign-explanation")}

From 10c0bf90b37f6af5d3305c43ecdb4556262ba61f Mon Sep 17 00:00:00 2001 From: Carlos Fontes Date: Thu, 12 Dec 2024 14:26:47 +0000 Subject: [PATCH 2/2] added hats profile link --- .../FormSteps/SubmissionDescriptions/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web/src/pages/Submissions/SubmissionFormPage/FormSteps/SubmissionDescriptions/utils.ts b/packages/web/src/pages/Submissions/SubmissionFormPage/FormSteps/SubmissionDescriptions/utils.ts index fb97f35da..1e5b30451 100644 --- a/packages/web/src/pages/Submissions/SubmissionFormPage/FormSteps/SubmissionDescriptions/utils.ts +++ b/packages/web/src/pages/Submissions/SubmissionFormPage/FormSteps/SubmissionDescriptions/utils.ts @@ -95,7 +95,7 @@ export const getBountySubmissionTexts = ( const toEncrypt = `**Project Name:** ${submissionData.project?.projectName}\n **Project Id:** ${submissionData.project?.projectId}\n **Beneficiary:** ${submissionData.contact?.beneficiary}\n -**HATS Profile:** ${hackerProfile ? `${hackerProfile?.username}` : "---"}\n +**HATS Profile:** ${hackerProfile ? `[HATS Profile](https://app.hats.finance/profile/${hackerProfile?.username})` : "---"}\n **Communication channel:** ${submissionData.contact?.communicationChannel} (${submissionData.contact?.communicationChannelType}) ${descriptions @@ -125,7 +125,7 @@ export const getGithubIssueDescription = ( return `${submissionData.ref === "audit-wizard" ? "***Submitted via auditwizard.io***\n" : ""} **Github username:** ${submissionData.contact?.githubUsername ? `@${submissionData.contact?.githubUsername}` : "--"} **Twitter username:** ${submissionData.contact?.twitterUsername ? `${submissionData.contact?.twitterUsername}` : "--"} - **HATS Profile:** ${hackerProfile ? `${hackerProfile?.username}` : "---"} + **HATS Profile:** ${hackerProfile ? `[HATS Profile](https://app.hats.finance/profile/${hackerProfile?.username})` : "---"}\n **Beneficiary:** ${submissionData.contact?.beneficiary} **Submission hash (on-chain):** ${submissionData.submissionResult?.transactionHash} **Severity:** ${description.severity}