Skip to content

Latest commit

 

History

History
274 lines (221 loc) · 20 KB

File metadata and controls

274 lines (221 loc) · 20 KB

Migration Issues

Wallet & Network Foundation

  • Issue 1: Replace PushChain universal wallet surface with Reown App Kit

    • Context: The root provider still wraps the app in PushChainProviders (frontend/ticketchain/src/main.tsx:9-50), which is a wrapper around PushUniversalWalletProvider and PushUI-specific settings (frontend/ticketchain/src/providers/PushChainProvider.tsx:1-127). Header controls (frontend/ticketchain/src/components/Header.tsx:1-92) and flows such as PurchaseModal (frontend/ticketchain/src/components/PurchaseModal.tsx:7-53) depend on Push-only contexts and the pushChainClient.
    • Actions:
      • Install/configure Reown App Kit (WalletConnect AppKit) and replace PushChainProviders, exposing wagmi-compatible connectors for the target Ethereum networks.
      • Update UI pieces (nav button, modals, etc.) to use Reown/AppKit hooks (useAppKitAccount, AppKitButton) or raw wagmi connection state instead of usePushWalletContext/PushUI.CONSTANTS.
      • Move RPC overrides into the new AppKit/wagmi config so network selection happens via the Reown stack, not the Push chainConfig.
  • Issue 7: Rebuild wagmi config for Base-only support

    • Context: frontend/ticketchain/src/lib/wagmi.ts still defines the Push Testnet chain (ID 42101) with donut RPC URLs and Push Scan links.
    • Actions:
      • Replace the Push chain object with Base Mainnet (8453) and Base Sepolia (84532) definitions, including canonical RPC endpoints and BaseScan explorers.
      • Update the exported wagmiConfig, helper functions, and supportedChains map so all lookups (currency name, explorer URLs) reflect Base.
  • Issue 8: Implement a Reown App Kit provider wrapper

    • Context: frontend/ticketchain/src/providers/PushChainProvider.tsx wires in PushUniversalWalletProvider, and src/main.tsx still mounts <PushChainProviders>.
    • Actions:
      • Create a new provider component (e.g., AppKitProvider) that initializes WalletConnect’s App Kit with the Base chains from Issue 7.
      • Update frontend/ticketchain/src/main.tsx to import the new provider and drop all Push UI kit references.
  • Issue 9: Swap the header connect surface to App Kit/wagmi

    • Context: frontend/ticketchain/src/components/Header.tsx renders PushUniversalAccountButton and inspects usePushWalletContext() to decide which links to show.
    • Actions:
      • Replace the Push button with the App Kit connect component (or a custom button wired to wagmi’s useAccount + App Kit modals).
      • Update link gating logic to rely on wagmi connection state instead of connectionStatus.

Transaction & Hook Refactors

  • Issue 2: Rebuild every contract write on wagmi + ethers/viem instead of pushChainClient.universal.sendTransaction

    • Context: All write hooks (useCreateEvent, useAddTicketType, usePurchaseTicket, marketplace flows, etc. in frontend/ticketchain/src/hooks/useContracts.ts:35-934), NFT approval hooks (frontend/ticketchain/src/hooks/useNFTApproval.ts:1-123), ticket validation (frontend/ticketchain/src/hooks/useMarkTicketAsUsed.ts:1-63), and page-level purchases (frontend/ticketchain/src/pages/EventDetailPage.tsx:272-375) rely on Push SDK helpers to encode calldata and send universal transactions.
    • Actions:
      • Replace those calls with wagmi/viem primitives: writeContract/simulateContract for method calls, sendTransaction + waitForTransactionReceipt for payable flows, and encodeFunctionData for calldata.
      • Pull signer/chain information from wagmi/App Kit rather than pushChainClient.universal.origin, and compute native token value with parseEther.
      • Update explorer/deeplink helpers to use the blockExplorers metadata from wagmi chains instead of pushChainClient.explorer.
  • Issue 21: Rewrite useNFTApproval using wagmi writeContract

    • Context: frontend/ticketchain/src/hooks/useNFTApproval.ts sends approvals via pushChainClient.universal.sendTransaction and resolves UEAs for getApproved.
    • Actions:
      • Replace Push SDK calls with wagmi’s writeContract + waitForTransactionReceipt.
      • Simplify approval checks to compare addresses against the wagmi account, and update toast messages to reference BaseScan.
  • Issue 22: Update useMarkTicketAsUsed

    • Context: frontend/ticketchain/src/hooks/useMarkTicketAsUsed.ts still requires pushChainClient and PushChain helpers.
    • Actions:
      • Swap in wagmi writes (call validateTicket via writeContract) and surface Base explorer links in the returned state.
      • Remove Push-specific error strings.
  • Issue 23: Break up useContracts.ts and migrate writes

    • Context: frontend/ticketchain/src/hooks/useContracts.ts (≈900 lines) encodes every write with PushChain.utils.helpers.encodeTxData and sends via pushChainClient.
    • Actions:
      • Split the file into domain-specific hooks (events, tickets, marketplace) and use wagmi writeContract/simulateContract.
      • Remove usePushChainClient/usePushChain imports and adjust toast/explorer helpers to Base.

