Skip to content

Conversation

@augustocollerone
Copy link

@augustocollerone augustocollerone commented Dec 26, 2025

Summary

This PR delivers part of Milestone 2: Frontend Integration of the CoW Grants Program RFP: CoW Protocol Playground Block Explorer Integration proposal by CoBuilders.

Updates the CoW Swap and Explorer Dockerfiles to use REACT_APP_BLOCK_EXPLORER_URL, enabling all block explorer links to point to the local Otterscan instance (port 8003) instead of Etherscan.

demo_after

Milestone 2 Deliverables

CoW Swap Frontend Integration

  • Configure REACT_APP_BLOCK_EXPLORER_URL=http://localhost:8003 in build
  • Transaction hash links point to local Otterscan
  • Address links point to local Otterscan
  • All navigation flows work correctly

CoW Explorer Frontend Integration

  • Configure REACT_APP_BLOCK_EXPLORER_URL=http://localhost:8003 in build
  • "View on Blockchain" links point to local Otterscan
  • Address and token links point to local Otterscan
  • All navigation flows work correctly

Success Criteria

"One-click navigation from frontends to the local block explorer for all transactions and addresses"

  • Clicking any explorer link in CoW Swap (port 8000) → Opens in Otterscan (port 8003)
  • Clicking any explorer link in CoW Explorer (port 8001) → Opens in Otterscan (port 8003)

Changes

Modified Files

File Changes
Dockerfile.cowswap Added REACT_APP_BLOCK_EXPLORER_URL build arg
Dockerfile.explorer Added REACT_APP_BLOCK_EXPLORER_URL env var

Architecture

┌─────────────┐     ┌─────────────┐
│  CoW Swap   │     │ CoW Explorer│
│ (port 8000) │     │ (port 8001) │
└──────┬──────┘     └──────┬──────┘
       │                   │
       │   All explorer    │
       │   links now       │
       │   point to ───────┤
       │                   │
       └───────────┬───────┘
                   │
                   ▼
           ┌─────────────┐
           │  Otterscan  │
           │ (port 8003) │
           └─────────────┘

Dependencies

This PR depends on:

  • PR: cowprotocol/cowswap#XXX - Adds REACT_APP_BLOCK_EXPLORER_URL env var support

Testing

  1. Start the playground:

    docker compose -f docker-compose.fork.yml up --build
  2. Open CoW Swap at http://localhost:8000:

    • Make a swap or view transaction history
    • Click any "View on Explorer" or transaction link
    • Expected: Opens http://localhost:8003/tx/{hash}
  3. Open CoW Explorer at http://localhost:8001:

    • Browse any order or transaction
    • Click any address or transaction link
    • Expected: Opens http://localhost:8003/address/{addr}
  4. Verify Otterscan shows the transaction/address details with full traces

Demo

  1. User clicks transaction in CoW Swap
  2. Otterscan opens with full transaction details
  3. Traces, logs, and gas profiling visible locally

Milestones

Milestone Description Status
M1 Otterscan Integration PR #4000
M2 Frontend Integration This PR (+ cowswap PR)
M3 Documentation Pending

Submitted by CoBuilders as part of the CoW Grants Program

ifqbuilder and others added 12 commits December 11, 2025 19:39
- Add nginx-spa.conf with try_files fallback for client-side routing
- Update Dockerfile.explorer to use nginx SPA config (fixes 404 on direct URL access/refresh)
- Add REACT_APP_EXPLORER_URL_DEV to cowswap build command
- Fix README typo and remove "not yet implemented" from explorer

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@augustocollerone augustocollerone changed the title Feature/explorer redirects [M2] Integrate block explorer URL override for Otterscan Dec 26, 2025
@augustocollerone augustocollerone marked this pull request as ready for review December 26, 2025 20:48
@augustocollerone augustocollerone requested a review from a team as a code owner December 26, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants