Skip to content

Commit

Permalink
Feat/in review batch (#52) (#53)
Browse files Browse the repository at this point in the history
* Feat/in review batch (#52)

* stage review

* stage review

* Feat/in review batch (#54)

* stage review

* stage review

* change wording

* change review type
  • Loading branch information
yvesbou authored Dec 13, 2024
1 parent dd12efe commit 23784b1
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 30 deletions.
19 changes: 11 additions & 8 deletions src/app/protocols/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { getRiskDescriptions } from "@/components/rosette/data-converter/data-co
import { TooltipProvider } from "@/components/rosette/tooltip/tooltip";
import { Badge } from "@/components/ui/badge";
import { cn } from "@/lib/utils";
import { Stage } from "@/lib/types";

interface ProtocolPageItemProps {
params: {
Expand Down Expand Up @@ -179,16 +180,18 @@ export default async function ProtocolPageItem({

<TooltipProvider>
<Badge
stage={protocol.stage!}
stage={protocol.stage! as Stage}
className={`${
protocol.stage === 0
? "bg-red-500"
: protocol.stage === 1
? "bg-yellow-500"
: "bg-green-500"
} text-white px-2 py-1 rounded`}
protocol.stage! === "R"
? "bg-gray-500"
: protocol.stage! === 0
? "bg-red-500"
: protocol.stage! === 1
? "bg-yellow-500"
: "bg-green-500"
} text-white py-1 rounded "text-lg"`}
>
{"Stage " + protocol.stage}
{protocol.stage! === "R" ? "In Review" : "Stage " + protocol.stage!}
</Badge>
</TooltipProvider>

Expand Down
5 changes: 3 additions & 2 deletions src/app/protocols/stageToRequisites.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const stageToRequisites = [
["Currently in review"],
[
"✅ Blockchain-based, financial protocol",
"✅ Assets are not in custody by centralized entity",
Expand All @@ -7,9 +8,9 @@ export const stageToRequisites = [
"✅ Verified contracts",
],
[
"Risks from critical permissions and dependencies are significantly reduced by: either revoking critical permissions, or establishing a Security Council to control such permissions, or enforcing an exit window of at least 7 days so users can withdraw funds in case of an unwanted protocol update. Critical risks from external dependencies are mitigated by the implementation of appropriate fallback mechanisms. Furthermore, the underlying chain cannot censor users’ transactions and a backup user interface exists guaranteeing access to user funds."
"Risks from critical permissions and dependencies are significantly reduced by: either revoking critical permissions, or establishing a Security Council to control such permissions, or enforcing an exit window of at least 7 days so users can withdraw funds in case of an unwanted protocol update. Critical risks from external dependencies are mitigated by the implementation of appropriate fallback mechanisms. Furthermore, the underlying chain cannot censor users’ transactions and a backup user interface exists guaranteeing access to user funds.",
],
[
"Critical permissions have either been revoked or delegated to an on-chain governance system with ample time for users to exit in case of an unwanted protocol update. Risks from external dependencies have been further reduced such that users’ funds and unclaimed yield remain unaffected by a failure. In addition, different independent user interfaces and a fully decentralized underlying chain guarantee access to users’ funds at any time."
"Critical permissions have either been revoked or delegated to an on-chain governance system with ample time for users to exit in case of an unwanted protocol update. Risks from external dependencies have been further reduced such that users’ funds and unclaimed yield remain unaffected by a failure. In addition, different independent user interfaces and a fully decentralized underlying chain guarantee access to users’ funds at any time.",
],
];
18 changes: 10 additions & 8 deletions src/components/table/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getRiskDescriptions } from "../rosette/data-converter/data-converter";
import { Badge } from "@/components/ui/badge";
import { Button } from "../ui/button";
import { ArrowUpDown } from "lucide-react";
import { Project, RiskArray } from "@/lib/types";
import { Project, RiskArray, Stage } from "@/lib/types";

export const columns: ColumnDef<Project>[] = [
{
Expand Down Expand Up @@ -69,20 +69,22 @@ export const columns: ColumnDef<Project>[] = [
);
},
cell: ({ row }) => {
const stage = row.getValue("stage") as number;
const stage = row.getValue("stage") as Stage;
return (
<TooltipProvider>
<Badge
stage={stage}
className={`${
stage === 0
? "bg-red-500"
: stage === 1
? "bg-yellow-500"
: "bg-green-500"
stage === "R"
? "bg-gray-500"
: stage === 0
? "bg-red-500"
: stage === 1
? "bg-yellow-500"
: "bg-green-500"
} text-white py-1 rounded "text-lg"`}
>
{"Stage " + stage}
{stage === "R" ? "In Review" : "Stage " + stage}
</Badge>
</TooltipProvider>
);
Expand Down
21 changes: 14 additions & 7 deletions src/components/ui/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
TooltipTrigger,
} from "../rosette/tooltip/tooltip";
import { stageToRequisites } from "@/app/protocols/stageToRequisites";
import { Stage } from "@/lib/types";

const badgeVariants = cva(
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
Expand All @@ -32,7 +33,7 @@ const badgeVariants = cva(
export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> {
stage: number;
stage: Stage;
}

// Badge component
Expand All @@ -50,19 +51,25 @@ function Badge({ className, variant, stage, ...props }: BadgeProps) {
}

// BadgeTooltip component
export function BadgeTooltip({ stage }: { stage: number }) {
export function BadgeTooltip({ stage }: { stage: Stage }) {
return (
<div className="flex flex-col">
<span className="text-base font-bold">
<span className="mr-2">Stage of Decentralisation</span>
</span>
<div className="flex items-center gap-6">
<div className="relative flex flex-col justify-center p-4 shadow-md max-w-md">
{stageToRequisites[stage].map((item, index) => (
<div key={index} className="mt-1">
{item}
</div>
))}
{stage === "R"
? stageToRequisites[0].map((item, index) => (
<div key={index} className="mt-1">
{item}
</div>
))
: stageToRequisites[stage].map((item, index) => (
<div key={index} className="mt-1">
{item}
</div>
))}
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/content/protocols/maverick-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ x: "https://x.com/mavprotocol"
github: "https://github.com/maverickprotocol"
defillama_slug: ["maverick-v2"]
chain: "Ethereum"
stage: 0
stage: "R"
risks: ["L", "H", "M", "H", "H"]
author: ["CookingCryptos", "sagaciousyves"]
submission_date: "2024-10-23"
Expand All @@ -14,6 +14,8 @@ acknowledge_date: "1970-01-01"
update_date: "1970-01-01"
---

> ⚠️ MaverickV2Factory is NOT verified on a public block explorer. For the MaverickV2Factory we currently rely on the technical documentation provided by the Maverick Team. As a consequence the full scope of permissions and their definitive impact cannot be assessed.
# Summary

Maverick is a DEX supporting concentrated liquidity positions for LPs and the automation thereof with the goal of increasing capital efficiency and market liquidity. This results in better prices for traders and more fees for liquidity providers. This built-in feature also helps LPs to eliminate the high gas fees that come from adjusting positions around price themselves.
Expand All @@ -38,8 +40,6 @@ On other contracts permissions still exist and are not protected with adequate r

As a result, these existing permissions potentially result in the arbitrary minting of new MAV tokens that dillute the overall supply and thus lead to the theft or loss of user funds (in particular unclaimed rewards that are distributed in the MAV token).

> ⚠️ MaverickV2Factory is NOT verified on a public block explorer. For the MaverickV2Factory we currently rely on the technical documentation provided by the Maverick Team. As a consequence the full scope of permissions and their definitive impact cannot be assessed.
> Upgradeability score: H
## Autonomy
Expand Down
3 changes: 2 additions & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
export type RiskLevel = "L" | "M" | "H";
export type Stage = "R" | 0 | 1 | 2;
export type RiskArray = [RiskLevel, RiskLevel, RiskLevel, RiskLevel, RiskLevel];

export type Project = {
logo: string;
protocol: string;
slug: string;
stage: number;
stage: Stage;
risks: RiskArray;
type: string;
chain: string;
Expand Down
2 changes: 1 addition & 1 deletion velite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const protocols = defineCollection({
github: s.string(),
defillama_slug: s.array(s.string()),
chain: s.string(),
stage: s.number(),
stage: s.number().gte(0).lte(2).or(s.literal("R")),
risks: s.tuple([
s.literal("L").or(s.literal("M")).or(s.literal("H")),
s.literal("L").or(s.literal("M")).or(s.literal("H")),
Expand Down

0 comments on commit 23784b1

Please sign in to comment.