Skip to content

Commit

Permalink
Merge pull request #959 from TempleDAO/stage
Browse files Browse the repository at this point in the history
stage -> main
  • Loading branch information
frontier159 authored Jan 31, 2024
2 parents f3d8ab4 + 9149e88 commit 93ecd5c
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export enum DashboardType {
TEMPLE_BASE,
DSR_BASE,
TEMPLO_MAYOR_GNOSIS,
FOHMO_GNOSIS,
}

type DashboardContentProps = {
Expand All @@ -39,7 +40,8 @@ const DashboardContent = ({ selectedDashboard = DashboardType.TREASURY_RESERVES_
StrategyKey.TEMPLEBASE,
StrategyKey.RAMOS,
StrategyKey.DSRBASE,
StrategyKey.TEMPLO_MAYOR_GNOSIS
StrategyKey.TEMPLO_MAYOR_GNOSIS,
StrategyKey.FOHMO_GNOSIS,
],
link: `${env.etherscan}/address/${env.contracts.treasuryReservesVault}`,
},
Expand Down Expand Up @@ -78,6 +80,13 @@ const DashboardContent = ({ selectedDashboard = DashboardType.TREASURY_RESERVES_
chartStrategyNames: [StrategyKey.TEMPLO_MAYOR_GNOSIS],
link: `${env.etherscan}/address/${env.contracts.strategies.temploMayorGnosisStrategy}`,
},
[DashboardType.FOHMO_GNOSIS]: {
title: 'Fohmo',
description:
'',
chartStrategyNames: [StrategyKey.FOHMO_GNOSIS],
link: `${env.etherscan}/address/${env.contracts.strategies.fohmoGnosisStrategy}`,
},
};

const dashboard = dashboardData[selectedDashboard];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const TxnHistoryTable = (props: Props) => {
{ label: StrategyKey.TEMPLEBASE, checked: false },
{ label: StrategyKey.DSRBASE, checked: false },
{ label: StrategyKey.TEMPLO_MAYOR_GNOSIS, checked: false },
{ label: StrategyKey.FOHMO_GNOSIS, checked: false },
],
[]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum StrategyKey {
TEMPLEBASE = 'TempleBaseStrategy',
DSRBASE = 'DsrBaseStrategy',
TEMPLO_MAYOR_GNOSIS = 'TemploMayorStrategy',
FOHMO_GNOSIS = 'FohmoStrategy',
ALL = 'All',
}

Expand Down Expand Up @@ -121,6 +122,16 @@ export default function useDashboardV2Metrics(dashboardType: DashboardType) {
staleTime: CACHE_TTL,
});

const fohmoGnosisMetrics = useQuery({
queryKey: getQueryKey.metrics(StrategyKey.FOHMO_GNOSIS),
queryFn: async () => {
const metrics = await fetchStrategyMetrics(StrategyKey.FOHMO_GNOSIS);
return metrics;
},
refetchInterval: CACHE_TTL,
staleTime: CACHE_TTL,
});

const dashboardMetrics = useQuery({
queryKey: getQueryKey.metricsDashboard(dashboardType),
queryFn: () => {
Expand All @@ -137,9 +148,11 @@ export default function useDashboardV2Metrics(dashboardType: DashboardType) {
return dsrBaseMetrics.data && getArrangedStrategyMetrics(dsrBaseMetrics.data);
case DashboardType.TEMPLO_MAYOR_GNOSIS:
return temploMayorGnosisMetrics.data && getArrangedStrategyMetrics(temploMayorGnosisMetrics.data);
case DashboardType.FOHMO_GNOSIS:
return fohmoGnosisMetrics.data && getArrangedStrategyMetrics(fohmoGnosisMetrics.data);
}
},
enabled: !!treasuryReservesVaultMetrics.data && !!tlcMetrics.data && !!ramosMetrics.data && !!templeBaseMetrics.data && !!dsrBaseMetrics.data && !!temploMayorGnosisMetrics.data
enabled: !!treasuryReservesVaultMetrics.data && !!tlcMetrics.data && !!ramosMetrics.data && !!templeBaseMetrics.data && !!dsrBaseMetrics.data && !!temploMayorGnosisMetrics.data && !!fohmoGnosisMetrics.data
})

