Skip to content

Commit

Permalink
Merge pull request Synthetixio#226 from Synthetixio/remove-dilution
Browse files Browse the repository at this point in the history
Remove dilution. Election module does not have support for that yet
  • Loading branch information
0xjocke authored Jul 7, 2022
2 parents 737bc30 + 4dee9b1 commit 9d742a3
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions packages/queries/src/queries/gov/useProposalQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import request, { gql } from 'graphql-request';
import { SPACE_KEY } from './constants';
import { QueryContext } from '../../context';

import CouncilDilution from '../../contracts/CouncilDilution';
import { getOVMProvider } from './utils';

const useProposalQuery = (
_: QueryContext,
snapshotEndpoint: string,
Expand Down Expand Up @@ -147,31 +144,6 @@ const useProposalQuery = (
);
}

/* Apply dilution penalties for SIP/SCCP pages */
if (spaceKey === SPACE_KEY.PROPOSAL) {
const contract = new ethers.Contract(
CouncilDilution.address,
CouncilDilution.abi,
getOVMProvider()
);
mappedVotes = await Promise.all(
mappedVotes.map(async (vote) => {
const dilutedValueBN = await contract.getDilutedWeightForProposal(
hash,
getAddress(vote.voter)
);
const diluteValueNumber = Number(ethers.utils.formatEther(dilutedValueBN));

const dilutedResult = vote.balance * diluteValueNumber;
return {
...vote,
balance: dilutedResult,
scores: [dilutedResult],
};
})
);
}

const returnVoteHistory = () => {
if (walletAddress && voterAddresses.includes(getAddress(walletAddress))) {
const index = mappedVotes.findIndex(
Expand Down

0 comments on commit 9d742a3

Please sign in to comment.