diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..39c60f6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Ethereum Foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..062e717 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "DefinitelySetup", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/web/src/context/StateContext.tsx b/web/src/context/StateContext.tsx index 7fde008..bb2ab89 100644 --- a/web/src/context/StateContext.tsx +++ b/web/src/context/StateContext.tsx @@ -123,7 +123,8 @@ export const useInitialStateContext = () => { // 2. Post-process data. const ceremonies: CeremonyDocumentReferenceAndData[] = docs.map((document: DocumentData) => { return { uid: document.id, data: document.data() } }) - const projects: Project[] = ceremonies.map((ceremony: CeremonyDocumentReferenceAndData) => { return { ceremony: ceremony } }) + const ceremoniesVisibleInWeb = ceremonies.filter((ceremony) => ceremony.data.hideInWeb !== true) + const projects: Project[] = ceremoniesVisibleInWeb.map((ceremony: CeremonyDocumentReferenceAndData) => { return { ceremony: ceremony } }) const queue: WaitingQueue[] = [] for (const project of projects) { @@ -134,7 +135,7 @@ export const useInitialStateContext = () => { } setWaitingQueue(queue) - // 3. Store data. + // 3. Store data. setProjects(projects) setLoading(false) } @@ -142,14 +143,14 @@ export const useInitialStateContext = () => { setRunTutorial(true) fetchData() - + },[]) return { waitingQueue, projects, setProjects, circuit, setCircuit, search, setSearch, loading, setLoading, runTutorial, setRunTutorial }; }; export const StateProvider: React.FC = ({ children }) => { - + const [user, setUser] = useState( localStorage.getItem("username") || undefined ); diff --git a/web/src/helpers/constants.ts b/web/src/helpers/constants.ts index 271cf3a..d14fb1f 100644 --- a/web/src/helpers/constants.ts +++ b/web/src/helpers/constants.ts @@ -178,4 +178,4 @@ export const projectId = import.meta.env.VITE_FIREBASE_PROJECT_ID export const messagingSenderId = import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID export const appId = import.meta.env.VITE_FIREBASE_APP_ID export const awsRegion = import.meta.env.VITE_AWS_REGION -export const maxConstraintsForBrowser = 1500000 \ No newline at end of file +export const maxConstraintsForBrowser = 1500000 diff --git a/web/src/helpers/interfaces.ts b/web/src/helpers/interfaces.ts index e116d32..76087f3 100644 --- a/web/src/helpers/interfaces.ts +++ b/web/src/helpers/interfaces.ts @@ -171,6 +171,7 @@ export interface CeremonyDocument { type: CeremonyType coordinatorId: string lastUpdated: number + hideInWeb?: boolean } /** @@ -494,9 +495,9 @@ export interface ZkeyDownloadLink { * @property {number} waitingQueue - the number of participants in the waiting queue. */ export interface WaitingQueue { - ceremonyName: string - circuitName: string - waitingQueue: number + ceremonyName: string + circuitName: string + waitingQueue: number } /** @@ -513,7 +514,7 @@ export interface Project { circuits?: CircuitDocumentReferenceAndData[] | null participants?: ParticipantDocumentReferenceAndData[] | null contributions?: ContributionDocumentReferenceAndData[] | null - coordinatorId?: string + coordinatorId?: string } export interface State { @@ -578,6 +579,6 @@ export type StateProviderProps = { * @property {string} hash - the hash of the beacon. */ export interface FinalBeacon { - beacon: string + beacon: string beaconHash: string -} \ No newline at end of file +} diff --git a/web/src/pages/LandingPage/HeroComponent.tsx b/web/src/pages/LandingPage/HeroComponent.tsx index 5ad80ff..b6181fd 100644 --- a/web/src/pages/LandingPage/HeroComponent.tsx +++ b/web/src/pages/LandingPage/HeroComponent.tsx @@ -66,4 +66,4 @@ export function HeroComponent({ projects, waitingQueue }: HeroComponentProps) { ); -} +} \ No newline at end of file diff --git a/web/src/pages/ProjectPage.tsx b/web/src/pages/ProjectPage.tsx index 8537129..96c56f1 100644 --- a/web/src/pages/ProjectPage.tsx +++ b/web/src/pages/ProjectPage.tsx @@ -100,7 +100,7 @@ const ProjectPage: React.FC = () => { maxTiming: Math.round((Number(circuit.data.avgTimings?.fullContribution) * 1.618) / 1000) })) ?? []; - // parse contributions and sort by zkey name + // parse contributions and sort by zkey name. FIlter for valid contribs. const contributionsClean = validatedProjectData.contributions?.map((contribution) => ({ doc: contribution.data.files?.lastZkeyFilename ?? "", @@ -112,7 +112,9 @@ const ProjectPage: React.FC = () => { contribution.data?.files?.transcriptBlake2bHash ?? "", 10 ) - })).slice().sort((a: any, b: any) => { + })).slice() + .filter((c: any) => c.valid) + .sort((a: any, b: any) => { const docA = a.doc.toLowerCase() const docB = b.doc.toLowerCase()