Document foundry remappings via node_modules and that embedded lib/contracts clones break parent git; quick forge:build check after npm install. Made-with: Cursor
66 lines
2.8 KiB
Markdown
66 lines
2.8 KiB
Markdown
# Thirdweb core infra — VMID 2103 test harness
|
||
|
||
Deploys **Forwarder → TWRegistry → TWFactory → ContractPublisher** from `@thirdweb-dev/contracts` against **Chain 138** RPC for **VMID 2103** (Thirdweb admin core).
|
||
|
||
## RPC URL (FQDN default)
|
||
|
||
**Canonical HTTPS JSON-RPC (NPM → VMID 2103):** `https://rpc.tw-core.d-bis.org`
|
||
**WebSocket:** `wss://wss.tw-core.d-bis.org` (see `docs/04-configuration/RPC_ENDPOINTS_MASTER.md`).
|
||
|
||
E2E checks (2026-04-09): `eth_chainId` → `0x8a`, `eth_blockNumber` OK; `forge script … --rpc-url https://rpc.tw-core.d-bis.org` simulation OK.
|
||
|
||
`scripts/rpc-url-2103.sh` (used by npm scripts and `deploy-*-with-project-env.sh`) **defaults to that FQDN**. For **LAN-only** HTTP to the container, set:
|
||
|
||
```bash
|
||
export RPC_THIRDWEB_ADMIN_LAN_ONLY=1
|
||
# optional: export RPC_THIRDWEB_ADMIN_CORE=192.168.11.217
|
||
```
|
||
|
||
Or set a full override: `RPC_URL_2103` or `RPC_TW_CORE_HTTP`.
|
||
|
||
- **Foundry:** compiles Thirdweb sources via `node_modules` remappings; `script/DeployThirdwebCore.s.sol`.
|
||
- **Hardhat:** compiles only `contracts/HardhatPlaceholder.sol`; deploy uses **ABI + bytecode from `forge build`** (`out/`) to avoid an OpenZeppelin `Address` library name clash inside Thirdweb’s dependency graph.
|
||
|
||
## Commands
|
||
|
||
```bash
|
||
cd thirdweb-core-2103-test
|
||
npm install
|
||
npm run forge:build
|
||
npm run forge:dry-run
|
||
|
||
# Loads PRIVATE_KEY via parent repo load-project-env.sh; RPC defaults to https://rpc.tw-core.d-bis.org
|
||
npm run deploy:forge:project-env
|
||
npm run deploy:hh:project-env
|
||
|
||
export PRIVATE_KEY=0x...
|
||
npm run forge:deploy
|
||
npm run hh:deploy
|
||
```
|
||
|
||
Use **`--legacy --with-gas-price 1000000000`** on Foundry for Besu chain minimum (see `smom-dbis-138` deployment docs).
|
||
|
||
OpenZeppelin is pinned to **4.8.3** so Thirdweb 3.15 compiles (avoids `_contextSuffixLength` conflicts with OZ 4.9+).
|
||
|
||
## Dependencies (npm only — no `lib/contracts` clone)
|
||
|
||
Foundry remappings in `foundry.toml` point Thirdweb and OpenZeppelin at **`node_modules/`** (for example `tw/=node_modules/@thirdweb-dev/contracts/`). You do **not** need a separate git checkout under `lib/contracts/`.
|
||
|
||
If you previously cloned Thirdweb (or another vendor) into `lib/contracts`, remove that directory and rely on `npm install` only. A nested `.git` there breaks the parent monorepo (`git add` warns about embedded repositories); the parent workspace intentionally **ignores** `thirdweb-core-2103-test/lib/contracts/` in `.gitignore` so accidental clones stay local.
|
||
|
||
Quick compile check after install:
|
||
|
||
```bash
|
||
npm install
|
||
npm run forge:build
|
||
```
|
||
|
||
## CREATE2 on VMID 2103
|
||
|
||
`Create2Factory` + `Create2Probe` (`src/`) and `script/Create2DeployTest.s.sol` deploy via OpenZeppelin `Create2`, assert `predictProbe(salt) == deployProbe(salt)`, and read `VMID_TAG == 2103`.
|
||
|
||
```bash
|
||
npm run forge:create2:dry-run
|
||
npm run deploy:create2:project-env # needs PRIVATE_KEY via load-project-env
|
||
```
|