Skip to content

Commit

Permalink
Merge pull request #63 from l2beat/main
Browse files Browse the repository at this point in the history
[pull] main from l2beat:main
  • Loading branch information
pull[bot] authored Jan 3, 2025
2 parents 05c4626 + 76c3265 commit 1fb5d61
Show file tree
Hide file tree
Showing 33 changed files with 376 additions and 81 deletions.
8 changes: 8 additions & 0 deletions packages/config/src/projects/layer2s/facet.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { EthereumAddress } from '@l2beat/shared-pure'
import { UnixTime } from '@l2beat/shared-pure/build/types/UnixTime'
import { OPERATOR, RISK_VIEW } from '../../common'
import { REASON_FOR_BEING_OTHER } from '../../common/ReasonForBeingInOther'
Expand Down Expand Up @@ -36,6 +37,13 @@ export const facet: Layer2 = opStackL2({
},
activityDataSource: 'Blockchain RPC',
},
nonTemplateEscrows: [
discovery.getEscrowDetails({
address: EthereumAddress('0x0000000000000b07ED001607f5263D85bf28Ce4C'),
tokens: ['ETH'],
description: 'Fast bridge contract.',
}),
],
riskView: {
stateValidation: RISK_VIEW.STATE_NONE,
dataAvailability: RISK_VIEW.DATA_ON_CHAIN,
Expand Down
26 changes: 18 additions & 8 deletions packages/config/src/verification/status/isVerified.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,25 @@ export function isVerified(

const manual = getManuallyVerifiedContracts()
const contractsVerification =
project.contracts?.addresses.every(
(c) =>
('isVerified' in c && c.isVerified) ||
('address' in c && c.address in (manual[c.chain ?? 'ethereum'] ?? {})),
) ?? true
project.contracts?.addresses.every((c) => {
const isAutoVerified = 'isVerified' in c && c.isVerified
const isManuallyVerified =
'address' in c && c.address in (manual[c.chain ?? 'ethereum'] ?? {})
return isAutoVerified || isManuallyVerified
}) ?? true
const escrowVerifications =
project.config.escrows.every((c) =>
'contract' in c ? c.contract.isVerified : true,
) ?? true
project.config.escrows.every((c) => {
if (!('contract' in c)) {
return true
}
const isManuallyVerified =
'address' in c.contract &&
typeof c.contract.address === 'string' &&
c.contract.address in (manual[c.chain] ?? {})

return c.contract.isVerified || isManuallyVerified
}) ?? true

const newVerification = escrowVerifications && contractsVerification

return newVerification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ export function ProjectsUsedIn({

const nMoreComponent = noTooltip ? (
<span className="text-2xs text-zinc-800 dark:text-gray-50">
+ {rest.length} more
+{rest.length} more
</span>
) : (
<Tooltip>
<TooltipTrigger>
<span className="text-2xs leading-none text-zinc-800 dark:text-gray-50">
+ {rest.length} more
+{rest.length} more
</span>
</TooltipTrigger>
<TooltipContent className="flex flex-col">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'
import { type Milestone } from '@l2beat/config'
import { ProjectId } from '@l2beat/shared-pure'
import { useMemo } from 'react'
import { CountBadge } from '~/components/badge/count-badge'
import { ActivityChart } from '~/components/chart/activity/activity-chart'
import {
Expand All @@ -10,6 +11,7 @@ import {
DirectoryTabsTrigger,
} from '~/components/core/directory-tabs'
import { HorizontalSeparator } from '~/components/core/horizontal-separator'
import { OtherMigrationTabNotice } from '~/components/countdowns/other-migration/other-migration-tab-notice'
import {
OthersInfo,
RollupsInfo,
Expand Down Expand Up @@ -40,6 +42,17 @@ export function ScalingActivityTabs({
others: others.filter(includeFilters),
}

const projectToBeMigratedToOthers = useMemo(
() =>
[...rollups, ...validiumsAndOptimiums, ...others]
.filter((project) => project.statuses?.countdowns?.otherMigration)
.map((project) => ({
slug: project.slug,
name: project.name,
})),
[others, rollups, validiumsAndOptimiums],
)

const initialSort = {
id: 'data_pastDayCount',
desc: true,
Expand Down Expand Up @@ -122,6 +135,10 @@ export function ScalingActivityTabs({
<HorizontalSeparator className="mb-3 mt-5" />
<OthersInfo />
<ScalingActivityTable entries={filteredEntries.others} />
<OtherMigrationTabNotice
projectsToBeMigrated={projectToBeMigratedToOthers}
className="mt-2"
/>
</DirectoryTabsContent>
</TableSortingProvider>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client'
import { type Milestone } from '@l2beat/config'
import { useMemo } from 'react'
import { CountBadge } from '~/components/badge/count-badge'
import { ScalingCostsChart } from '~/components/chart/costs/scaling-costs-chart'
import {
Expand All @@ -9,6 +10,7 @@ import {
DirectoryTabsTrigger,
} from '~/components/core/directory-tabs'
import { HorizontalSeparator } from '~/components/core/horizontal-separator'
import { OtherMigrationTabNotice } from '~/components/countdowns/other-migration/other-migration-tab-notice'
import { OthersInfo, RollupsInfo } from '~/components/scaling-tabs-info'
import { TableSortingProvider } from '~/components/table/sorting/table-sorting-context'
import { type ScalingCostsEntry } from '~/server/features/scaling/costs/get-scaling-costs-entries'
Expand All @@ -29,6 +31,17 @@ export function ScalingCostsTabs(props: Props) {
others: props.others.filter(includeFilters),
}

const projectToBeMigratedToOthers = useMemo(
() =>
[...props.rollups, ...props.validiumsAndOptimiums, ...props.others]
.filter((project) => project.statuses?.countdowns?.otherMigration)
.map((project) => ({
slug: project.slug,
name: project.name,
})),
[props.others, props.rollups, props.validiumsAndOptimiums],
)

const initialSort = {
id: '#',
desc: false,
Expand Down Expand Up @@ -79,6 +92,10 @@ export function ScalingCostsTabs(props: Props) {
<HorizontalSeparator className="my-5" />
<OthersInfo />
<ScalingCostsTable entries={filteredEntries.others} />
<OtherMigrationTabNotice
projectsToBeMigrated={projectToBeMigratedToOthers}
className="mt-2"
/>
</DirectoryTabsContent>
</TableSortingProvider>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
'use client'
import { useMemo } from 'react'
import { CountBadge } from '~/components/badge/count-badge'
import {
DirectoryTabs,
DirectoryTabsContent,
DirectoryTabsList,
DirectoryTabsTrigger,
} from '~/components/core/directory-tabs'
import { OtherMigrationTabNotice } from '~/components/countdowns/other-migration/other-migration-tab-notice'
import {
OthersInfo,
RollupsInfo,
Expand All @@ -28,6 +30,18 @@ export function ScalingDaTables(props: Props) {
validiumsAndOptimiums: props.validiumsAndOptimiums.filter(includeFilters),
others: props.others.filter(includeFilters),
}

const projectToBeMigratedToOthers = useMemo(
() =>
[...props.rollups, ...props.validiumsAndOptimiums, ...props.others]
.filter((project) => project.statuses?.countdowns?.otherMigration)
.map((project) => ({
slug: project.slug,
name: project.name,
})),
[props.others, props.rollups, props.validiumsAndOptimiums],
)

const initialSort = {
id: '#',
desc: false,
Expand Down Expand Up @@ -82,6 +96,10 @@ export function ScalingDaTables(props: Props) {
<DirectoryTabsContent value="others">
<OthersInfo />
<ScalingDataAvailabilityTable entries={filteredEntries.others} />
<OtherMigrationTabNotice
projectsToBeMigrated={projectToBeMigratedToOthers}
className="mt-2"
/>
</DirectoryTabsContent>
</TableSortingProvider>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
'use client'
import { useMemo } from 'react'
import { CountBadge } from '~/components/badge/count-badge'
import {
DirectoryTabs,
DirectoryTabsContent,
DirectoryTabsList,
DirectoryTabsTrigger,
} from '~/components/core/directory-tabs'
import { OtherMigrationTabNotice } from '~/components/countdowns/other-migration/other-migration-tab-notice'
import { OthersInfo, RollupsInfo } from '~/components/scaling-tabs-info'
import { TableSortingProvider } from '~/components/table/sorting/table-sorting-context'
import { type ScalingFinalityEntry } from '~/server/features/scaling/finality/get-scaling-finality-entries'
Expand All @@ -25,6 +27,17 @@ export function ScalingFinalityTables(props: Props) {
others: props.others.filter(includeFilters),
}

const projectToBeMigratedToOthers = useMemo(
() =>
[...props.rollups, ...props.validiumsAndOptimiums, ...props.others]
.filter((project) => project.statuses?.countdowns?.otherMigration)
.map((project) => ({
slug: project.slug,
name: project.name,
})),
[props.others, props.rollups, props.validiumsAndOptimiums],
)

const initialSort = {
id: '#',
desc: false,
Expand Down Expand Up @@ -61,6 +74,10 @@ export function ScalingFinalityTables(props: Props) {
<DirectoryTabsContent value="others">
<OthersInfo />
<ScalingFinalityTable entries={filteredEntries.others} />
<OtherMigrationTabNotice
projectsToBeMigrated={projectToBeMigratedToOthers}
className="mt-2"
/>
</DirectoryTabsContent>
</TableSortingProvider>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
'use client'

import { useMemo } from 'react'
import { CountBadge } from '~/components/badge/count-badge'
import {
DirectoryTabs,
DirectoryTabsContent,
DirectoryTabsList,
DirectoryTabsTrigger,
} from '~/components/core/directory-tabs'
import { OtherMigrationTabNotice } from '~/components/countdowns/other-migration/other-migration-tab-notice'
import { OthersInfo, RollupsInfo } from '~/components/scaling-tabs-info'
import { TableSortingProvider } from '~/components/table/sorting/table-sorting-context'
import { type ScalingLivenessEntry } from '~/server/features/scaling/liveness/get-scaling-liveness-entries'
Expand All @@ -28,6 +30,17 @@ export function ScalingLivenessTables(props: Props) {
others: props.others.filter(includeFilters),
}

const projectToBeMigratedToOthers = useMemo(
() =>
[...props.rollups, ...props.validiumsAndOptimiums, ...props.others]
.filter((project) => project.statuses?.countdowns?.otherMigration)
.map((project) => ({
slug: project.slug,
name: project.name,
})),
[props.others, props.rollups, props.validiumsAndOptimiums],
)

const initialSort = {
id: '#',
desc: false,
Expand Down Expand Up @@ -64,6 +77,10 @@ export function ScalingLivenessTables(props: Props) {
<DirectoryTabsContent value="others">
<OthersInfo />
<ScalingLivenessTable entries={filteredEntries.others} />
<OtherMigrationTabNotice
projectsToBeMigrated={projectToBeMigratedToOthers}
className="mt-2"
/>
</DirectoryTabsContent>
</TableSortingProvider>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
'use client'
import { useMemo } from 'react'
import { CountBadge } from '~/components/badge/count-badge'
import {
DirectoryTabs,
DirectoryTabsContent,
DirectoryTabsList,
DirectoryTabsTrigger,
} from '~/components/core/directory-tabs'
import { OtherMigrationTabNotice } from '~/components/countdowns/other-migration/other-migration-tab-notice'
import {
OthersInfo,
RollupsInfo,
Expand All @@ -29,6 +31,17 @@ export function ScalingRiskTables(props: Props) {
others: props.others.filter(includeFilters),
}

const projectToBeMigratedToOthers = useMemo(
() =>
[...props.rollups, ...props.validiumsAndOptimiums, ...props.others]
.filter((project) => project.statuses?.countdowns?.otherMigration)
.map((project) => ({
slug: project.slug,
name: project.name,
})),
[props.others, props.rollups, props.validiumsAndOptimiums],
)

const initialSort = {
id: '#',
desc: false,
Expand Down Expand Up @@ -79,6 +92,10 @@ export function ScalingRiskTables(props: Props) {
<DirectoryTabsContent value="others">
<OthersInfo />
<ScalingRiskTable entries={filteredEntries.others} />
<OtherMigrationTabNotice
projectsToBeMigrated={projectToBeMigratedToOthers}
className="mt-2"
/>
</DirectoryTabsContent>
</TableSortingProvider>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client'
import { useMemo } from 'react'
import { CountBadge } from '~/components/badge/count-badge'
import {
DirectoryTabs,
Expand All @@ -7,6 +8,7 @@ import {
DirectoryTabsTrigger,
} from '~/components/core/directory-tabs'
import { HorizontalSeparator } from '~/components/core/horizontal-separator'
import { OtherMigrationTabNotice } from '~/components/countdowns/other-migration/other-migration-tab-notice'
import {
OthersInfo,
RollupsInfo,
Expand All @@ -17,7 +19,6 @@ import { type ScalingSummaryEntry } from '~/server/features/scaling/summary/get-
import { type TabbedScalingEntries } from '~/utils/group-by-tabs'
import { useScalingFilter } from '../../_components/scaling-filter-context'
import { ScalingSummaryFilters } from '../../_components/scaling-summary-filters'
import { OthersComingSoonNotice } from './table/others-coming-soon-notice'
import { ScalingSummaryOthersTable } from './table/scaling-summary-others-table'
import { ScalingSummaryRollupsTable } from './table/scaling-summary-rollups-table'
import { ScalingSummaryValidiumsAndOptimiumsTable } from './table/scaling-summary-validiums-and-optimiums-table'
Expand All @@ -32,6 +33,17 @@ export function ScalingSummaryTables(props: Props) {
others: props.others.filter(includeFilters),
}

const projectToBeMigratedToOthers = useMemo(
() =>
[...props.rollups, ...props.validiumsAndOptimiums, ...props.others]
.filter((project) => project.statuses?.countdowns?.otherMigration)
.map((project) => ({
slug: project.slug,
name: project.name,
})),
[props.others, props.rollups, props.validiumsAndOptimiums],
)

const initialSort = {
id: 'total',
desc: true,
Expand Down Expand Up @@ -80,14 +92,12 @@ export function ScalingSummaryTables(props: Props) {
</TableSortingProvider>
<TableSortingProvider initialSort={initialSort}>
<DirectoryTabsContent value="others">
{filteredEntries.others.length > 0 ? (
<>
<OthersInfo />
<ScalingSummaryOthersTable entries={filteredEntries.others} />
</>
) : (
<OthersComingSoonNotice />
)}
<OthersInfo />
<ScalingSummaryOthersTable entries={filteredEntries.others} />
<OtherMigrationTabNotice
projectsToBeMigrated={projectToBeMigratedToOthers}
className="mt-2"
/>
</DirectoryTabsContent>
</TableSortingProvider>
</DirectoryTabs>
Expand Down
Loading

0 comments on commit 1fb5d61

Please sign in to comment.