Skip to content

Commit

Permalink
fix: don't pass undefined as voter in matching estimates, pass zeroAd…
Browse files Browse the repository at this point in the history
…dy insteadˆ
  • Loading branch information
vacekj committed Oct 13, 2023
1 parent ebc5b74 commit 5c54fb3
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ import { getRoundById } from "../../api/round";
import MRCProgressModal from "../../common/MRCProgressModal";
import { MRCProgressModalBody } from "./MRCProgressModalBody";
import { useCheckoutStore } from "../../../checkoutStore";
import { Address, formatUnits, getAddress, parseUnits } from "viem";
import {
Address,
formatUnits,
getAddress,
parseUnits,
zeroAddress,
} from "viem";
import { useConnectModal } from "@rainbow-me/rainbowkit";
import {
matchingEstimatesToText,
Expand Down Expand Up @@ -288,21 +294,21 @@ export function SummaryContainer() {
rounds?.map((round) => {
const projs = projects.find((project) => project.roundId === round.id);
return {
roundId: getAddress(round.id ?? ""),
roundId: getAddress(round.id ?? zeroAddress),
chainId: projs?.chainId ?? ChainId.MAINNET,
potentialVotes: projects.map((proj) => ({
amount: parseUnits(
proj.amount ?? "0",
getVotingTokenForChain(parseChainId(proj.chainId)).decimal ?? 18
),
grantAddress: proj.recipient,
voter: address as Address,
voter: address ?? zeroAddress,
token: getVotingTokenForChain(
parseChainId(proj.chainId)
).address.toLowerCase(),
projectId: proj.projectRegistryId,
applicationId: proj.grantApplicationId,
roundId: getAddress(round.id ?? ""),
roundId: getAddress(round.id ?? zeroAddress),
})),
};
}) ?? [];
Expand Down

0 comments on commit 5c54fb3

Please sign in to comment.