Skip to content

feat: scaffolding for local marketplace deployment - #180

Closed
1marcghannam wants to merge 2 commits into
developfrom
feat/marketplace-local-deployment
Closed

feat: scaffolding for local marketplace deployment#180
1marcghannam wants to merge 2 commits into
developfrom
feat/marketplace-local-deployment

Conversation

@1marcghannam

Copy link
Copy Markdown
Contributor

Summary

  • Vendors Seaport 1.6 artifacts (ABI + bytecode) + a fetch script that rebuilds them from the upstream repo via forge.
  • Adds MockWETH and MockUSDC contracts so the marketplace stack can be exercised end-to-end with realistic ERC20 payment paths against a local chain.
  • Adds a deploy-marketplace module wired into the existing deploy.ts chain; deploys ConduitController, Seaport, MockWETH, MockUSDC.
  • Adds a two-phase seed-marketplace module:
    • seedOnChain() — mints SDL, creates reSDL locks on test wallets, distributes LINK/USDC, deposits WETH, sets Seaport approvals.
    • seedViaApi() — signs Seaport listings + offer with the foundry test wallets and POSTs them to the marketplace-backend API once it's up. Idempotent.
  • Adds marketplace-bootstrap.ts and marketplace-seed-api.ts orchestrator entrypoints used by the app repo's docker-compose.marketplace.yml containers.
  • Allows RPC_URL env override on the localhost hardhat network so the bootstrap container can reach http://anvil:8545 from inside docker.

Pairing

This change is half of the local-deployment work. The other half — docker compose, dockerfiles, backend / subgraph / UI wiring — lives in the app repo PR.

Notes

  • Vendored Seaport (cloned from upstream tag 1.6) reports information().version == "1.5" at runtime, so the marketplace-backend signs EIP-712 with SEAPORT_VERSION=1.5 on the local stack. Production paths continue to use 1.6 as before.
  • vendor/seaport/fetch-artifacts.sh requires foundry's forge + jq + git on the developer's machine. Re-run whenever the pin is bumped.

Test plan

  • cd contracts && yarn compile succeeds and MockWETH / MockUSDC artifacts are generated.
  • cd contracts/vendor/seaport && ./fetch-artifacts.sh produces Seaport.json (~130KB) and ConduitController.json (~30KB).
  • From the paired app repo PR: make marketplace-up boots the full stack in <2 min and prints the welcome banner; the seed completes without errors; backend has 2 listings + 1 offer.

🤖 Generated with Claude Code

1marcghannam and others added 2 commits May 13, 2026 14:24
Adds the contracts-side plumbing needed to run the reSDL marketplace
end-to-end against a local anvil chain (paired with the app repo's
docker-compose.marketplace.yml stack).

Contracts:
- contracts/core/test/MockWETH.sol — WETH9-style mock for ERC20 payment
  testing (deposit/withdraw + the ERC20 surface Seaport needs).
- contracts/core/test/MockUSDC.sol — minimal USDC mock with 6 decimals
  and owner-only mint(). ERC20Mintable's hardcoded 18 decimals doesn't
  fit USDC, hence its own contract.

Deploy / seed:
- scripts/test/deploy/modules/deploy-marketplace.ts — deploys vendored
  Seaport + ConduitController and the WETH/USDC mocks, appending to
  deployments/localhost.json.
- scripts/test/deploy/deploy.ts — wired deployMarketplace() into the
  end of the existing deploy chain.
- scripts/test/setup/modules/seed-marketplace.ts — two-phase seed:
    * seedOnChain() mints SDL, creates reSDL locks on test wallets,
      distributes LINK/USDC, deposits WETH, sets Seaport approvals.
    * seedViaApi() (runs in marketplace-seed container after the backend
      is healthy) signs Seaport listings + offer with foundry-mnemonic
      wallets and POSTs to the marketplace-backend API. Idempotent —
      checks for existing listings before submitting.
- scripts/test/marketplace-bootstrap.ts — phase 1 orchestrator: runs
  deploy.ts as a child process, runs seedOnChain(), writes the shared
  /shared/addresses.json (chain id, RPC, every contract + 10 test
  wallets with private keys). Skips work if addresses.json already
  exists and the contracts are still deployed on chain.
- scripts/test/marketplace-seed-api.ts — phase 2 orchestrator.

Vendored Seaport:
- vendor/seaport/{Seaport,ConduitController}.json — pre-compiled ABI +
  bytecode fetched from the upstream Seaport `1.6` tag via forge build.
  Note: the deployed bytecode reports information().version == "1.5",
  so the marketplace-backend signs EIP-712 with SEAPORT_VERSION=1.5 on
  the local stack.
- vendor/seaport/fetch-artifacts.sh — one-shot script to regenerate
  these artifacts; requires git + forge + jq.
- vendor/seaport/README.md — version pin + re-fetch instructions.

Hardhat config:
- Allow RPC_URL env override on the `localhost` network so the
  bootstrap container can target http://anvil:8545 instead of
  127.0.0.1:8545 (preserves the existing default when no env is set).

@opensea/seaport-js@^4.0.0 added as a dev dep for the seed's order
construction + offer flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`yarn prettier:fix` formatting pass to satisfy CI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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