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: