Skip to content

Commit

Permalink
refactor: Update Hey treasury constant and references
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed Mar 6, 2025
1 parent ffce00f commit d02940a
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import LoginButton from "@components/Shared/LoginButton";
import NoBalanceError from "@components/Shared/NoBalanceError";
import trackEvent from "@helpers/analytics";
import errorToast from "@helpers/errorToast";
import { COLLECT_FEES_WALLET } from "@hey/data/constants";
import { HEY_TREASURY } from "@hey/data/constants";
import { Errors } from "@hey/data/errors";
import { Events } from "@hey/data/events";
import getCollectActionData from "@hey/helpers/getCollectActionData";
Expand Down Expand Up @@ -136,7 +136,7 @@ const CollectActionButton: FC<CollectActionButtonProps> = ({
action: {
simpleCollect: {
selected: true,
referrals: [{ address: COLLECT_FEES_WALLET, percent: 5 }]
referrals: [{ address: HEY_TREASURY, percent: 5 }]
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/Shared/Modal/TipHey.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APP_NAME, COLLECT_FEES_WALLET } from "@hey/data/constants";
import { APP_NAME, HEY_TREASURY } from "@hey/data/constants";
import { H4 } from "@hey/ui";
import type { FC } from "react";
import Fund from "../Fund/FundAccount/Fund";
Expand All @@ -20,7 +20,7 @@ const TipHey: FC<TipHeyProps> = ({ onSuccess }) => {
Support the growth and development of {APP_NAME} by giving a tip.
</div>
</div>
<Fund isHeyTip onSuccess={onSuccess} recipient={COLLECT_FEES_WALLET} />
<Fund isHeyTip onSuccess={onSuccess} recipient={HEY_TREASURY} />
</div>
);
};
Expand Down
45 changes: 45 additions & 0 deletions apps/web/src/components/Staff/Overview/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Loader from "@components/Shared/Loader";
import { BLOCK_EXPLORER_URL, HEY_APP, HEY_TREASURY } from "@hey/data/constants";
import { Card, CardHeader, ErrorMessage, NumberedStat } from "@hey/ui";
import Link from "next/link";
import type { FC } from "react";
import { formatEther } from "viem";
import { useBalance } from "wagmi";

const App: FC = () => {
const { data, isLoading, error } = useBalance({
address: HEY_TREASURY,
query: { refetchInterval: 2000 }
});

return (
<Card>
<CardHeader title="App" />
{isLoading ? (
<Loader className="my-10" message="Loading App..." />
) : error ? (
<ErrorMessage error={error} title="Failed to load App" />
) : (
<div className="m-5">
<div className="space-y-5">
<div className="linkify font-bold">
<Link
href={`${BLOCK_EXPLORER_URL}/address/${HEY_APP}`}
target="_blank"
>
Open App Contract in Explorer
</Link>
</div>
<NumberedStat
count={formatEther(data?.value || BigInt(0))}
name="Treasury Balance"
suffix="GHO"
/>
</div>
</div>
)}
</Card>
);
};

export default App;
2 changes: 1 addition & 1 deletion apps/web/src/components/Staff/Overview/Sponsorship.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Sponsorship: FC = () => {
</div>
<NumberedStat
count={formatEther(data?.value || BigInt(0))}
name="Balance"
name="Sponsorship Balance"
suffix="GHO"
/>
</div>
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/components/Staff/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { NextPage } from "next";
import Custom404 from "src/pages/404";
import { useAccountStore } from "src/store/persisted/useAccountStore";
import StaffSidebar from "../Sidebar";
import App from "./App";
import Sponsorship from "./Sponsorship";

const Overview: NextPage = () => {
Expand All @@ -24,6 +25,7 @@ const Overview: NextPage = () => {
<StaffSidebar />
</GridItemFour>
<GridItemEight className="space-y-5">
<App />
<Sponsorship />
</GridItemEight>
</GridLayout>
Expand Down
2 changes: 1 addition & 1 deletion packages/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const LENS_API_URL = getEnvConfig().lensApiEndpoint;
export const DEFAULT_COLLECT_TOKEN = getEnvConfig().defaultCollectToken;
export const HEY_APP = getEnvConfig().appAddress;
export const HEY_SPONSOR = getEnvConfig().sponsorAddress;
export const HEY_TREASURY = "0x03Ba34f6Ea1496fa316873CF8350A3f7eaD317EF";
export const HEY_API_PRODUCTION_URL = "https://hey-api.up.railway.app";
export const HEY_API_URL = IS_PRODUCTION
? HEY_API_PRODUCTION_URL
Expand All @@ -20,7 +21,6 @@ export const HEY_API_URL = IS_PRODUCTION
export const IS_MAINNET = LENS_API_URL === LensEndpoint.Mainnet;
export const ADDRESS_PLACEHOLDER = "0x03Ba3...7EF";
export const NULL_ADDRESS = "0x0000000000000000000000000000000000000000";
export const COLLECT_FEES_WALLET = "0x03Ba34f6Ea1496fa316873CF8350A3f7eaD317EF";

// Application
export const APP_NAME = "Hey";
Expand Down

0 comments on commit d02940a

Please sign in to comment.