Skip to content

Commit

Permalink
Merge pull request #1051 from TempleDAO/stage
Browse files Browse the repository at this point in the history
Stage -> main
  • Loading branch information
marshall2112 authored Jun 28, 2024
2 parents 287cfde + 2cfc953 commit 404a78c
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 54 deletions.
3 changes: 2 additions & 1 deletion apps/dapp/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"react/prop-types": "off",
"no-console": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
"react/react-in-jsx-scope": "off",
"react/no-array-index-key": "error"
},
"settings": {
"react": {
Expand Down
1 change: 1 addition & 0 deletions apps/dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},
"scripts": {
"typechain": "typechain --target=ethers-v5 --out-dir src/types/typechain --glob abi/**/*.json",
"lint": "eslint ./src",
"prepare": "yarn typechain && yarn codegen:safe-api-v1",
"dev": "vite",
"compile": "tsc",
Expand Down
4 changes: 2 additions & 2 deletions apps/dapp/src/components/Layouts/Ascend/PillMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const PillMenu = ({ links }: Props) => {
return (
<MenuWrapper>
<Menu>
{links.map(({ to, label, onClick }, i) => (
<MenuLink key={i} to={!!onClick ? '#' : to} onClick={onClick}>
{links.map(({ to, label, onClick }) => (
<MenuLink key={to} to={!!onClick ? '#' : to} onClick={onClick}>
{label}
</MenuLink>
))}
Expand Down
8 changes: 4 additions & 4 deletions apps/dapp/src/components/Layouts/V2Layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ const Footer: React.FC = () => {
return (
<FooterContainer>
<LinkRow>
{FooterContent.map((col, i) => (
<Links key={i}>
{FooterContent.map((col) => (
<Links key={col.header}>
<h4>{col.header}</h4>
<ul>
{col.links.map((link, j) => (
<li key={j}>
{col.links.map((link) => (
<li key={link.text}>
<a href={link.link} target="_blank" rel="noreferrer">
<FooterImage src={link.image} alt={link.text} />
<strong>{link.text}</strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ const DashboardMetrics = ({ dashboardData }: DashboardMetricsProps) => {
<>
<MobileMetricsContainer>
{sourceData.metrics.map((row, idx) => (
// eslint-disable-next-line react/no-array-index-key
<Fragment key={idx}>
{row.map((metric, idx) => (
<MobileMetricRow key={idx}>
{row.map((metric) => (
<MobileMetricRow key={metric.title}>
<MobileMetricTitle>{metric.title}</MobileMetricTitle>
<MobileMetricValue>{metric.value}</MobileMetricValue>
</MobileMetricRow>
Expand All @@ -37,9 +38,10 @@ const DashboardMetrics = ({ dashboardData }: DashboardMetricsProps) => {
<MobileMetricsContainer small>
{sourceData.smallMetrics.map((row, idx) => (
// TODO: The MobileMetricsContainer for small should be .. smaller
// eslint-disable-next-line react/no-array-index-key
<Fragment key={idx}>
{row.map((metric, idx) => (
<MobileMetricRow key={idx}>
{row.map((metric) => (
<MobileMetricRow key={metric.title}>
<MobileMetricTitle>{metric.title}</MobileMetricTitle>
<MobileMetricValue>{metric.value}</MobileMetricValue>
</MobileMetricRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export const PageRangeSelector = (props: Props) => {

return (
<>
{paginationRange.map((pageNumber, i) => {
{paginationRange.map((pageNumber) => {
if (pageNumber === -1)
return <DotsContainer key={i + 'dots'}>...</DotsContainer>;
return <DotsContainer key={pageNumber}>...</DotsContainer>;
return (
<PageLink
key={pageNumber}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export const RowFilterDropdown = (props: Props) => {
<FilterButton onClick={() => setDropdownOpened(!dropdownOpened)} />
{dropdownOpened && (
<DropdownOptionsContainer ref={ref}>
{dropdownOptions.map((op, idx) => (
<DropdownOption key={idx} isChecked={op.checked}>
{dropdownOptions.map((op) => (
<DropdownOption key={op.label} isChecked={op.checked}>
<RadioCheckbox
id={op.label}
defaultChecked={op.checked}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const TxnDataTable = (props: Props) => {
<DataTable isBiggerThanTablet={isBiggerThanPhone}>
<thead>
<HeaderRow>
{tableHeaders.map((h, i) => (
{tableHeaders.map((h) => (
<TableHeader
key={h.name}
isHidden={h.isHidden}
Expand Down Expand Up @@ -205,12 +205,14 @@ const loadSkeletonRows = (
skeletonColumnsNo: number
) => {
return [...Array(skeletonRowsNo)].map((_, index) => (
// eslint-disable-next-line react/no-array-index-key
<DataRow hasBorderBotton key={index}>
{[...Array(skeletonColumnsNo)].map(
(
_,
i // Adds x no of loading cells, same as no of table headers
) => (
// eslint-disable-next-line react/no-array-index-key
<DataCell key={i}>
<LoadingText value={loading()} />
</DataCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,22 @@ export default function useDashboardV2Metrics(dashboardData: DashboardData) {
fetchGenericSubgraph<any>(
env.subgraph.templeV2,
`{
treasuryReservesVaults {
totalMarketValueUSD
treasuryPriceIndex
principalUSD
accruedInterestUSD
benchmarkedEquityUSD
}
}`
treasuryReservesVaults {
treasuryPriceIndex
principalUSD
accruedInterestUSD
}
}`
),
// includes the external balances so has to come from the second subgraph
fetchGenericSubgraph<any>(
env.subgraph.templeV2Balances,
`{
treasuryReservesVaults {
totalMarketValueUSD
benchmarkedEquityUSD
}
}`
),
getBenchmarkRate(),
getTempleCirculatingSupply(),
Expand All @@ -200,6 +208,7 @@ export default function useDashboardV2Metrics(dashboardData: DashboardData) {

const [
trvSubgraphResponse,
responseExternalBalances,
benchmarkRate,
templeCirculatingSupply,
templeSpotPrice,
Expand All @@ -208,15 +217,18 @@ export default function useDashboardV2Metrics(dashboardData: DashboardData) {
const trvSubgraphData =
trvSubgraphResponse?.data?.treasuryReservesVaults[0];

const externalBalancesData =
responseExternalBalances?.data?.treasuryReservesVaults[0];

metrics = {
totalMarketValue: parseFloat(trvSubgraphData.totalMarketValueUSD),
totalMarketValue: parseFloat(externalBalancesData.totalMarketValueUSD),
spotPrice: parseFloat(templeSpotPrice),
treasuryPriceIndex: parseFloat(trvSubgraphData.treasuryPriceIndex),
circulatingSupply: parseFloat(templeCirculatingSupply),
benchmarkRate: parseFloat(benchmarkRate),
principal: parseFloat(trvSubgraphData.principalUSD),
accruedInterest: parseFloat(trvSubgraphData.accruedInterestUSD),
benchmarkedEquity: parseFloat(trvSubgraphData.benchmarkedEquityUSD),
benchmarkedEquity: parseFloat(externalBalancesData.benchmarkedEquityUSD),
};
} catch (error) {
console.info(error);
Expand Down
41 changes: 14 additions & 27 deletions apps/dapp/src/components/Pages/Core/NewUI/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,14 @@ const Home = ({ tlc }: { tlc?: boolean }) => {
useEffect(() => {
const fetchMetrics = async () => {
const { data: treasuryData } = await fetchGenericSubgraph<any>(
env.subgraph.protocolMetrics,
env.subgraph.templeV2Balances,
`{
metrics {
treasuryValueUSD
}
}`
);
const { data: arbitrumTreasuryData } = await fetchGenericSubgraph<any>(
env.subgraph.protocolMetricsArbitrum,
`{
metrics {
treasuryValueUSD
}
}`
treasuryReservesVaults {
principalUSD
benchmarkedEquityUSD
treasuryPriceIndex
}
}`
);
const { data: ramosData } = await fetchGenericSubgraph<any>(
env.subgraph.ramos,
Expand All @@ -130,20 +124,13 @@ const Home = ({ tlc }: { tlc?: boolean }) => {
}`
);

const { data: tpiData } = await fetchGenericSubgraph<any>(
env.subgraph.templeV2,
`{
tpiOracles {
currentTpi
}
}`
);
const treasuryMetrics = treasuryData.treasuryReservesVaults[0];
setMetrics({
price: parseFloat(ramosData.metrics[0].spotPrice),
tpi: parseFloat(tpiData.tpiOracles[0].currentTpi),
tpi: parseFloat(treasuryMetrics.treasuryPriceIndex),
treasury:
parseFloat(treasuryData.metrics[0].treasuryValueUSD) +
parseFloat(arbitrumTreasuryData.metrics[0].treasuryValueUSD),
parseFloat(treasuryMetrics.principalUSD) +
parseFloat(treasuryMetrics.benchmarkedEquityUSD),
});
};
fetchMetrics();
Expand Down Expand Up @@ -210,7 +197,7 @@ const Home = ({ tlc }: { tlc?: boolean }) => {
{/* Marketing content */}
<Header>How Does It Work?</Header>
{MarketingContent.map((content, index) => (
<MarketingRow index={index} key={index}>
<MarketingRow index={index} key={content.header}>
<MarketingImage src={content.image} />
<MarketingTextWrapper>
<MarketingHeader>{content.header}</MarketingHeader>
Expand All @@ -233,11 +220,11 @@ const Home = ({ tlc }: { tlc?: boolean }) => {
<FooterContainer>
<LinkRow>
{FooterContent.map((col, i) => (
<Links key={i}>
<Links key={col.header}>
<h4>{col.header}</h4>
<ul>
{col.links.map((link, j) => (
<li key={j}>
<li key={link.text}>
<a href={link.link} target="_blank" rel="noreferrer">
<FooterImage src={link.image} alt={link.text} />
<strong>{link.text}</strong>
Expand Down
2 changes: 2 additions & 0 deletions apps/dapp/src/components/Pages/Safe/admin/SafeTxDataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,14 @@ const loadSkeletonRows = (
skeletonColumnsNo: number
) => {
return [...Array(skeletonRowsNo)].map((_, index) => (
// eslint-disable-next-line react/no-array-index-key
<DataRow hasBorderBotton key={index}>
{[...Array(skeletonColumnsNo)].map(
(
_,
i // Adds x no of loading cells, same as no of table headers
) => (
// eslint-disable-next-line react/no-array-index-key
<DataCell key={i}>
<LoadingText value={loading()} />
</DataCell>
Expand Down
4 changes: 4 additions & 0 deletions apps/dapp/src/constants/env/production.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ const env: Environment = {
name: 'Epoch 24b',
address: '0xc6E01D796C39CBbA16278a8C29e7C1267DC48A8f',
},
{
name: 'Epoch 24c',
address: '0x96288cF99b16Bd857781d4B7d49b60887D30Bf4E',
},
],
temple: '0x470ebf5f030ed85fc1ed4c2d36b9dd02e77cf1b7',
templeStaking: '0x4D14b24EDb751221B3Ff08BBB8bd91D4b1c8bc77',
Expand Down
2 changes: 2 additions & 0 deletions protocol/scripts/deploys/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ interface TeamPayments {
TEMPLE_TEAM_EPOCH_23C: string;
TEMPLE_TEAM_EPOCH_24A: string;
TEMPLE_TEAM_EPOCH_24B: string;
TEMPLE_TEAM_EPOCH_24C: string;
}

export interface DeployedContracts {
Expand Down Expand Up @@ -309,6 +310,7 @@ export const DEPLOYED_CONTRACTS: { [key: string]: DeployedContracts } = {
TEMPLE_TEAM_EPOCH_23C: '0x5e6E4E6Eb6D45e4bC7837e483F106AE25FA52472',
TEMPLE_TEAM_EPOCH_24A: '0x85dFEC13117e3f7594e4e391F300E781f5609881',
TEMPLE_TEAM_EPOCH_24B: '0xc6E01D796C39CBbA16278a8C29e7C1267DC48A8f',
TEMPLE_TEAM_EPOCH_24C: '0x96288cF99b16Bd857781d4B7d49b60887D30Bf4E',
},

TEMPLE_TEAM_PAYMENTS_IMPLEMENTATION: '',
Expand Down
2 changes: 1 addition & 1 deletion protocol/scripts/deploys/mainnet/team-payments/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
expectAddressWithPrivateKey,
toAtto,
} from '../../helpers';
import snapshot from './json/epoch24b.json';
import snapshot from './json/epoch24c.json';

// TODO: Add command line arguments for json allocations file
async function main() {
Expand Down
21 changes: 21 additions & 0 deletions protocol/scripts/deploys/mainnet/team-payments/json/epoch24c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"0xDd10BE8f410CEa5340343aE676eccD8D68CEC239": 10000,
"0x6e85a8c802dcA39bEB4cE6Eb4C6acD1eB2742564": 10000,
"0xe345e9605391c13Fd2502e7141D54b752AaDB184": 12000,
"0x1cCbe98Ce51d3ba16A5F29b7f970c3e101ded67f": 10000,
"0x038D946DD8488237D8E710a45b6E801F1Ee4dc01": 14000,
"0x9F7eE729DDE0D95ffCf69F5606D534Ee47b303C0": 20000,
"0xBc099EAdc19e672b454fF6a06d08c541B3a1E850": 20000,
"0x97Ec4001aD1d2a1FBb581ea34C5C0Bd4a210C25C": 42500,
"0x588282ADA5B9D872d0eBF506c5C1b541e2a60BBa": 14000,
"0x07dA99dff5F996FaD9FCe0e15a20edC4DBeAe028": 5500,
"0x14d62c8faC60d71714F54bd3f7dF18433475968b": 15000,
"0xE58C06c3372687039140ceb64cB05f78D71fA133": 2450,
"0x62370003cEbacd6415d32375095FFc8AB7238eBC": 250,
"0xB8C400E4E9360ae7a3480A2F63e2A5aA85696148": 250,
"0x072d76b501E364FCA58B6A7fe16a88c74D64924c": 600,
"0x0AAA67dcbBD86dBd1F0c260F50fb9FB3A941138A": 500,
"0xe07d083d4A8810E5b35300a6De579fB2AF525e2F": 5000,
"0xFD1b05E51653339c850c8a18c9Ac11Aed9105F2A": 8000,
"0xDBdB110c59881bE60e12e5F6c54032dA8cA814CE": 375
}

0 comments on commit 404a78c

Please sign in to comment.