Skip to content

Commit

Permalink
Merge pull request #20 from danilo-89/amoy-migration
Browse files Browse the repository at this point in the history
Amoy migration
  • Loading branch information
danilo-89 authored Apr 19, 2024
2 parents 18d8d67 + 720a482 commit 89063b2
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 53 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🇸 Storybook: [sitting-cats-nft-storybook.vercel.app](https://sitting-cats-nft-storybook.vercel.app/)

The **Sitting Cats<sup>NFT</sup>** represents a small personal project aimed at showcasing the process of NFT minting on the Polygon Mumbai test network.
The **Sitting Cats<sup>NFT</sup>** represents a small personal project aimed at showcasing the process of NFT minting on the Polygon Amoy test network.

![project preview](./readme/web-preview.png)

Expand Down
8 changes: 4 additions & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const yellowtail = Yellowtail({

export const metadata: Metadata = {
title: 'Sitting Cats NFT',
description: 'Demonstrating NFT minting on the Polygon Mumbai test network',
description: 'Demonstrating NFT minting on the Polygon Amoy test network',
}

export default function RootLayout({
Expand All @@ -30,7 +30,7 @@ export default function RootLayout({
<title>Sitting Cats NFT</title>
<meta
name="description"
content="Demonstrating NFT minting on the Polygon Mumbai test network"
content="Demonstrating NFT minting on the Polygon Amoy test network"
/>

{/* <!-- Facebook Meta Tags --> */}
Expand All @@ -48,7 +48,7 @@ export default function RootLayout({
/>
<meta
property="og:description"
content="Demonstrating NFT minting on the Polygon Mumbai test network"
content="Demonstrating NFT minting on the Polygon Amoy test network"
/>
<meta
property="og:image"
Expand All @@ -74,7 +74,7 @@ export default function RootLayout({
/>
<meta
name="twitter:description"
content="Demonstrating NFT minting on the Polygon Mumbai test network"
content="Demonstrating NFT minting on the Polygon Amoy test network"
/>
<meta
name="twitter:image"
Expand Down
33 changes: 28 additions & 5 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { WagmiConfig, createConfig, configureChains, mainnet } from 'wagmi'
import { publicProvider } from 'wagmi/providers/public'
import { defineChain } from 'viem'
import { polygonMumbai } from 'viem/chains'
import { alchemyProvider } from 'wagmi/providers/alchemy'
import {
RainbowKitProvider,
Expand All @@ -27,22 +26,46 @@ import SectionRoadmap from '@/components/sections/SectionRoadmap/SectionRoadmap'
import Footer from '@/components/common/Footer/Footer'

const RPC_PUBLIC = process.env.NEXT_PUBLIC_RPC_PUBLIC as string
const CHAIN_ID = process.env.NEXT_PUBLIC_CHAIN_ID as string
const WALLET_CONNECT_PROJECT_ID = process.env
.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID as string

console.log('Public RPC: ', RPC_PUBLIC)

const preferredChain = defineChain({
...polygonMumbai,
id: Number(CHAIN_ID),
name: 'Polygon Amoy',
network: 'polygonamoy',
nativeCurrency: {
name: 'MATIC',
symbol: 'MATIC',
decimals: 18,
},
rpcUrls: {
...polygonMumbai.rpcUrls,
alchemy: {
http: ['https://polygon-amoy.g.alchemy.com/v2'],
webSocket: ['wss://polygon-amoy.g.alchemy.com/v2'],
},
infura: {
http: ['https://polygon-amoy.infura.io/v3'],
webSocket: ['wss://polygon-amoy.infura.io/ws/v3'],
},
default: {
http: [RPC_PUBLIC],
},
public: {
http: [RPC_PUBLIC],
},
},
blockExplorers: {
etherscan: {
name: 'PolygonScan',
url: 'https://amoy.polygonscan.com',
},
default: {
name: 'PolygonScan',
url: 'https://amoy.polygonscan.com',
},
},
testnet: true,
})

const { chains, publicClient, webSocketPublicClient } = configureChains(
Expand Down
2 changes: 1 addition & 1 deletion components/NftCard/NftCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const NftCard = ({ data }: IProps) => {
/>
{currentData?.id ? (
<a
href={`https://mumbai.polygonscan.com/token/${process.env.NEXT_PUBLIC_CONTRACT}?a=${currentData?.id}`}
href={`https://amoy.polygonscan.com/token/${process.env.NEXT_PUBLIC_CONTRACT}?a=${currentData?.id}`}
target="_blank"
rel="noopener noreferrer"
className="flex h-8 min-w-[2rem] items-center justify-center rounded-full bg-champagne px-1 text-xsP font-semibold"
Expand Down
4 changes: 2 additions & 2 deletions components/common/Footer/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const contractInfoLabelsData = [
{
name: 'address',
value: shortenHexString(process.env.NEXT_PUBLIC_CONTRACT),
href: `https://mumbai.polygonscan.com/address/${process.env.NEXT_PUBLIC_CONTRACT}`,
href: `https://amoy.polygonscan.com/address/${process.env.NEXT_PUBLIC_CONTRACT}`,
},
{
name: 'standard',
Expand All @@ -13,7 +13,7 @@ export const contractInfoLabelsData = [
},
{
name: 'network',
value: 'Polygon Mumbai Testnet',
value: 'Polygon Amoy Testnet',
},
{
name: 'NFT price*',
Expand Down
Loading

0 comments on commit 89063b2

Please sign in to comment.