Core UX & Feature Updates

  • Issue 3: Remove Push-specific Universal Executor Account (UEA) assumptions in identity and approval logic

    • Context: Features such as organizer detection and reseller checks (frontend/ticketchain/src/pages/EventDetailPage.tsx:97-150) and approval hooks (frontend/ticketchain/src/hooks/useNFTApproval.ts:20-83) derive the Push UEA via PushChain.utils.account.convertOriginToExecutor. The My Tickets page (frontend/ticketchain/src/pages/MyTicketsPage.tsx:1-120) also maintains parallel Push vs. wagmi account state.
    • Actions:
      • Drop UEA resolution and use the connected EOA from wagmi/App Kit as the single source of truth for organizer/reseller comparisons.
      • Simplify hooks/pages to rely on useAccount and remove Push-specific connection statuses.
      • Update validation/error messaging that currently references “Push Universal Wallet” to match the Ethereum/Reown UX.
  • Issue 10: Rebuild PurchaseModal around ETH-based payments

    • Context: frontend/ticketchain/src/components/PurchaseModal.tsx requires a Push connection, exposes a multi-chain dropdown, and formats totals using convertPCToNative.
    • Actions:
      • Remove Push wallet hooks, rely on wagmi/App Kit connect state, and send Base transactions via the refactored usePurchaseTicket.
      • Drop the chain selector + PC conversions, formatting totals in ETH with formatEther.
  • Issue 11: Remove SUPPORTED_CHAINS + CAIP selection logic

    • Context: frontend/ticketchain/src/types/chains.ts lists dozens of EVM/Solana chains purely for the Push UX, and components like PurchaseModal import SUPPORTED_CHAINS.
    • Actions:
      • Delete the file (or trim it to Base-only metadata) and refactor any consumer that expects CAIP IDs, keeping the UI Base-specific.
  • Issue 12: Replace convertPCToNative helpers with ETH formatting

    • Context: frontend/ticketchain/src/lib/contracts.ts exports PC_TOKEN exchange rates plus conversion helpers that no longer apply.
    • Actions:
      • Remove the Push token constants and rely on viem’s formatEther/parseEther (or a Base-native helper) for display math.
      • Update any references (Marketplace, analytics, etc.) to the new helper.
  • Issue 13: Remove or rewrite PCTokenExplainer

    • Context: frontend/ticketchain/src/components/PCTokenExplainer.tsx explains Push universal payments with PC token flows.
    • Actions:
      • Delete the component and its usages, or rewrite it to describe Base-native ETH payments (gas, bridging tips) if we still need an explainer card.
  • Issue 14: Simplify MyTicketsPage to wagmi-only accounts

    • Context: frontend/ticketchain/src/pages/MyTicketsPage.tsx resolves Push executor addresses, keeps pushAccountAddress in state, and shows Push-specific copy in empty/error states.
    • Actions:
      • Remove usePushWalletContext/usePushChain, rely on wagmi useAccount, and feed that address to useUserTickets.
      • Update copy/buttons to reference Base wallets/App Kit instead of Push accounts.
  • Issue 15: Migrate MarketplacePage to ETH + wagmi

    • Context: frontend/ticketchain/src/pages/MarketplacePage.tsx gates buying on Push connection status, resolves UEAs for filtering, and shows PC-denominated filters.
    • Actions:
      • Replace the Push connect/UEA logic with wagmi/App Kit hooks.
      • Update price filters/tooltips to show ETH ranges and ensure handleBuyTicket uses the refactored wagmi write hook.
  • Issue 16: Update EventDetailPage organizer + purchase logic

    • Context: frontend/ticketchain/src/pages/EventDetailPage.tsx uses usePushChainClient, PushChain.utils.encodeTxData, and resolves UEAs to detect organizer addresses.
    • Actions:
      • Wire the quick-purchase CTA to the new wagmi write helper and remove references to pushChainClient.
      • Compare organizer EOAs directly via wagmi useAccount, updating copy to mention Base instead of Push.
  • Issue 17: Rework CreateEventPage to App Kit terminology

    • Context: frontend/ticketchain/src/pages/CreateEventPage.tsx checks connectionStatus from Push context, shows “Push wallet” warnings, and labels price inputs as “Price in PC”.
    • Actions:
      • Gate the form on wagmi/App Kit connection state, update empty-state copy, and label the pricing UI in ETH.
      • Ensure the submit handler calls the new useCreateEvent wagmi hook.
  • Issue 18: Update verification flows (VerifyPage, OrganizerVerificationPage)

    • Context: Both verification pages import usePushWalletContext and, for organizer scans, resolve UEAs.
    • Actions:
      • Replace Push hooks with wagmi/App Kit connection checks.
      • Drop executor resolution and use the connected Base address as the organizer identity when validating scans.
  • Issue 19: Remove Push wallet dependencies from analytics pages

    • Context: frontend/ticketchain/src/pages/EventAnalyticsPage.tsx and src/pages/ResellerAnalyticsPage.tsx depend on usePushWalletContext/usePushChain.
    • Actions:
      • Refactor both pages to rely on wagmi useAccount, removing executor lookups.
      • Update gating/empty-state copy to mention Base wallets instead of Push accounts.
  • Issue 20: Rework MarketplaceSection component

    • Context: frontend/ticketchain/src/components/event/MarketplaceSection.tsx resolves UEAs and markets royalties as “Push Chain provenance”.
    • Actions:
      • Replace the wallet logic with wagmi/App Kit hooks and remove executor resolution.
      • Refresh the marketing copy to highlight Base-native settlement.
  • Issue 26: Update ticket + marketing copy referencing Push

    • Context: Components such as frontend/ticketchain/src/components/TicketCard.tsx, src/pages/HomePage.tsx, src/pages/EventsPage.tsx, and src/components/Footer.tsx include “Push Chain” wording and PC price snippets.
    • Actions:
      • Replace the copy with Base-centric (or chain-agnostic) messaging and ensure sample price text uses ETH.
  • Issue 27: Point QR utilities at Base chain IDs

    • Context: frontend/ticketchain/src/components/QRCodeDisplay.tsx:31 hardcodes chainId: 42101 when generating metadata.
    • Actions:
      • Update the QR payloads and any validators to encode Base chain IDs, and adjust explorer links accordingly.

