From c365f122e6f8ecc7b2afb34711fdacabed14b114 Mon Sep 17 00:00:00 2001 From: dekanbro Date: Wed, 13 Sep 2023 09:57:18 -0600 Subject: [PATCH 1/3] offerring should be enforced only for members without delegated shares above sponsor threshold --- libs/moloch-v3-fields/src/fields/ProposalOffering.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/moloch-v3-fields/src/fields/ProposalOffering.tsx b/libs/moloch-v3-fields/src/fields/ProposalOffering.tsx index 8c8577e0..c73c586a 100644 --- a/libs/moloch-v3-fields/src/fields/ProposalOffering.tsx +++ b/libs/moloch-v3-fields/src/fields/ProposalOffering.tsx @@ -29,7 +29,7 @@ export const ProposalOffering = (props: Buildable<{ id?: string }>) => { if ( !connectedMember || - Number(dao.sponsorThreshold) > Number(connectedMember.shares) + Number(dao.sponsorThreshold) > Number(connectedMember.delegateShares) ) { setRequiresOffering(true); setValue(id, dao.proposalOffering); From a865004c854ba4f18b1e221c1099e082ab2ad2f9 Mon Sep 17 00:00:00 2001 From: dekanbro Date: Wed, 13 Sep 2023 10:10:08 -0600 Subject: [PATCH 2/3] allowed sponsor enforment should also happen by delegated shares not holding shares --- .../src/components/ProposalCard/Unsponsored.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/moloch-v3-macro-ui/src/components/ProposalCard/Unsponsored.tsx b/libs/moloch-v3-macro-ui/src/components/ProposalCard/Unsponsored.tsx index 70fc2943..4ed64a7d 100644 --- a/libs/moloch-v3-macro-ui/src/components/ProposalCard/Unsponsored.tsx +++ b/libs/moloch-v3-macro-ui/src/components/ProposalCard/Unsponsored.tsx @@ -97,17 +97,17 @@ export const Unsponsored = ({ }); }; - const hasShares = useMemo(() => { + const hasDelegatedShares = useMemo(() => { if ( dao && - isNumberish(connectedMember?.shares) && + isNumberish(connectedMember?.delegateShares) && isNumberish(dao.sponsorThreshold) ) { - return Number(connectedMember?.shares) >= Number(dao?.sponsorThreshold) + return Number(connectedMember?.delegateShares) >= Number(dao?.sponsorThreshold) ? true : `${fromWei( dao.sponsorThreshold - )} voting stake tokens are required to sponsor this proposal.`; + )} delegated voting stake tokens are required to sponsor this proposal.`; } return 'Subgraph data not loading or is not in sync'; }, [dao, connectedMember]); @@ -138,7 +138,7 @@ export const Unsponsored = ({ From 1bcd9e7a572b17e07d3de874839c062699f36957 Mon Sep 17 00:00:00 2001 From: dekanbro Date: Wed, 13 Sep 2023 12:27:48 -0600 Subject: [PATCH 3/3] lint --- .../src/components/ProposalCard/Unsponsored.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/moloch-v3-macro-ui/src/components/ProposalCard/Unsponsored.tsx b/libs/moloch-v3-macro-ui/src/components/ProposalCard/Unsponsored.tsx index 4ed64a7d..f2cf01c4 100644 --- a/libs/moloch-v3-macro-ui/src/components/ProposalCard/Unsponsored.tsx +++ b/libs/moloch-v3-macro-ui/src/components/ProposalCard/Unsponsored.tsx @@ -103,7 +103,8 @@ export const Unsponsored = ({ isNumberish(connectedMember?.delegateShares) && isNumberish(dao.sponsorThreshold) ) { - return Number(connectedMember?.delegateShares) >= Number(dao?.sponsorThreshold) + return Number(connectedMember?.delegateShares) >= + Number(dao?.sponsorThreshold) ? true : `${fromWei( dao.sponsorThreshold