Skip to content

Commit

Permalink
chore: remove unnecessary deps and env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlc03 committed Aug 12, 2024
1 parent d71bb81 commit 587b6a4
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 633 deletions.
1 change: 0 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
NEXT_PUBLIC_APPROVAL_SCHEMA: ${{ vars.NEXT_PUBLIC_APPROVAL_SCHEMA }}
NEXT_PUBLIC_METADATA_SCHEMA: ${{ vars.NEXT_PUBLIC_METADATA_SCHEMA }}
NEXT_PUBLIC_ROUND_ID: ${{ vars.NEXT_PUBLIC_ROUND_ID }}
NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK: false
NEXT_PUBLIC_MACI_ADDRESS: ${{ vars.NEXT_PUBLIC_MACI_ADDRESS }}
NEXT_PUBLIC_TALLY_URL: ${{ vars.NEXT_PUBLIC_TALLY_URL }}
NEXT_PUBLIC_WALLETCONNECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_ID }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/contracts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
NEXT_PUBLIC_APPROVAL_SCHEMA: ${{ vars.NEXT_PUBLIC_APPROVAL_SCHEMA }}
NEXT_PUBLIC_METADATA_SCHEMA: ${{ vars.NEXT_PUBLIC_METADATA_SCHEMA }}
NEXT_PUBLIC_ROUND_ID: ${{ vars.NEXT_PUBLIC_ROUND_ID }}
NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK: false
NEXT_PUBLIC_MACI_ADDRESS: ${{ vars.NEXT_PUBLIC_MACI_ADDRESS }}
NEXT_PUBLIC_TALLY_URL: ${{ vars.NEXT_PUBLIC_TALLY_URL }}
NEXT_PUBLIC_WALLETCONNECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_ID }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/coordinator-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ env:
NEXT_PUBLIC_APPROVAL_SCHEMA: ${{ vars.NEXT_PUBLIC_APPROVAL_SCHEMA }}
NEXT_PUBLIC_METADATA_SCHEMA: ${{ vars.NEXT_PUBLIC_METADATA_SCHEMA }}
NEXT_PUBLIC_ROUND_ID: ${{ vars.NEXT_PUBLIC_ROUND_ID }}
NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK: false
NEXT_PUBLIC_MACI_ADDRESS: ${{ vars.NEXT_PUBLIC_MACI_ADDRESS }}
NEXT_PUBLIC_TALLY_URL: ${{ vars.NEXT_PUBLIC_TALLY_URL }}
NEXT_PUBLIC_WALLETCONNECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_ID }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ env:
NEXT_PUBLIC_APPROVAL_SCHEMA: ${{ vars.NEXT_PUBLIC_APPROVAL_SCHEMA }}
NEXT_PUBLIC_METADATA_SCHEMA: ${{ vars.NEXT_PUBLIC_METADATA_SCHEMA }}
NEXT_PUBLIC_ROUND_ID: ${{ vars.NEXT_PUBLIC_ROUND_ID }}
NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK: false
NEXT_PUBLIC_MACI_ADDRESS: ${{ vars.NEXT_PUBLIC_MACI_ADDRESS }}
NEXT_PUBLIC_TALLY_URL: ${{ vars.NEXT_PUBLIC_TALLY_URL }}
NEXT_PUBLIC_WALLETCONNECT_ID: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_ID }}
Expand Down
3 changes: 0 additions & 3 deletions packages/interface/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ NEXT_PUBLIC_ADMIN_ADDRESS=
# EAS CONFIGURATION
# -----------------

# Set to true to let anyone vote without an approval attestation
NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK=false

