Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 6.34 KB

File metadata and controls

64 lines (45 loc) · 6.34 KB

Scratch Pad - Offchain Hook Mining

Goal

Move Uniswap v4 hook mining off-chain; understand current hook deployment/mining and adapt to smart contracts.

Notes

  • Keep steps sequential with tests.

Log

  • 2025-12-23: Started research; read attached Uniswap docs excerpt.

  • 2025-12-23: Added off-chain mining helper for scripts (OffchainHookMining) and updated TestLaunch/SeedAuctions to mine hookSalt off-chain; added README section on off-chain hook mining.

  • 2025-12-23: forge build --skip test --skip script --no-cache succeeded (warnings). forge build --skip test script/TestLaunch.s.sol succeeded (warnings). Full forge build still hangs due to stuck forge process (PID 15869 earlier).

  • 2025-12-23: Ran fork tests with mainnet RPC; failures were InvalidHookSalt in fork suites. Added OffchainHookMining usage in fork tests, and auto-mined hookSalt after claimBlock updates; wrapper tests now mine using enforced defaults.

  • 2025-12-23: Fork tests still failing with InvalidHookSalt; updated OffchainHookMining to resolve token address via token factory view (getVotesERC20Address/getUERC20Address) with fallback to local CREATE2 hash.

  • 2025-12-23: Fixed fork LPNFT withdrawal test to set lockupDuration before mining hookSalt (hookSalt must reflect fee splitter parameters).

  • 2025-12-23: Mainnet fork tests (test/fork/MainnetForkTest.t.sol) now pass (23/23) after token address resolution fix and lockupDuration ordering.

  • 2025-12-23: Ran full fork suite (test/fork/*.t.sol) with mainnet RPC: 34 tests passed, 0 failed.

  • 2025-12-23: Adjusted RainbowKit ConnectButton mocks to be renderable components; added indexer client fallback for token field as scalar/absent and normalized token data; added placeholder token defaults and normalizeAuction helper.

  • 2025-12-23: Guarded localStorage access in ClaimSummaryCard, PublicSaleView, and utils/claim to avoid server-side localStorage.getItem errors during e2e/dev server.

  • 2025-12-23: E2E run completed global setup but failed with ESM/CJS mismatch in web3-wallet fixture; added Playwright config tsconfig override and added server-side storage shim + localStorage guards to fix dev server 500s.

  • 2025-12-23: Added ESM JS fixture web3-wallet.mjs and updated E2E tests to import it; kept TS fixture for types.

  • 2025-12-23: Renamed web3-wallet fixture to .cts (CommonJS TS) and updated E2E test imports to avoid Playwright ESM exports error; removed .mjs attempt.

  • 2025-12-23: Switched E2E test imports to require() from CommonJS .cts fixture to force CJS execution and avoid exports-in-ESM errors.

  • 2025-12-23: Converted web3-wallet fixture to CommonJS .cjs and updated E2E tests to require it.

  • 2025-12-23: Updated RainbowKit E2E config to route mainnet RPC through Anvil (keep chain id 1). Added E2E wallet status badge (Connect Wallet / 0x… address) for test visibility, with data-testid hooks. Updated e2e auction helpers GraphQL query to use tokenAddress. Adjusted e2e helpers/tests to use wallet-connection helpers and longer waits.

  • 2025-12-23: Multiple E2E runs after fixes; Ponder process stopped mid-run in latest attempt, causing many tests to fail with “Failed to fetch auction”. Final E2E run summary logged in /tmp/hartford-e2e-7.log; Ponder already stopped in teardown.

  • 2025-12-24: Added htmlFor/id pairs to all LaunchPage labels/inputs for Playwright getByLabel accessibility (launch form fields).

  • 2025-12-24: Moved E2EWalletStatus inside RainbowKitProvider so openConnectModal/openAccountModal work for connect/disconnect tests.

  • 2025-12-24: Updated e2e tests to use E2E wallet badge testids, added auction-over skip for bid submission, and stabilized admin wizard step detection (ensure step 1 + updated step indicator text).

  • 2025-12-24: Ran yarn test with MAINNET_RPC_URL set; all contract, sdk, frontend, and indexer tests passed (see /tmp/hartford-tests-2.log).

  • 2025-12-24: Stopped running e2e session after auction-e2e wallet address test failed; cleaned up Anvil/Ponder/Wallet PIDs and test-env file.

  • 2025-12-24: Adjusted CCA deployment validation test to detect Step 2 heading ("Auction - Step 2 of") instead of old "Auction Config" label.

  • 2025-12-24: E2E tests passed (130 passed, 10 skipped) in /tmp/hartford-e2e-14.log.

  • 2025-12-24: Updated e2e global-setup to detach Anvil/Wallet/Ponder, enforce chain-id=1, add fork-ready Ponder checks, and deploy LaunchOrchestrator/DefaultLaunchWrapper with local factories; test env now includes deployment addresses.

  • 2025-12-24: Added frontend hook mining helper (mineHookSaltForLaunch) and wired LaunchDeploymentModal to mine hook salt off-chain before launching; added /api/e2e-env route to read .test-env.json for wrapper address fallback.

  • 2025-12-24: Unskipped and rewrote CCA deployment E2E test to follow actual 5-step wizard flow with unique token name/symbol and modal deploy flow.

  • 2025-12-24: Added KEEP_E2E_ENV flag to preserve .test-env.json; updated teardown to kill process groups for detached services.

  • 2025-12-24: Updated wagmi config to route mainnet reads through Anvil when NEXT_PUBLIC_USE_ANVIL_RPC is set (fixes receipt polling on forked chain).

  • 2025-12-24: Hardened e2e global-setup to restart stale Ponder instances using stored PID and extended fork-ready wait timeout.

  • 2025-12-24: Added debug assertions to CCA deployment E2E test to surface hook mining/tx error text when launch fails.

  • 2025-12-24: Increased hook mining batchSize in LaunchDeploymentModal to 1024 to speed up off-chain mining in E2E.

  • 2025-12-24: Added status polling to CCA deployment E2E test to capture whether mining/pending/confirming states stall and include modal text on failure.

  • 2025-12-24: Extended CCA deployment E2E test timeout to 240s and log modal status transitions during launch.

  • 2025-12-24: Added Playwright browser console/pageerror logging in wallet fixture for deeper E2E debugging.

  • 2025-12-24: Added LaunchDeploymentModal console logs around hook mining + tx submission for E2E debugging.

  • 2025-12-24: Fixed LaunchDeploymentModal onSuccess to fire once via useEffect; updated CCA deployment E2E test to target the Create Token Sale dialog and treat "Sale saved" or "Launch Successful" as success (avoid dialog mis-selection + page-closed errors).

  • 2025-12-24: Ran yarn test with MAINNET_RPC_URL/FORK_RPC_URL set; all tests passed (see /tmp/hartford-tests-3.log).

  • 2025-12-24: Ran Playwright E2E (browser) with Anvil fork; 131 passed, 9 skipped (see /tmp/hartford-e2e-2.log).