diff --git a/packages/nextjs/app/page.tsx b/packages/nextjs/app/page.tsx index e0302bc..ba3a880 100644 --- a/packages/nextjs/app/page.tsx +++ b/packages/nextjs/app/page.tsx @@ -13,15 +13,15 @@ import { Address } from "~~/components/scaffold-eth"; const Home: NextPage = () => { const { address: connectedAddress } = useAccount(); - const contractAddress = "0x0000000000000000000000000000000000000000" as `0x${string}`; + const contractAddress = "0x52dE6508FECCA4d712b75b0bD018a621EaF2d734" as `0x${string}`; const contractABI = StakingABI; return ( <> {/* Floating Stake Button - Always visible */} - {/*
+
-
*/} +
@@ -37,11 +37,11 @@ const Home: NextPage = () => {
- +
- +
{/* Stake Card with CTA Arrow */} diff --git a/packages/nextjs/components/StakeCard.tsx b/packages/nextjs/components/StakeCard.tsx index 64b6371..fd996d8 100644 --- a/packages/nextjs/components/StakeCard.tsx +++ b/packages/nextjs/components/StakeCard.tsx @@ -20,28 +20,13 @@ const StakeCard: React.FC = ({ contractAddress, contractABI }) = const currentChainId = useChainId(); const { writeContract, isPending, isSuccess, isError, error } = useWriteContract(); - const BASE_SEPOLIA = { - id: 84532, - name: "Base Sepolia", - network: "base-sepolia", - nativeCurrency: { decimals: 18, name: "Base Sepolia Ether", symbol: "ETH" }, - rpcUrls: { - default: { http: ["https://sepolia.base.org"] }, - public: { http: ["https://sepolia.base.org"] }, - }, - blockExplorers: { - default: { name: "BaseScan", url: "https://sepolia.basescan.org" }, - }, - testnet: true, - }; - const { data: balance } = useBalance({ address, - chainId: BASE_SEPOLIA.id, + chainId: baseSepolia.id, }); useEffect(() => { - if (isConnected && currentChainId !== BASE_SEPOLIA.id) { + if (isConnected && currentChainId !== baseSepolia.id) { setNetworkError("Please switch to Base Sepolia network"); } else { setNetworkError(""); @@ -55,8 +40,8 @@ const StakeCard: React.FC = ({ contractAddress, contractABI }) = return; } - if (currentChainId !== BASE_SEPOLIA.id) { - await switchChain({ chainId: BASE_SEPOLIA.id }); + if (currentChainId !== baseSepolia.id) { + await switchChain({ chainId: baseSepolia.id }); return; } @@ -87,7 +72,7 @@ const StakeCard: React.FC = ({ contractAddress, contractABI }) =

Stake ETH

{/* Network Warning */} - {currentChainId !== BASE_SEPOLIA.id && isConnected && ( + {currentChainId !== baseSepolia.id && isConnected && (
Wrong network. Please switch to Base Sepolia
@@ -125,13 +110,12 @@ const StakeCard: React.FC = ({ contractAddress, contractABI }) = > {!isConnected ? "Connect Wallet" - : currentChainId !== BASE_SEPOLIA.id + : currentChainId !== baseSepolia.id ? "Switch Network" : isPending ? "Staking..." : "Stake ETH"} - {/* Status Messages */} {isSuccess && (