# Schema for approved applications and voters
# (optional)
NEXT_PUBLIC_APPROVAL_SCHEMA=0x858e0bc94997c072d762d90440966759b57c8bca892d4c9447d2eeb205f14c69
Expand Down
17 changes: 0 additions & 17 deletions packages/interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,23 @@
"@ethereum-attestation-service/eas-sdk": "^1.5.0",
"@hatsprotocol/sdk-v1-core": "^0.10.0",
"@hookform/resolvers": "^3.3.4",
"@nivo/boxplot": "^0.84.0",
"@nivo/line": "^0.84.0",
"@pinata/sdk": "^2.1.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@rainbow-me/rainbowkit": "^2.0.1",
"@rainbow-me/rainbowkit-siwe-next-auth": "^0.4.0",
"@semaphore-protocol/core": "4.0.0-beta.16",
"@semaphore-protocol/data": "4.0.0-beta.16",
"@t3-oss/env-nextjs": "^0.8.0",
"@tailwindcss/forms": "^0.5.7",
"@tanstack/react-query": "^5.24.1",
"@testing-library/react": "^14.1.2",
"@trpc/client": "11.0.0-next-beta.294",
"@trpc/next": "11.0.0-next-beta.294",
"@trpc/react-query": "11.0.0-next-beta.294",
"@trpc/server": "11.0.0-next-beta.294",
"@vercel/blob": "^0.19.0",
"clsx": "^2.1.0",
"cmdk": "^0.2.0",
"date-fns": "^3.6.0",
"dotenv": "^16.4.1",
"ethers": "^6.13.1",
"formidable": "^3.5.1",
"graphql-request": "^6.1.0",
"lowdb": "^1.0.0",
"lucide-react": "^0.316.0",
Expand All @@ -54,15 +46,13 @@
"next-themes": "^0.2.1",
"node-fetch-cache": "^4.1.0",
"nuqs": "^1.17.1",
"p-limit": "^5.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.49.3",
"react-icons": "^5.0.1",
"react-markdown": "^9.0.1",
"react-number-format": "^5.3.1",
"react-use": "^17.5.0",
"siwe": "^2.1.4",
"sonner": "^1.4.0",
"superjson": "^2.2.1",
"tailwind-merge": "^2.2.1",
Expand Down Expand Up @@ -107,7 +97,6 @@
"happy-dom": "^13.3.2",
"hardhat": "^2.22.3",
"jsdom": "^24.0.0",
"ky": "^1.2.0",
"lint-staged": "^15.2.7",
"msw": "^2.1.5",
"msw-trpc": "2.0.0-beta.0",
Expand All @@ -118,12 +107,6 @@
"prettier-plugin-tailwindcss": "^0.5.11",
"typescript": "^5.3.3"
},
"ct3aMetadata": {
"initVersion": "7.24.1"
},
"msw": {
"workerDirectory": "public"
},
"jest": {
"moduleFileExtensions": [
"js",
Expand Down
1 change: 0 additions & 1 deletion packages/interface/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export const config = {
startsAt: parseDate(process.env.NEXT_PUBLIC_START_DATE),
registrationEndsAt: parseDate(process.env.NEXT_PUBLIC_REGISTRATION_END_DATE),
resultsAt: parseDate(process.env.NEXT_PUBLIC_RESULTS_DATE),
skipApprovedVoterCheck: ["true", "1"].includes(process.env.NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK!),
tokenName: process.env.NEXT_PUBLIC_TOKEN_NAME!,
eventName: process.env.NEXT_PUBLIC_EVENT_NAME ?? "MACI-PLATFORM",
roundId: process.env.NEXT_PUBLIC_ROUND_ID!,
Expand Down
3 changes: 0 additions & 3 deletions packages/interface/src/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ module.exports = createEnv({
NEXT_PUBLIC_WALLETCONNECT_ID: z.string().optional(),
NEXT_PUBLIC_ALCHEMY_ID: z.string().optional(),

NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK: z.string(),

NEXT_PUBLIC_MACI_ADDRESS: z.string().startsWith("0x"),
NEXT_PUBLIC_MACI_START_BLOCK: z.string().optional(),
NEXT_PUBLIC_MACI_SUBGRAPH_URL: z.string().url().optional(),
Expand Down Expand Up @@ -93,7 +91,6 @@ module.exports = createEnv({

NEXT_PUBLIC_WALLETCONNECT_ID: process.env.NEXT_PUBLIC_WALLETCONNECT_ID,
NEXT_PUBLIC_ALCHEMY_ID: process.env.NEXT_PUBLIC_ALCHEMY_ID,
NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK: process.env.NEXT_PUBLIC_SKIP_APPROVED_VOTER_CHECK,

NEXT_PUBLIC_ADMIN_ADDRESS: process.env.NEXT_PUBLIC_ADMIN_ADDRESS,
NEXT_PUBLIC_APPROVAL_SCHEMA: process.env.NEXT_PUBLIC_APPROVAL_SCHEMA,
Expand Down
8 changes: 0 additions & 8 deletions packages/interface/src/pages/voters/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Alert } from "~/components/ui/Alert";
import { Heading } from "~/components/ui/Heading";
import { config } from "~/config";
import ApproveVoters from "~/features/voters/components/ApproveVoters";
import { VotersList } from "~/features/voters/components/VotersList";
import { AdminLayout } from "~/layouts/AdminLayout";
Expand All @@ -16,12 +14,6 @@ const VotersPage = (): JSX.Element => (
<ApproveVoters />
</div>

{config.skipApprovedVoterCheck ? (
<Alert className="mb-4 " variant="warning">
Configuration has disabled voter approval check. Anyone is an eligible voter.
</Alert>
) : null}

<div className="w-1/2">
<VotersList />
</div>
Expand Down
8 changes: 0 additions & 8 deletions packages/interface/src/utils/fetchAttestations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ export async function fetchAttestations(schema: string[], filter?: AttestationsF
}

export async function fetchApprovedVoter(address: string): Promise<boolean | number> {
if (config.skipApprovedVoterCheck) {
return true;
}

return fetchAttestations([eas.schemas.approval], {
where: {
recipient: { equals: address },
Expand All @@ -40,10 +36,6 @@ export async function fetchApprovedVoter(address: string): Promise<boolean | num
}

export async function fetchApprovedVoterAttestations(address: string): Promise<boolean | Attestation[]> {
if (config.skipApprovedVoterCheck) {
return true;
}

return fetchAttestations([eas.schemas.approval], {
where: {
recipient: { equals: address },
Expand Down
Loading

0 comments on commit 587b6a4

Please sign in to comment.