feat: scaffolding for local marketplace deployment - #180
Closed
1marcghannam wants to merge 2 commits into
Closed
Conversation
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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MockWETHandMockUSDCcontracts so the marketplace stack can be exercised end-to-end with realistic ERC20 payment paths against a local chain.deploy-marketplacemodule wired into the existingdeploy.tschain; deploys ConduitController, Seaport, MockWETH, MockUSDC.seed-marketplacemodule:marketplace-bootstrap.tsandmarketplace-seed-api.tsorchestrator entrypoints used by the app repo'sdocker-compose.marketplace.ymlcontainers.RPC_URLenv override on thelocalhosthardhat network so the bootstrap container can reachhttp://anvil:8545from 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
1.6) reportsinformation().version == "1.5"at runtime, so the marketplace-backend signs EIP-712 withSEAPORT_VERSION=1.5on the local stack. Production paths continue to use1.6as before.vendor/seaport/fetch-artifacts.shrequires foundry'sforge+jq+giton the developer's machine. Re-run whenever the pin is bumped.Test plan
cd contracts && yarn compilesucceeds andMockWETH/MockUSDCartifacts are generated.cd contracts/vendor/seaport && ./fetch-artifacts.shproducesSeaport.json(~130KB) andConduitController.json(~30KB).make marketplace-upboots 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