Docs, Config & Developer Experience

  • Issue 4: Point configs, providers, and docs at Base instead of Push Chain

    • Context: Hardhat config/shell scripts target only Push RPCs (hardhat.config.ts:16-40, package.json:12-13), wagmi is hard-coded to pushTestnet (frontend/ticketchain/src/lib/wagmi.ts:1-37), there is a Push-only provider helper (frontend/ticketchain/src/lib/pushchain.ts:1-7), and PC_TOKEN conversion data exists in frontend/ticketchain/src/lib/contracts.ts:11-45. Docs/README/env vars all reference VITE_PUSH_RPC_URL and Push tooling.
    • Actions:
      • Reconfigure Hardhat, deployment scripts, and env samples so the only supported chain is Base (e.g., base + base_sepolia), and remove Push network objects entirely.
      • Rebuild wagmiConfig to include Base chains only, remove pushProvider, rename env vars to Base-specific RPCs, and swap the PC_TOKEN helper for Base-native ETH formatting.
      • Rewrite README/docs to explain how to run on Base, including RPC URLs, explorers, and how Reown App Kit should be configured for Base.
  • Issue 5: Clean up Push Chain sample code, docs, and UI references that no longer apply

    • Context: The repo still includes Push-branded guides (docs/PUSH_CHAIN_ACCOUNTS_GUIDE.md, docs/push-chain-integration-guide.md, docs/transaction guide.md, docs/push-executor-mapping-fix.md), a Push demo component (frontend/ticketchain/src/demo.tsx:1-286), and UI copy like PCTokenExplainer (frontend/ticketchain/src/components/PCTokenExplainer.tsx:3-28) that mention PC tokens.
    • Actions:
      • Replace/remove those Push-specific docs and demos, and add new guidance covering Reown App Kit integration and wagmi-based interactions.
      • Update UI text/tooltips to reflect ETH or the Base-native token.
  • Issue 24: Remove pushchain.ts

    • Context: frontend/ticketchain/src/lib/pushchain.ts exports a Push RPC provider used for read-only calls.
    • Actions:
      • Delete the file and update any consumer to use the wagmi public client or Base RPC URLs.
  • Issue 25: Delete the Push demo component

    • Context: frontend/ticketchain/src/demo.tsx embeds Push tutorials and is no longer relevant.
    • Actions:
      • Remove the file and ensure it isn’t referenced from routes/docs.
  • Issue 28: Update contract address/env plumbing for Base

    • Context: frontend/ticketchain/src/lib/contracts.ts references Push defaults and VITE_TICKET_* env vars tailored to Push deployments.
    • Actions:
      • Introduce Base-native defaults (or make the env vars mandatory) and rename/clarify env var names if needed.
      • Document the new env vars for both frontend and backend packages.
  • Issue 29: Add .env.example files

    • Context: There’s no sample env file guiding developers through the required variables (Base RPC, contract addresses, Pinata JWT, etc.).
    • Actions:
      • Create .env.example (and/or frontend-specific .env.local.example) lists for all required variables.
      • Reference the example files in the README setup section.
  • Issue 30: Rewrite README.md for the Base + App Kit stack

    • Context: The current README is Push-centric (donut RPCs, universal accounts, PC pricing).
    • Actions:
      • Update the README to describe Base deployment, App Kit wallet UX, and ETH payments.
      • Remove Push troubleshooting tips and add Base-specific guidance (RPCs, explorers, bridging).
  • Issue 31: Replace docs/push-chain-integration-guide.md

    • Context: The integration guide only covers Push UI kit setup.
    • Actions:
      • Author a new Base integration guide covering App Kit wiring, wagmi reads/writes, and Base RPC considerations, replacing the old doc.
  • Issue 32: Remove docs/PUSH_CHAIN_ACCOUNTS_GUIDE.md

    • Context: This longform doc is all about Universal Executor Accounts.
    • Actions:
      • Delete or archive the file and, if desired, replace it with a Base account management overview (ENS, multi-wallet).
  • Issue 33: Replace docs/transaction guide.md

    • Context: The guide contains Push SDK snippets for universal transactions.
    • Actions:
      • Remove it and create a wagmi/App Kit transaction how-to tailored to Base.
  • Issue 34: Remove docs/push-executor-mapping-fix.md (and similar Push fixes)

    • Context: Executor mapping fixes only apply to Push.
    • Actions:
      • Delete the file or repurpose it to document Base-specific troubleshooting items.
  • Issue 35: Clean up miscellaneous Push docs (e.g., docs/telegram.txt)

    • Context: Additional docs still paste Push SDK snippets.
    • Actions:
      • Remove or update those documents with Base-compatible examples.
  • Issue 36: Update Hardhat config for Base

    • Context: hardhat.config.ts defines only push_testnet networks and Blockscout verification data.
    • Actions:
      • Replace the Push networks with base/base_sepolia entries, set RPC URLs, and configure etherscan for BaseScan.
  • Issue 37: Adjust scripts/deploy.js for Base deployments

    • Context: Deployment scripts/logs are generic but README/scripts still reference Push flows.
    • Actions:
      • Ensure deployment logs mention Base, and add helper steps for verifying on BaseScan after deploy.
  • Issue 38: Refresh root package.json scripts

    • Context: Scripts such as deploy:push remain in package.json.
    • Actions:
      • Remove Push-specific scripts, add deploy:base / deploy:base-sepolia, and ensure verification scripts target BaseScan.
  • Issue 42: Introduce a BaseScan explorer helper

    • Context: Components currently rely on pushChainClient.explorer.getTransactionUrl to link to Push Scan.
    • Actions:
      • Add a helper (e.g., lib/explorer.ts) that maps Base chain IDs to BaseScan URLs and migrate all toast/link usage.
  • Issue 43: Create a Base devnet seeding script

    • Context: Developers currently deploy contracts manually and lack scripted sample data for local testing.
    • Actions:
      • Write a Hardhat task/script that deploys contracts and seeds sample events/tickets on a local Base fork for frontend demos.
  • Issue 46: Author a Base-specific troubleshooting guide

    • Context: All current troubleshooting docs reference Push RPC quirks; nothing guides developers through Base-specific pitfalls.
    • Actions:
      • Write a new doc outlining Base RPC limits, BaseScan quirks, and wallet troubleshooting tips, and link it from the README.

