-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
144 lines (125 loc) · 6.5 KB
/
Copy pathMakefile
File metadata and controls
144 lines (125 loc) · 6.5 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.PHONY: all install build test test-v test-fuzz test-gas clean fmt \
deploy-local deploy-unichain-sepolia deploy-base-sepolia \
deploy-arbitrum-sepolia deploy-sepolia
# ── Setup ─────────────────────────────────────────────────────────────────────
install:
forge install uniswap/v4-core
forge install uniswap/v4-periphery
forge install foundry-rs/forge-std
forge install transmissions11/solmate
@echo "✅ Solidity dependencies installed"
# ── Build ─────────────────────────────────────────────────────────────────────
build:
forge build
@echo "✅ Build complete"
# ── Tests ─────────────────────────────────────────────────────────────────────
test:
forge test
test-v:
forge test -vvv
test-fuzz:
forge test --match-test testFuzz --fuzz-runs 10000 -vvv
test-gas:
forge test --gas-report
# ── Format ────────────────────────────────────────────────────────────────────
fmt:
forge fmt
lint:
forge fmt --check
# ── Deploy: Local ─────────────────────────────────────────────────────────────
deploy-local:
@echo "🔨 Deploying to local Anvil..."
forge script script/Deploy.s.sol:DeployLocal \
--rpc-url anvil \
--broadcast \
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
@echo "✅ Local deploy complete"
# ── Deploy Readiness Check ─────────────────────────────────────────────────────
deploy-check:
@echo "🔍 Checking deployment readiness..."
@test -f .env || (echo "❌ .env not found. Run: cp .env.example .env" && exit 1)
@echo "✅ .env found"
@grep -q "PRIVATE_KEY=" .env || (echo "❌ PRIVATE_KEY not set in .env" && exit 1)
@echo "✅ PRIVATE_KEY set"
@grep -q "ARBITRUM_SEPOLIA_RPC_URL=" .env || (echo "❌ ARBITRUM_SEPOLIA_RPC_URL not set" && exit 1)
@echo "✅ RPC endpoints configured"
@forge build > /dev/null 2>&1 && echo "✅ Contracts compile" || (echo "❌ Compilation failed" && exit 1)
@echo "✅ Compilation OK"
@forge test --match-contract IntentLPHookTest > /dev/null 2>&1 && echo "✅ All unit tests pass" || (echo "❌ Tests failing" && exit 1)
@echo "✅ Tests pass"
@forge script script/Deploy.s.sol:DeployIntentLPHook --rpc-url arbitrum_sepolia > /dev/null 2>&1 && echo "✅ Deploy simulation succeeds" || (echo "❌ Simulation failed" && exit 1)
@echo "✅ Simulation OK"
@echo ""
@echo "===================================="
@echo "✅ All checks passed — ready to deploy!"
@echo " Run: make deploy-arbitrum-sepolia"
@echo "===================================="
# ── Deploy: Testnets ──────────────────────────────────────────────────────────
deploy-unichain-sepolia:
@test -f .env || (echo "❌ .env not found. Run: cp .env.example .env" && exit 1)
@source .env && forge script script/Deploy.s.sol:DeployIntentLPHook \
--rpc-url unichain_sepolia \
--broadcast \
--verify \
--private-key $$PRIVATE_KEY
@echo "✅ Deployed to Unichain Sepolia"
deploy-base-sepolia:
@test -f .env || (echo "❌ .env not found. Run: cp .env.example .env" && exit 1)
@source .env && forge script script/Deploy.s.sol:DeployIntentLPHook \
--rpc-url base_sepolia \
--broadcast \
--verify \
--private-key $$PRIVATE_KEY
@echo "✅ Deployed to Base Sepolia"
deploy-arbitrum-sepolia:
@test -f .env || (echo "❌ .env not found. Run: cp .env.example .env" && exit 1)
@source .env && forge script script/Deploy.s.sol:DeployIntentLPHook \
--rpc-url arbitrum_sepolia \
--broadcast \
--verify \
--private-key $$PRIVATE_KEY
@echo "✅ Deployed to Arbitrum Sepolia"
deploy-sepolia:
@test -f .env || (echo "❌ .env not found. Run: cp .env.example .env" && exit 1)
@source .env && forge script script/Deploy.s.sol:DeployIntentLPHook \
--rpc-url sepolia \
--broadcast \
--verify \
--private-key $$PRIVATE_KEY
@echo "✅ Deployed to Ethereum Sepolia"
# ── Frontend ──────────────────────────────────────────────────────────────────
ui-install:
cd frontend && npm install
@echo "✅ Frontend dependencies installed"
ui-dev:
cd frontend && npm run dev
ui-build:
cd frontend && npm run build
# ── Cleanup ───────────────────────────────────────────────────────────────────
clean:
forge clean
@echo "✅ Cleaned"
# ── Help ──────────────────────────────────────────────────────────────────────
help:
@echo ""
@echo "IntentLP — Makefile Commands"
@echo "===================================="
@echo " Smart Contracts"
@echo " make install Install forge dependencies"
@echo " make build Compile contracts"
@echo " make test Run test suite"
@echo " make test-v Run tests verbose"
@echo " make test-fuzz Fuzz tests (10k runs)"
@echo " make test-gas Gas report"
@echo " make deploy-check Validate deploy prerequisites"
@echo " make deploy-local Deploy to local Anvil"
@echo " make deploy-unichain-sepolia Deploy to Unichain Sepolia"
@echo " make deploy-base-sepolia Deploy to Base Sepolia"
@echo " make deploy-arbitrum-sepolia Deploy to Arbitrum Sepolia"
@echo " make deploy-sepolia Deploy to Ethereum Sepolia"
@echo ""
@echo " Frontend"
@echo " make ui-install npm install"
@echo " make ui-dev Start dev server"
@echo " make ui-build Production build"
@echo ""