Skip to content

Commit

Permalink
fix: pre-sale
Browse files Browse the repository at this point in the history
  • Loading branch information
MeatDeveloper committed Dec 10, 2023
1 parent f542893 commit 8ff5771
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 52 deletions.
76 changes: 45 additions & 31 deletions app/(general)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
import Image from "next/image"
import Link from "next/link"
import { FaDiscord, FaGithub } from "react-icons/fa"
import { FaDiscord, FaGithub, FaTelegram } from "react-icons/fa"
import { LuBook } from "react-icons/lu"

import { meatAddress, siteConfig } from "@/config/site"
import { cn } from "@/lib/utils"
import { cn, truncateEthAddress } from "@/lib/utils"
import { buttonVariants } from "@/components/ui/button"
import {
PageHeader,
PageHeaderCTA,
PageHeaderDescription,
PageHeaderHeading,
} from "@/components/layout/page-header"
import { truncateEthAddress } from "@/lib/utils"
import { CopyButton } from "@/components/shared/copy-button"
import { LightDarkImage } from "@/components/shared/light-dark-image"

export default function HomePage() {

return (
<div className="container relative mt-20 px-0">
<PageHeader className="pb-8">
<LightDarkImage LightImage={"/logo-light.png"} DarkImage={"/logo-dark.png"} alt={"Meat-Logo"} height={80} width={80} className="h-40 w-40 rounded-2xl" />
<LightDarkImage
LightImage={"/logo-light.png"}
DarkImage={"/logo-dark.png"}
alt={"Meat-Logo"}
height={80}
width={80}
className="h-40 w-40 rounded-2xl"
/>
<PageHeaderHeading>MEAT</PageHeaderHeading>
<PageHeaderDescription>{siteConfig.description}</PageHeaderDescription>
<Link
Expand All @@ -37,27 +43,10 @@ export default function HomePage() {
rel="noreferrer noopener"
className={buttonVariants({ variant: "ghost" })}
>
Multisig Address: {truncateEthAddress("0x1bcDe1E93eF614461E117a8B07957f3600ACA06E")}
Multisig Address:{" "}
{truncateEthAddress("0x1bcDe1E93eF614461E117a8B07957f3600ACA06E")}
</Link>
<PageHeaderCTA>
<Link
href={`https://traderjoexyz.com/avalanche/trade?outputCurrency=${meatAddress}`}
target="_blank"
rel="noreferrer noopener"
className={cn(
buttonVariants(),
"bg-[#F24430] text-white hover:bg-[#F24430]/80"
)}
>
<Image
src="/joe.png"
alt="Joe Logo"
width={20}
height={20}
className="mr-2 h-4 w-4"
/>
Buy
</Link>
<Link
href={siteConfig.links.docs}
className={buttonVariants({ variant: "default" })}
Expand Down Expand Up @@ -86,14 +75,39 @@ export default function HomePage() {
<FaDiscord className="mr-2 h-4 w-4" />
Discord
</Link>
<Link
href={siteConfig.links.telegram}
target="_blank"
rel="noreferrer noopener"
className={cn(
buttonVariants(),
"bg-[#2592c8] text-white hover:bg-[#2592c8]/80"
)}
>
<FaTelegram className="mr-2 h-4 w-4" />
Telegram
</Link>
</PageHeaderCTA>
<PageHeaderCTA>
<Link
href={`https://traderjoexyz.com/avalanche/trade?outputCurrency=${meatAddress}`}
target="_blank"
rel="noreferrer noopener"
className={cn(
buttonVariants(),
"bg-[#F24430] w-32 h-12 text-white hover:bg-[#F24430]/80"
)}
>
<Image
src="/joe.png"
alt="Joe Logo"
width={40}
height={40}
className="mr-2 h-4 w-4"
/>
Buy
</Link>
</PageHeaderCTA>
{/* <PageHeaderCTA>
<CopyButton value="pnpm create turbo-eth@latest">
<span className="text-xs sm:text-base">
pnpm create turbo-eth@latest
</span>
</CopyButton>
</PageHeaderCTA> */}
</PageHeader>
</div>
)
Expand Down
18 changes: 13 additions & 5 deletions app/dashboard/holders/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ import { motion } from "framer-motion"
import { FADE_DOWN_ANIMATION_VARIANTS } from "@/config/design"
import { Card } from "@/components/ui/card"
import { meatAddress } from "@/config/site"
import useSWR from "swr"
import RenderName from "@/components/blockchain/render-name"
import { useNetwork } from "wagmi"
import { trimFormattedBalance } from "@/lib/utils"


const fetcher = (url: string) => fetch(url).then((res) => res.json())
export default function PageDashboardHolders() {
const { chain } = useNetwork()
const endpoint = `https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan/api?module=token&action=tokenholderlist&contractaddress=${meatAddress}&page=1&offset=24&apikey=YourApiKeyToken`
const { data: topHolders } = useSWR(endpoint, fetcher);
return (
<motion.div
animate="show"
Expand All @@ -22,13 +29,14 @@ export default function PageDashboardHolders() {
<p className="text-sm font-light text-gray-400">top holdings</p>

<ul>
{/* {topHolders.map((holder) => (
<li key={holder.address}>
{Array.isArray(topHolders?.result) && topHolders.result?.map((holder : any) => (
<li key={holder.TokenHolderAddress} className="flex justify-between">
<a href={`https://snowtrace.io/address/${holder.address}`} target="_blank" rel="noreferrer">
{holder.address}
<RenderName address={holder?.TokenHolderAddress} chainId={chain?.id} />
</a>
{trimFormattedBalance(String(Number(holder?.TokenHolderQuantity) / 1e6)?.toString(), 0)} {"MEAT"}
</li>
))} */}
))}

</ul>
<hr className="my-3 dark:opacity-30" />
Expand Down
5 changes: 4 additions & 1 deletion app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from "next/link"
import { FaDiscord, FaGithub, FaTwitter } from "react-icons/fa"
import { FaDiscord, FaGithub, FaTwitter, FaTelegram } from "react-icons/fa"

import { menuAdmin } from "@/config/menu-admin"
import { menuDashboard } from "@/config/menu-dashboard"
Expand Down Expand Up @@ -45,6 +45,9 @@ export default function DashboardLayout({ children }: DashboardLayoutProps) {
<Link href={siteConfig.links.github}>
<FaGithub />
</Link>
<Link href={siteConfig.links.telegram}>
<FaTelegram />
</Link>
</div>
</footer>
</aside>
Expand Down
31 changes: 22 additions & 9 deletions app/dashboard/liquidityProviders/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
import { motion } from "framer-motion"

import { FADE_DOWN_ANIMATION_VARIANTS } from "@/config/design"
import { lpAddress } from "@/config/site"
import { Card } from "@/components/ui/card"
import { lpAddress } from "@/config/site"
import useSWR from "swr"
import RenderName from "@/components/blockchain/render-name"
import { useNetwork } from "wagmi"
import { trimFormattedBalance } from "@/lib/utils"

const fetcher = (url: string) => fetch(url).then((res) => res.json())
export default function PageDashboardLPers() {
const { chain } = useNetwork()
const endpoint = `https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan/api?module=token&action=tokenholderlist&contractaddress=${lpAddress}&page=1&offset=25&apikey=YourApiKeyToken`
const { data: topHolders } = useSWR(endpoint, fetcher);
return (
<motion.div
animate="show"
Expand All @@ -16,18 +24,23 @@ export default function PageDashboardLPers() {
viewport={{ once: true }}
whileInView="show"
>
<Card className="w-[420px] p-6">
<h3 className="text-2xl font-normal">Liquidity Providers</h3>
<Card className="w-[420px] p-6">
<h3 className="text-2xl font-normal">Liquidity Providers</h3>
<p className="text-sm font-light text-gray-400">top liquidity providers</p>
<hr className="my-3 dark:opacity-30" />
{/* {topHolders.map((holder) => (
<li key={holder.address}>

<ul>
{Array.isArray(topHolders?.result) && topHolders.result?.map((holder : any) => (
<li key={holder.TokenHolderAddress} className="flex justify-between">
<a href={`https://snowtrace.io/address/${holder.address}`} target="_blank" rel="noreferrer">
{holder.address}
<RenderName address={holder?.TokenHolderAddress} chainId={chain?.id} />
</a>
{trimFormattedBalance(String(Number(holder?.TokenHolderQuantity) / 1e6)?.toString(), 0)} {"MEAT"}
</li>
))} */}
</Card>
))}

</ul>
<hr className="my-3 dark:opacity-30" />
</Card>
</motion.div>
)
}
2 changes: 1 addition & 1 deletion app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Card } from "@/components/ui/card"
const tokenomics = [
"42% LP (12mo lock)",
"21% future airdrops, grants, Sausager buybacks, Ferdy integration",
"21% pre-sale",
"21% pre-sale (funded LP)",
"10% Sausagers",
"4% MEAT devs (6mo linear vest)",
"2% Sausagers team",
Expand Down
5 changes: 4 additions & 1 deletion components/layout/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HTMLAttributes } from "react"
import Link from "next/link"
import { FaDiscord, FaGithub, FaTwitter } from "react-icons/fa"
import { FaDiscord, FaGithub, FaTelegram, FaTwitter } from "react-icons/fa"

import { siteConfig } from "@/config/site"
import { cn } from "@/lib/utils"
Expand Down Expand Up @@ -35,6 +35,9 @@ export function Footer({ className, ...props }: HTMLAttributes<HTMLElement>) {
<LinkComponent href={`${siteConfig.links.github}`}>
<FaGithub />
</LinkComponent>
<LinkComponent href={siteConfig.links.telegram}>
<FaTelegram />
</LinkComponent>
</div>
</footer>
)
Expand Down
3 changes: 1 addition & 2 deletions components/providers/root-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ThemeProvider } from "next-themes"
import { Provider as RWBProvider } from "react-wrap-balancer"

