+
-
+
);
}
diff --git a/src/components/proposals/ProposalCard.tsx b/src/components/proposals/ProposalCard.tsx
index 23f598f7..ea074b87 100644
--- a/src/components/proposals/ProposalCard.tsx
+++ b/src/components/proposals/ProposalCard.tsx
@@ -15,9 +15,9 @@ import { useProposalStatus } from "@/hooks/useProposalStatus";
import { useProposalVote } from "@/hooks/useProposalVote";
import { Button } from "@/components/ui/button";
import { RefreshCw, AlertCircle } from "lucide-react";
-import { motion } from "framer-motion";
import { safeNumberFromBigInt } from "@/utils/proposal";
import { cn } from "@/lib/utils";
+import { motion } from "framer-motion";
interface ProposalCardProps {
proposal: Proposal | ProposalWithDAO;
@@ -101,7 +101,7 @@ export default function ProposalCard({
const quorumPercentage = safeNumberFromBigInt(proposal.voting_quorum);
const thresholdPercentage = safeNumberFromBigInt(proposal.voting_threshold);
- // Calculate if requirements are met
+ // Calculate if requirements are met (using exact floating point comparison)
const metQuorum = calculations.participationRate >= quorumPercentage;
const metThreshold =
calculations.totalVotes > 0
@@ -125,7 +125,7 @@ export default function ProposalCard({
}
if (isActive) {
- return percentage !== undefined ? `${percentage.toFixed(1)}%` : "0%";
+ return percentage !== undefined ? `${percentage.toFixed(4)}%` : "0%";
}
return met ? "Passed" : "Failed";
@@ -162,7 +162,7 @@ export default function ProposalCard({
href={`/proposals/${proposal.id}`}
className="block group cursor-pointer"
>
-
{/*
@@ -625,7 +624,7 @@ details in next post`}
@@ -527,24 +527,23 @@ export function RootDAOPage({ children, daoName }: RootDAOPageProps) {
+
diff --git a/src/config/features.ts b/src/config/features.ts
index f55113d2..c6a2e67a 100644
--- a/src/config/features.ts
+++ b/src/config/features.ts
@@ -1,8 +1,6 @@
// when enabled will show only a single DAO throughout the app
export const enableSingleDaoMode = true;
// only required when single DAO mode is enabled
-export const singleDaoName = "AIBTC-LAX";
-
-// Reward configuration
-// Reward amount in USD for each passed proposal
-export const rewardPerPassedProposal = 50;
+export const singleDaoName = "AIBTC-R1";
+// reward amount in USD for each passed proposal
+export const rewardPerPassedProposal = 1;
{/* Header */}
@@ -715,7 +715,7 @@ const VotingProgressChart = ({
diff --git a/src/components/proposals/ProposalHeader.tsx b/src/components/proposals/ProposalHeader.tsx
index 63614d31..bf88654a 100644
--- a/src/components/proposals/ProposalHeader.tsx
+++ b/src/components/proposals/ProposalHeader.tsx
@@ -51,7 +51,7 @@ export function ProposalHeader({ proposal }: ProposalHeaderProps) {
const quorumPercentage = safeNumberFromBigInt(proposal.voting_quorum);
const thresholdPercentage = safeNumberFromBigInt(proposal.voting_threshold);
- // Calculate if requirements are met
+ // Calculate if requirements are met (using exact floating point comparison)
const metQuorum = calculations.participationRate >= quorumPercentage;
const metThreshold =
calculations.totalVotes > 0
@@ -70,7 +70,7 @@ export function ProposalHeader({ proposal }: ProposalHeaderProps) {
// Helper function to get status text
const getStatusText = (isMet: boolean, percentage: number) => {
if (isMet) return "Passed";
- return `${percentage.toFixed(1)}%`;
+ return `${percentage.toFixed(4)}%`;
};
// Get DAO/token image - prioritize token image, fallback to DAO image if available
diff --git a/src/components/proposals/VotesTable.tsx b/src/components/proposals/VotesTable.tsx
index c3c35108..da323d62 100644
--- a/src/components/proposals/VotesTable.tsx
+++ b/src/components/proposals/VotesTable.tsx
@@ -72,7 +72,7 @@ const VotesTable = ({ proposalId, limit }: VotesTableProps) => {
return (
{typeof finalScore === "number"
- ? finalScore.toFixed(1)
+ ? finalScore.toFixed(4)
: String(finalScore)}
);
@@ -82,7 +82,7 @@ const VotesTable = ({ proposalId, limit }: VotesTableProps) => {
return (
{typeof parsedScore === "number"
- ? parsedScore.toFixed(1)
+ ? parsedScore.toFixed(4)
: String(parsedScore)}
);
diff --git a/src/components/proposals/VotingProgressChart.tsx b/src/components/proposals/VotingProgressChart.tsx
index 3facf42b..44425d6a 100644
--- a/src/components/proposals/VotingProgressChart.tsx
+++ b/src/components/proposals/VotingProgressChart.tsx
@@ -90,7 +90,7 @@ const VotingProgressChart = ({
const quorumPercentage = safeNumberFromBigInt(proposal.voting_quorum);
const thresholdPercentage = safeNumberFromBigInt(proposal.voting_threshold);
- // Calculate if requirements are met
+ // Calculate if requirements are met (using exact floating point comparison)
const metQuorum = calculations.participationRate >= quorumPercentage;
const metThreshold =
calculations.totalVotes > 0
@@ -127,7 +127,7 @@ const VotingProgressChart = ({
return "Met";
}
return percentage !== undefined
- ? `In Progress (${percentage.toFixed(1)}%)`
+ ? `In Progress (${percentage.toFixed(4)}%)`
: "In Progress";
}
@@ -492,7 +492,7 @@ const VotingProgressChart = ({
decimals={8}
variant="abbreviated"
/>{" "}
- ({enhancedCalculations.votesForPercent.toFixed(1)}%)
+ ({enhancedCalculations.votesForPercent.toFixed(4)}%)
) : (
Failed to fetch
@@ -507,7 +507,7 @@ const VotingProgressChart = ({
decimals={8}
variant="abbreviated"
/>{" "}
- ({enhancedCalculations.votesAgainstPercent.toFixed(1)}%)
+ ({enhancedCalculations.votesAgainstPercent.toFixed(4)}%)
) : (
Failed to fetch
@@ -592,7 +592,7 @@ const VotingProgressChart = ({
- Approval: {enhancedCalculations.approvalRate.toFixed(1)}% of votes
+ Approval: {enhancedCalculations.approvalRate.toFixed(4)}% of votes
cast
@@ -658,7 +658,7 @@ const VotingProgressChart = ({
- {enhancedCalculations.participationRate.toFixed(1)}% of{" "}
+ {enhancedCalculations.participationRate.toFixed(4)}% of{" "}
{enhancedCalculations.quorumPercentage}% required
- {enhancedCalculations.approvalRate.toFixed(1)}% of{" "}
+ {enhancedCalculations.approvalRate.toFixed(4)}% of{" "}
{enhancedCalculations.thresholdPercentage}% required