-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (55 loc) Β· 2.62 KB
/
Copy pathMakefile
File metadata and controls
71 lines (55 loc) Β· 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
61
62
63
64
65
66
67
68
69
70
71
# Two-Tier Money β Makefile
# Recipes source .env themselves (set -a) so the per-role keys/addresses reach forge/npm.
# CHAIN selects the target for seed/fund-check: local (default) | sepolia.
# NB: processes receive it as CHAIN_NAME β foundry binaries auto-load .env and bind a
# CHAIN variable to their --chain flag, so the env name must not collide.
CHAIN ?= local
LOCAL_RPC := http://127.0.0.1:8545
ENV := set -a; [ -f .env ] && . ./.env; set +a
# Call the local tsx binary directly: under MSYS2 `npm run`/`npx` spawn the script in
# an env-stripped shim, so the per-role keys & co. never reach it. The .bin shim resolves its
# own imports, so the working directory does not matter.
TSX := relayer/node_modules/.bin/tsx
ifeq ($(CHAIN),sepolia)
RPC_FLAG = --rpc-url "$$SEPOLIA_RPC_URL"
else
RPC_FLAG = --rpc-url $(LOCAL_RPC)
endif
.PHONY: build test fmt fmt-check anvil deploy-local deploy-sepolia seed fund-check relayer indexer front front-build
build:
cd contracts && forge build
test:
cd contracts && forge test -vv
fmt:
cd contracts && forge fmt
fmt-check:
cd contracts && forge fmt --check
# Local chain on Anvil's default mnemonic β its well-known accounts are exactly the
# public keys/addresses the .env carries, so no mnemonic needs to be passed or stored.
anvil:
anvil
deploy-local:
@$(ENV); cd contracts && forge script script/Deploy.s.sol:Deploy --rpc-url $(LOCAL_RPC) --broadcast
# One-shot testnet deploy + seed; --verify uses foundry.toml [etherscan] (ETHERSCAN_API_KEY).
deploy-sepolia:
@$(ENV); cd contracts && forge script script/Deploy.s.sol:Deploy --rpc-url "$$SEPOLIA_RPC_URL" --broadcast --verify
# Idempotent re-seed against deployments/<chain>.json (clients, DEP, sETH top-ups).
seed:
@$(ENV); cd contracts && forge script script/Seed.s.sol:Seed $(RPC_FLAG) --broadcast
# Relayer sETH balance alert (exit 1 when under MIN_RELAYER_BALANCE).
fund-check:
@$(ENV); CHAIN_NAME=$(CHAIN) $(TSX) relayer/scripts/fund-check.ts
# Relayer on the host with .env loaded (CHAIN=local|sepolia).
relayer:
@$(ENV); CHAIN_NAME=$(CHAIN) $(TSX) watch relayer/src/index.ts
# Ponder indexer on the host (reads deployments/<chain>.json, serves its API on :42069).
# Calls the local ponder binary directly (npm-run shims strip env under MSYS2).
indexer:
@$(ENV); cd indexer && CHAIN_NAME=$(CHAIN) node_modules/.bin/ponder dev
# Vite dev server for the frontend (http://localhost:5173). For local dev the defaults
# (relayer :3001, indexer :42069) need no env; override via VITE_* in .env if needed.
front:
cd frontend && npm run dev
# Production build of the frontend (static assets in frontend/dist).
front-build:
cd frontend && npm run build