From 14c225d09ad5c85cb0e2784e00a129ec48fd003f Mon Sep 17 00:00:00 2001 From: 0xKurt Date: Thu, 8 May 2025 13:55:20 +0200 Subject: [PATCH 1/3] quick celo round fix --- .../src/features/round/ViewFundGrantees.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/round-manager/src/features/round/ViewFundGrantees.tsx b/packages/round-manager/src/features/round/ViewFundGrantees.tsx index 1dfa6d6b55..6ad6a97537 100644 --- a/packages/round-manager/src/features/round/ViewFundGrantees.tsx +++ b/packages/round-manager/src/features/round/ViewFundGrantees.tsx @@ -295,6 +295,13 @@ export function PayProjectsTable(props: { ); + const getAnchorAddress = async (chainId?: number, poolId?: string) => { + if (chainId === 42220 && poolId === "27") { + return "0x91F824424Ec66F129E0DaCA8151eaD5e3bD89E5F"; + } + return ""; + }; + const handleFundGrantees = async () => { setShowConfirmationModal(false); setOpenReadyForDistributionProgressModal(true); @@ -304,6 +311,22 @@ export function PayProjectsTable(props: { } if (roundId) { + // check if all anchoraddresses are set, if undefined, console.log please + const anchorAddresses = selectedProjects.map((p) => p.anchorAddress); + if (anchorAddresses.some((address) => address === undefined)) { + const anchorAddress = await getAnchorAddress( + props.round.chainId, + props.round.payoutStrategy.id + ); + + const updatedProjects = selectedProjects.map((p) => ({ + ...p, + anchorAddress: anchorAddress, + })); + + setSelectedProjects(updatedProjects); + } + const result = await allo .batchDistributeFunds({ payoutStrategyOrPoolId: From d1f9a4f73c23741f8de1e59d68ccce36f7c357c4 Mon Sep 17 00:00:00 2001 From: 0xKurt Date: Sat, 10 May 2025 09:13:22 +0200 Subject: [PATCH 2/3] try fix --- .../api/payoutStrategy/payoutStrategy.ts | 12 +++++++-- .../src/features/round/ViewFundGrantees.tsx | 27 +++---------------- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/packages/round-manager/src/features/api/payoutStrategy/payoutStrategy.ts b/packages/round-manager/src/features/api/payoutStrategy/payoutStrategy.ts index a02bd0fba9..bf7592c8c5 100644 --- a/packages/round-manager/src/features/api/payoutStrategy/payoutStrategy.ts +++ b/packages/round-manager/src/features/api/payoutStrategy/payoutStrategy.ts @@ -60,9 +60,17 @@ export const useGroupProjectsByPaymentStatus = ( const paidProjectIds = paidProjects?.map((project) => project.projectId); + const matchingDistribution = round.matchingDistribution; + + // filter out matchingDistribution with projectId "0x0DD5CC8755C6e4247364012Bb0AC99Cd5ED136D2" + const filteredMatchingDistribution = matchingDistribution?.filter( + (project) => + project.projectId !== "0x0DD5CC8755C6e4247364012Bb0AC99Cd5ED136D2" + ); + const allProjects: MatchingStatsData[] = useMemo( () => - round.matchingDistribution?.map((matchingStatsData) => { + filteredMatchingDistribution?.map((matchingStatsData) => { const anchorAddress = applications?.find( (application) => application.projectId === matchingStatsData.projectId )?.anchorAddress; @@ -83,7 +91,7 @@ export const useGroupProjectsByPaymentStatus = ( projectPayoutAddress: matchingStatsData.projectPayoutAddress, }; }) ?? [], - [round.matchingDistribution, applications] + [filteredMatchingDistribution, applications] ); useEffect(() => { diff --git a/packages/round-manager/src/features/round/ViewFundGrantees.tsx b/packages/round-manager/src/features/round/ViewFundGrantees.tsx index 6ad6a97537..1dad0568c0 100644 --- a/packages/round-manager/src/features/round/ViewFundGrantees.tsx +++ b/packages/round-manager/src/features/round/ViewFundGrantees.tsx @@ -257,6 +257,8 @@ export function PayProjectsTable(props: { }, [selectedProjects, props.projects]); function toggleAll() { + console.log("toggleAll", checked, indeterminate); + console.log("props.projects", props.projects); setSelectedProjects(checked || indeterminate ? [] : props.projects); setChecked(!checked && !indeterminate); setIndeterminate(false); @@ -295,13 +297,6 @@ export function PayProjectsTable(props: { ); - const getAnchorAddress = async (chainId?: number, poolId?: string) => { - if (chainId === 42220 && poolId === "27") { - return "0x91F824424Ec66F129E0DaCA8151eaD5e3bD89E5F"; - } - return ""; - }; - const handleFundGrantees = async () => { setShowConfirmationModal(false); setOpenReadyForDistributionProgressModal(true); @@ -311,22 +306,6 @@ export function PayProjectsTable(props: { } if (roundId) { - // check if all anchoraddresses are set, if undefined, console.log please - const anchorAddresses = selectedProjects.map((p) => p.anchorAddress); - if (anchorAddresses.some((address) => address === undefined)) { - const anchorAddress = await getAnchorAddress( - props.round.chainId, - props.round.payoutStrategy.id - ); - - const updatedProjects = selectedProjects.map((p) => ({ - ...p, - anchorAddress: anchorAddress, - })); - - setSelectedProjects(updatedProjects); - } - const result = await allo .batchDistributeFunds({ payoutStrategyOrPoolId: @@ -388,6 +367,8 @@ export function PayProjectsTable(props: { } }; + console.log("selectedProjects", selectedProjects); + return (
From cc3d8a153501265e684b8a41819106b431047eb0 Mon Sep 17 00:00:00 2001 From: 0xKurt Date: Sat, 10 May 2025 14:36:20 +0200 Subject: [PATCH 3/3] fix checklist --- .../src/features/round/ViewFundGrantees.tsx | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/round-manager/src/features/round/ViewFundGrantees.tsx b/packages/round-manager/src/features/round/ViewFundGrantees.tsx index 1dad0568c0..183766ab82 100644 --- a/packages/round-manager/src/features/round/ViewFundGrantees.tsx +++ b/packages/round-manager/src/features/round/ViewFundGrantees.tsx @@ -428,28 +428,32 @@ export function PayProjectsTable(props: { p.projectId === project.projectId + ) ? "bg-gray-50" : undefined } > - {selectedProjects.includes(project) && ( + {selectedProjects.some( + (p) => p.projectId === project.projectId + ) && (
)} p.projectId === project.projectId + )} onChange={(e) => { setSelectedProjects( e.target.checked ? [...selectedProjects, project] : selectedProjects.filter( - (p) => - p.projectPayoutAddress !== - project.projectPayoutAddress + (p) => p.projectId !== project.projectId ) ); }} @@ -458,7 +462,9 @@ export function PayProjectsTable(props: { p.projectId === project.projectId + ) ? "text-indigo-600" : "text-gray-900" )} @@ -534,7 +540,7 @@ export function PayProjectsTable(props: { title="Warning!" body={
- You don’t have enough funds in the contract to pay out the selected + You don't have enough funds in the contract to pay out the selected grantees. Please either add more funds to the contract or select fewer grantees.