const fetchStrategyMetrics = async (strategy: StrategyKey): Promise<StrategyMetrics> => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export const dashboardTypeToStrategyKey = (dType: DashboardType): StrategyKey =>
return StrategyKey.TEMPLEBASE;
case DashboardType.TEMPLO_MAYOR_GNOSIS:
return StrategyKey.TEMPLO_MAYOR_GNOSIS;
case DashboardType.FOHMO_GNOSIS:
return StrategyKey.FOHMO_GNOSIS;
default:
return StrategyKey.ALL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export const DashboardPage = () => {
<NavCell>
<NavLink to={`templomayor?${params}`}>TEMPLO MAYOR</NavLink>
</NavCell>
<NavCell>
<NavLink to={`fohmo?${params}`}>FOHMO</NavLink>
</NavCell>
</DashboardHeaderNav>
<DashboardContentContainer>
<Routes>
Expand All @@ -42,6 +45,7 @@ export const DashboardPage = () => {
<Route path="templebase" element={<DashboardContent selectedDashboard={DashboardType.TEMPLE_BASE} />} />
<Route path="dsrbase" element={<DashboardContent selectedDashboard={DashboardType.DSR_BASE} />} />
<Route path="templomayor" element={<DashboardContent selectedDashboard={DashboardType.TEMPLO_MAYOR_GNOSIS} />} />
<Route path="fohmo" element={<DashboardContent selectedDashboard={DashboardType.FOHMO_GNOSIS} />} />
</Routes>
</DashboardContentContainer>
</DashboardContainer>
Expand Down
1 change: 1 addition & 0 deletions apps/dapp/src/constants/env/local.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const env: Environment = {
templeStrategy: '',
tlcStrategy: '',
temploMayorGnosisStrategy: '',
fohmoGnosisStrategy: '',
}
},
infuraId: '4cd22916292d4fb6be156454978c326b',
Expand Down
1 change: 1 addition & 0 deletions apps/dapp/src/constants/env/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const env: Environment = {
templeStrategy: '0xECe4ff1bd589b488350557A5C36D823C7B47E82F',
tlcStrategy: '0x415A9B41700AC645d9C22F2499a6E853b625F792',
temploMayorGnosisStrategy: '',
fohmoGnosisStrategy: '',
}
},
subgraph: {
Expand Down
1 change: 1 addition & 0 deletions apps/dapp/src/constants/env/production.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const env: Environment = {
templeStrategy: '0xB8d09B0436adF927004Cea0B096E8c05f6dFdc3b',
tlcStrategy: '0xcABDE42dd767361739bD7c09C6E574057080ef01',
temploMayorGnosisStrategy: '0xb28FEC0EE90680EE25d42e8101159a72E359be7c',
fohmoGnosisStrategy: '0xF179C63735690d2C08cfb231d15c0c7ac3A2Bc67',
},
},
gas: {
Expand Down
1 change: 1 addition & 0 deletions apps/dapp/src/constants/env/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface Contracts {
templeStrategy: string;
tlcStrategy: string;
temploMayorGnosisStrategy: string;
fohmoGnosisStrategy: string;
};
ramosPoolHelper: string;
balancerHelpers: string;
Expand Down
10 changes: 10 additions & 0 deletions protocol/slither.db.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
[
{
"elements": [],
"description": "solc-0.8.24 is not recommended for deployment\n",
"markdown": "solc-0.8.24 is not recommended for deployment\n",
"first_markdown_element": "",
"id": "5b3032c03c822484605a22ef7032b1feee37ab38b444706606c34e6d9527629b",
"check": "solc-version",
"impact": "Informational",
"confidence": "High"
},
{
"elements": [
{
Expand Down

0 comments on commit 93ecd5c

Please sign in to comment.