diff --git a/src/components/Proposals/ProposalSummary.tsx b/src/components/Proposals/ProposalSummary.tsx index 3357332046..854805b0cf 100644 --- a/src/components/Proposals/ProposalSummary.tsx +++ b/src/components/Proposals/ProposalSummary.tsx @@ -87,7 +87,10 @@ export default function ProposalSummary({ const strategyQuorum = votesToken && isERC20 - ? votingStrategy.quorumPercentage!.value.toNumber() + ? votingStrategy + .quorumPercentage!.value.mul(100) + .div(votingStrategy.quorumDenominator?.value || 1000000) + .toNumber() : isERC721 ? votingStrategy.quorumThreshold!.value.toNumber() : 1; diff --git a/src/hooks/DAO/loaders/governance/useERC20LinearStrategy.ts b/src/hooks/DAO/loaders/governance/useERC20LinearStrategy.ts index ac79bd084d..2941fe72d7 100644 --- a/src/hooks/DAO/loaders/governance/useERC20LinearStrategy.ts +++ b/src/hooks/DAO/loaders/governance/useERC20LinearStrategy.ts @@ -28,12 +28,15 @@ export const useERC20LinearStrategy = () => { if (!ozLinearVotingContract || !azoriusContract) { return {}; } - const [votingPeriodBlocks, quorumNumerator, timeLockPeriod] = await Promise.all([ - ozLinearVotingContract.asSigner.votingPeriod(), - ozLinearVotingContract.asSigner.quorumNumerator(), - azoriusContract.asSigner.timelockPeriod(), - ]); + const [votingPeriodBlocks, quorumNumerator, quorumDenominator, timeLockPeriod] = + await Promise.all([ + ozLinearVotingContract.asSigner.votingPeriod(), + ozLinearVotingContract.asSigner.quorumNumerator(), + ozLinearVotingContract.asSigner.QUORUM_DENOMINATOR(), + azoriusContract.asSigner.timelockPeriod(), + ]); + const quorumPercentage = quorumNumerator.mul(100).div(quorumDenominator); const votingPeriodValue = await blocksToSeconds(votingPeriodBlocks, provider); const timeLockPeriodValue = await blocksToSeconds(timeLockPeriod, provider); const votingData = { @@ -42,8 +45,11 @@ export const useERC20LinearStrategy = () => { formatted: getTimeDuration(votingPeriodValue), }, quorumPercentage: { - value: quorumNumerator, - formatted: quorumNumerator.toString() + '%', + value: quorumPercentage, + formatted: quorumPercentage.toString() + '%', + }, + quorumDenominator: { + value: quorumDenominator, }, timeLockPeriod: { value: BigNumber.from(timeLockPeriodValue), diff --git a/src/models/AzoriusTxBuilder.ts b/src/models/AzoriusTxBuilder.ts index 59dd244c4e..82c19eb08a 100644 --- a/src/models/AzoriusTxBuilder.ts +++ b/src/models/AzoriusTxBuilder.ts @@ -384,7 +384,7 @@ export class AzoriusTxBuilder extends BaseTxBuilder { '0x0000000000000000000000000000000000000001', // Azorius module azoriusGovernanceDaoData.votingPeriod, BigNumber.from(1), // proposer weight, how much is needed to create a proposal. - azoriusGovernanceDaoData.quorumPercentage, // quorom numerator, denominator is 1,000,000, so quorum percentage is 50% + azoriusGovernanceDaoData.quorumPercentage.mul(10000), // quorom numerator, denominator is 1,000,000, so quorum percentage is quorumNumerator * 100 / quorumDenominator BigNumber.from(500000), // basis numerator, denominator is 1,000,000, so basis percentage is 50% (simple majority) ] ); diff --git a/src/types/fractal.ts b/src/types/fractal.ts index 63a996aebd..8bb8cf946b 100644 --- a/src/types/fractal.ts +++ b/src/types/fractal.ts @@ -308,6 +308,7 @@ export interface VotingStrategyAzorius extends VotingStrategy { export interface VotingStrategy { votingPeriod?: Type; quorumPercentage?: Type; + quorumDenominator?: Type; quorumThreshold?: Type; timeLockPeriod?: Type; }