diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2015629..8edaa47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,7 @@ jobs: needs: [lint-and-typecheck] env: NEXT_PUBLIC_ALCHEMY_API_KEY: ${{ secrets.NEXT_PUBLIC_ALCHEMY_API_KEY }} + NEXT_PUBLIC_PRIVY_APP_ID: ${{ secrets.NEXT_PUBLIC_PRIVY_APP_ID }} steps: - name: Checkout uses: actions/checkout@v4 diff --git a/packages/erc7984example/.env.example b/packages/erc7984example/.env.example index bd7a7e2..07e1f0d 100644 --- a/packages/erc7984example/.env.example +++ b/packages/erc7984example/.env.example @@ -10,4 +10,6 @@ # You'll need to prefix the variables names with NEXT_PUBLIC_ if you want to access them on the client side. # More info: https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables NEXT_PUBLIC_ALCHEMY_API_KEY="" -NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID="" \ No newline at end of file + +# Privy App ID - Get yours at https://dashboard.privy.io +NEXT_PUBLIC_PRIVY_APP_ID="" \ No newline at end of file diff --git a/packages/erc7984example/app/_components/ERC7984Demo.tsx b/packages/erc7984example/app/_components/ERC7984Demo.tsx index c0eecbd..7bd7aa9 100644 --- a/packages/erc7984example/app/_components/ERC7984Demo.tsx +++ b/packages/erc7984example/app/_components/ERC7984Demo.tsx @@ -5,9 +5,9 @@ import { FHEBenchmark } from "./FHEBenchmark"; import { ethers } from "ethers"; import { useFhevm } from "fhevm-sdk"; import { useAccount } from "wagmi"; -import { RainbowKitCustomConnectButton } from "~~/components/helper/RainbowKitCustomConnectButton"; +import { PrivyConnectButton } from "~~/components/helper/PrivyConnectButton"; import { useERC7984Wagmi } from "~~/hooks/erc7984/useERC7984Wagmi"; -import { useDeployedContractInfo } from "~~/hooks/helper"; +import { useDeployedContractInfo, useIsSmartWallet } from "~~/hooks/helper"; import type { AllowedChainIds } from "~~/utils/helper/networks"; import { notification } from "~~/utils/helper/notification"; @@ -18,6 +18,7 @@ import { notification } from "~~/utils/helper/notification"; */ export const ERC7984Demo = () => { const { isConnected, chain, address } = useAccount(); + const { isSmartWallet } = useIsSmartWallet(); const chainId = chain?.id; @@ -214,7 +215,7 @@ export const ERC7984Demo = () => { Connect your wallet to use the ERC7984 confidential token demo.

- +
@@ -231,6 +232,27 @@ export const ERC7984Demo = () => {

+ {/* Smart Wallet Warning */} + {isSmartWallet && ( +
+
+ ⚠️ +
+

Smart Wallet Detected

+

+ You're using a smart contract wallet (like Coinbase Smart Wallet or Safe). FHE balance decryption + is not currently supported with smart wallets due to signature format + incompatibilities. +

+

+ Workaround: Connect with a regular wallet (EOA) like MetaMask. Transfers will still + work normally. +

+
+
+
+ )} + {/* Balance Handle Display */}

💰 Confidential Balance

@@ -279,16 +301,18 @@ export const ERC7984Demo = () => {
diff --git a/packages/erc7984example/app/layout.tsx b/packages/erc7984example/app/layout.tsx index 3191aa5..3b8cd5b 100644 --- a/packages/erc7984example/app/layout.tsx +++ b/packages/erc7984example/app/layout.tsx @@ -1,5 +1,4 @@ import Script from "next/script"; -import "@rainbow-me/rainbowkit/styles.css"; import { DappWrapperWithProviders } from "~~/components/DappWrapperWithProviders"; import { ThemeProvider } from "~~/components/ThemeProvider"; import "~~/styles/globals.css"; @@ -13,11 +12,9 @@ export const metadata = getMetadata({ const DappWrapper = ({ children }: { children: React.ReactNode }) => { return ( - - - + -