Skip to content

Commit

Permalink
added blacklisted proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitindenis1 committed Jul 23, 2023
1 parent b802226 commit 81d9b65
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
13 changes: 8 additions & 5 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const releaseMode = import.meta.env.VITE_STAGING
export const IS_DEV = releaseMode === ReleaseMode.DEVELOPMENT;

export const createDaoDevFee = 0.2;
export const createDaoProdFee = 1.1
export const createDaoProdFee = 1.1;

export const TX_FEES = {
CREATE_DAO: IS_DEV ? createDaoDevFee : 1,
Expand Down Expand Up @@ -147,7 +147,7 @@ export const STRATEGY_ARGUMENTS = [
{ name: "jetton", key: "jetton-address" },
{ name: "nft", key: "nft-address" },
];

export const TELEGRAM_SUPPORT_GROUP = "https://t.me/TONVoteSupportGroup/82";
export const PROD_TEST_DAOS: string[] = [];

Expand All @@ -162,6 +162,9 @@ export const CONTRACT_RETRIES = 2;

export const RETRY_DELAY = 1000;



export const BLACKLISTED_DAOS = ["EQAQiTI1QkaCpIYAqdEO4mRTIzACq7WNlhNzt2voUnE4qxKy"];
export const BLACKLISTED_DAOS = [
"EQAQiTI1QkaCpIYAqdEO4mRTIzACq7WNlhNzt2voUnE4qxKy",
];
export const BLACKLISTED_PROPOSALS = [
"EQAGgwt5WA6fBcD_OgEKXOEDLjto5X9SyOmOP-NOrn19sxtZ",
];
24 changes: 17 additions & 7 deletions src/query/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
IS_DEV,
PROD_TEST_DAOS,
REFETCH_INTERVALS,
BLACKLISTED_PROPOSALS,
} from "config";
import { Dao, Proposal } from "types";
import _ from "lodash";
Expand Down Expand Up @@ -221,15 +222,21 @@ export const useDaoQuery = (daoAddress: string) => {
}

const proposals = addNewProposals(daoAddress!, dao.daoProposals);
const daoProposals = IS_DEV
let daoProposals = IS_DEV
? _.concat(proposals, mock.proposalAddresses)
: proposals;

daoProposals = _.filter(
daoProposals,
(it) => !BLACKLISTED_PROPOSALS.includes(it)
);

if (daoAddress === FOUNDATION_DAO_ADDRESS) {
daoProposals = FOUNDATION_PROPOSALS_ADDRESSES;
}
return {
...dao,
daoProposals:
daoAddress === FOUNDATION_DAO_ADDRESS
? FOUNDATION_PROPOSALS_ADDRESSES
: daoProposals,
daoProposals,
};
},
{
Expand Down Expand Up @@ -288,7 +295,6 @@ export const useConnectedWalletVotingPowerQuery = (
const symbol = getProposalSymbol(
proposal?.metadata?.votingPowerStrategies
);


if (getIsOneWalletOneVote(proposal?.metadata?.votingPowerStrategies)) {
return {
Expand All @@ -299,7 +305,7 @@ export const useConnectedWalletVotingPowerQuery = (

return {
votingPowerText: `${nFormatter(Number(fromNano(result)))} ${symbol}`,
votingPower: result,
votingPower: result,
};
},
{
Expand Down Expand Up @@ -404,6 +410,10 @@ export const useProposalQuery = (
if (!isWhitelisted) {
throw new Error("Proposal not whitelisted");
}

if (BLACKLISTED_PROPOSALS.includes(proposalAddress)) {
throw new Error("Proposal not found");
}
const mockProposal = mock.getMockProposal(proposalAddress!);
if (mockProposal) {
return mockProposal;
Expand Down

0 comments on commit 81d9b65

Please sign in to comment.