Skip to content

Commit

Permalink
Quorum calc
Browse files Browse the repository at this point in the history
  • Loading branch information
andreitr committed Jun 12, 2024
1 parent 4abfb36 commit 2b1b186
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/api/common/quorum/getQuorum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ async function getQuorumForProposal(proposal: ProposalPayload) {

switch (namespace) {
case "optimism": {
const contractQuorum = contracts.governor.contract.quorum(
proposal.proposal_id
const contractQuorum = await contracts.governor.contract.quorum(
proposal.proposal_id,
);

// If no quorum is set, calculate it based on votable supply
if (!contractQuorum) {
const votableSupply = await prisma[
`${namespace}VotableSupply`
].findFirst({});
].findFirst({});
return (BigInt(Number(votableSupply?.votable_supply)) * 30n) / 100n;
}

Expand Down

0 comments on commit 2b1b186

Please sign in to comment.