import { useIsMounted } from "@/lib/hooks/use-is-mounted"
import HandleWalletEvents from "@/components/blockchain/handle-wallet-events"
import { RainbowKit } from "@/components/providers/rainbow-kit"

const queryClient = new QueryClient()
Expand All @@ -26,7 +25,7 @@ export default function RootProvider({ children }: RootProviderProps) {
<QueryClientProvider client={queryClient}>
<RWBProvider>
<RainbowKit>
<HandleWalletEvents>{children}</HandleWalletEvents>
{children}
</RainbowKit>
</RWBProvider>
</QueryClientProvider>
Expand Down
4 changes: 3 additions & 1 deletion config/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface SiteConfig {
discord: string
twitter: string
github: string
telegram: string
ferdy: string
}
}
Expand All @@ -30,6 +31,7 @@ export const siteConfig: SiteConfig = {
discord: "https://discord.gg/YuabytkPgU",
twitter: "https://twitter.com/sausagers_xyz",
github: "https://github.com/MeatDeveloper/meat-page",
telegram: "https://t.me/+nTsLDyk8WEQyYzgx",
ferdy: "https://ferdyflip.xyz/referral/sausagers"
},
}
Expand All @@ -40,4 +42,4 @@ export const DEPLOY_URL =

export const meatTestAddress = "0x0337781a02948a35d154ae817d24b0f755357024"
export const meatAddress = "0x47c3118Ad183712Acd42648e9E522e13690f29a0"
export const lpAddress = "0x4d0e2e3f4ba0e0e5c4e7e0e1f4c1f5c9f5c9f5c9"
export const lpAddress = "0x60b881fa346e52590b1aa11d94a6d9047702c44e"
2 changes: 1 addition & 1 deletion lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function trimFormattedBalance(
if (!decimal) return integer

const trimmedDecimal = decimal.slice(0, decimals)
return `${integer}.${trimmedDecimal}`
return `${integer}${trimmedDecimal ? "." : ""}${trimmedDecimal}`
}

export function truncateEthAddress(address: string) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"react-wrap-balancer": "^0.3.0",
"sharp": "^0.32.5",
"siwe": "1.1.6",
"swr": "^2.2.4",
"tailwind-merge": "^1.10.0",
"tailwindcss": "^3.3.3",
"tailwindcss-animate": "^1.0.6",
Expand Down
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8ff5771

Please sign in to comment.