Dependencies & Build Health

  • Issue 6: Upgrade the monorepo to the latest package versions

    • Context: Both package.json files pin older dependency versions (e.g., root Hardhat toolchain versions from mid-2024, frontend deps like wagmi@2.17.5, viem@2.37.13, @tanstack/react-query@5.90.2, and internal UI packages such as @radix-ui/react-dialog@1.1.15). Supporting Base and Reown App Kit will likely require the latest wagmi/AppKit/viem releases.
    • Actions:
      • Audit the root package.json and frontend/ticketchain/package.json, bump all dependencies/devDependencies to their latest stable releases, and regenerate lockfiles.
      • Verify Hardhat + TypeScript configs still compile with the new versions (adjust tsconfig/eslint, fix breaking changes, etc.).
      • Smoke-test the frontend and contracts build to ensure no regressions from the dependency upgrades.
  • Issue 39: Remove unused connectkit dependency

    • Context: Root package.json lists connectkit even though the UI uses Push (and will use App Kit next).
    • Actions:
      • Drop the dependency (and any other unused wallet libs) and regenerate the lockfile.

Testing & Quality Assurance

  • Issue 40: Add Hardhat tests for TicketFactory

    • Context: There’s no automated coverage for event creation, purchases, withdrawals, or validation logic.
    • Actions:
      • Write Hardhat/Chai tests for the full event lifecycle and ensure they run in CI/npm test.
  • Issue 41: Add Hardhat tests for TicketMarketplace

    • Context: Secondary market flows (listing, buying, offers) are untested.
    • Actions:
      • Build test suites covering escrow transfers, royalty payouts, offer lifecycle, and seller stats.
  • Issue 44: Add frontend unit tests

    • Context: No React Testing Library setup exists for key components.
    • Actions:
      • Configure Vitest/RTL for the Vite app and add baseline tests for search filtering, ticket cards, and marketplace listings.
  • Issue 45: Add end-to-end tests for purchase/resale flows

    • Context: There’s no automated validation that wallet connections and on-chain flows still work after the migration.
    • Actions:
      • Introduce a Playwright (or Cypress) suite that covers connecting via App Kit, purchasing a ticket, and listing/canceling it, using mock wallets where needed.

Additional issues can be appended below using the same checkbox format to keep the list extensible.