Commit b9dd926
feat(deploy): CREATE2 deterministic deploy script
Single Deploy.s.sol covering all four target chains (Arbitrum One,
Arbitrum Sepolia, Base mainnet, Base Sepolia). The Manager deploys via
CREATE2 through Arachnid's deterministic deployer (0x4e59...) using
salt keccak256('MiTanda.v1.Manager'), giving the same Manager address
on every chain — branding/UX win.
Structure:
- Pre-flight checks (deployer/treasury/subscription non-zero, gas lane
non-zero, Arachnid present on this chain) fail loud before broadcast
- Predict Manager address via pure RLP encoding helper
- Deploy Tanda implementation, three NFTs (with predicted Manager
address), then Manager via CREATE2
- Assert deployed Manager address matches prediction
- Critical ordering: manager.acceptOwnership() runs BEFORE any
owner-only setup (allowlistToken, registerCollection, setActiveCollection),
structurally enforced by being inside the same function with a
require(manager.owner() == deployer) gate between
- 13 post-deploy invariant checks before considering deploy successful
- JSON output to deployments/{chainId}.json for frontend consumption
- Logged post-deploy instructions (add Manager as VRF consumer, fund
subscription, verify contracts on block explorer)
Chain config:
- Base mainnet and Arbitrum One gas-lane keyHashes filled (best-effort
from training data, marked VERIFY against Chainlink docs)
- Base Sepolia and Arbitrum Sepolia gas-lane keyHashes left as bytes32(0)
with TODO comments; pre-flight reverts until set
- Token allowlists per chain: USDC on Base, USDC+MXNB on Arbitrum One,
MXNB on Arbitrum Sepolia (no canonical Sepolia USDC), USDC on Base Sepolia
.env.example documents all required environment variables including
the cross-chain determinism contract (fresh deployer EOA, same starting
nonce on each chain, no intervening transactions).
85 tests still pass; no contract changes in this commit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5ee26b4 commit b9dd926
3 files changed
Lines changed: 565 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
15 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
16 | 33 | | |
17 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments