-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
274 lines (235 loc) · 6.62 KB
/
makefile
File metadata and controls
274 lines (235 loc) · 6.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# Arenium Protocol Makefile
# ======================
# Network Configuration
BASE_SEPOLIA_RPC_URL ?= $(BASE_SEPOLIA_RPC_URL)
BASE_SEPOLIA_VERIFIER_URL = https://base-sepolia.blockscout.com/api/
AVALANCHE_RPC_URL ?= $(AVALANCHE_RPC_URL)
AVALANCHE_VERIFIER_URL = https://snowscan.xyz/api/
PRIVATE_KEY ?= $(PRIVATE_KEY)
# Common forge flags
FORGE_FLAGS = --private-key $(PRIVATE_KEY) -vvvv
VERIFY_FLAGS = --verify --verifier blockscout
# ======================
# Build Commands
# ======================
.PHONY: build
build:
@echo "Building contracts..."
forge build
.PHONY: clean
clean:
@echo "Cleaning build artifacts..."
forge clean
.PHONY: install
install:
@echo "Installing dependencies..."
forge install
.PHONY: update
update:
@echo "Updating dependencies..."
forge update
# ======================
# Test Commands
# ======================
.PHONY: test
test:
@echo "Running all tests..."
forge test
.PHONY: test-unit
test-unit:
@echo "Running unit tests..."
forge test --match-path "test/unit/*"
.PHONY: test-integration
test-integration:
@echo "Running integration tests..."
forge test --match-path "test/integration/*"
.PHONY: test-fork
test-fork:
@echo "Running fork tests..."
forge test --match-path "test/fork-uint/*"
.PHONY: test-gas
test-gas:
@echo "Running gas report..."
forge test --gas-report
.PHONY: test-coverage
test-coverage:
@echo "Running coverage report..."
forge coverage
# ======================
# Deployment Commands - Base Sepolia
# ======================
.PHONY: deploy-base-sepolia
deploy-base-sepolia:
@echo "Deploying all contracts to Base Sepolia..."
forge script script/DeployAll.s.sol:DeployAll \
--rpc-url $(BASE_SEPOLIA_RPC_URL) \
$(FORGE_FLAGS) \
$(VERIFY_FLAGS) \
--verifier-url $(BASE_SEPOLIA_VERIFIER_URL) \
--broadcast
.PHONY: deploy-manager-base
deploy-manager-base:
@echo "Deploying PredictionMarketManager to Base Sepolia..."
forge script script/deployments/DeployManager.s.sol:DeployManager \
--rpc-url $(BASE_SEPOLIA_RPC_URL) \
$(FORGE_FLAGS) \
$(VERIFY_FLAGS) \
--verifier-url $(BASE_SEPOLIA_VERIFIER_URL) \
--broadcast
.PHONY: deploy-amm-base
deploy-amm-base:
@echo "Deploying AMMContract to Base Sepolia..."
forge script script/deployments/DeployAMM.s.sol:DeployAMM \
--rpc-url $(BASE_SEPOLIA_RPC_URL) \
$(FORGE_FLAGS) \
$(VERIFY_FLAGS) \
--verifier-url $(BASE_SEPOLIA_VERIFIER_URL) \
--broadcast
# ======================
# Deployment Commands - Avalanche (Future)
# ======================
.PHONY: deploy-avalanche
deploy-avalanche:
@echo "Deploying all contracts to Avalanche..."
forge script script/DeployAll.s.sol:DeployAll \
--rpc-url $(AVALANCHE_RPC_URL) \
$(FORGE_FLAGS) \
$(VERIFY_FLAGS) \
--verifier-url $(AVALANCHE_VERIFIER_URL) \
--broadcast
# ======================
# Interaction Scripts
# ======================
.PHONY: interact-amm
interact-amm:
@echo "Running AMM interaction script..."
forge script script/interaction-scripts/AMMScript.s.sol:AMMScript \
--rpc-url $(BASE_SEPOLIA_RPC_URL) \
$(FORGE_FLAGS) \
--broadcast
.PHONY: interact-market
interact-market:
@echo "Running Market interaction script..."
forge script script/interaction-scripts/MarketScript.s.sol:MarketScript \
--rpc-url $(BASE_SEPOLIA_RPC_URL) \
$(FORGE_FLAGS) \
--broadcast
.PHONY: create-market
create-market:
@echo "Creating a new prediction market..."
forge script script/interaction-scripts/CreateMarket.s.sol:CreateMarket \
--rpc-url $(BASE_SEPOLIA_RPC_URL) \
$(FORGE_FLAGS) \
--broadcast
# ======================
# Verification Commands
# ======================
.PHONY: verify-base
verify-base:
@echo "Verifying contracts on Base Sepolia..."
forge verify-contract \
--verifier blockscout \
--verifier-url $(BASE_SEPOLIA_VERIFIER_URL) \
--rpc-url $(BASE_SEPOLIA_RPC_URL) \
$(CONTRACT_ADDRESS) \
$(CONTRACT_NAME)
# ======================
# Development Utilities
# ======================
.PHONY: format
format:
@echo "Formatting code..."
forge fmt
.PHONY: format-check
format-check:
@echo "Checking code formatting..."
forge fmt --check
.PHONY: clear
clear:
clear
.PHONY: console
console:
@echo "Starting Forge console..."
forge console
# Generate documentation
.PHONY: doc
doc:
@echo "Generating documentation..."
forge doc
# ======================
# Contract Size Check
# ======================
.PHONY: size
size:
@echo "Checking contract sizes..."
forge build --sizes
# ======================
# Local Development
# ======================
.PHONY: anvil
anvil:
@echo "Starting Anvil local node..."
anvil
.PHONY: deploy-local
deploy-local:
@echo "Deploying to local Anvil..."
forge script script/DeployAll.s.sol:DeployAll \
--rpc-url http://localhost:8545 \
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
--broadcast
# ======================
# Security & Analysis
# ======================
.PHONY: slither
slither:
@echo "Running Slither analysis..."
slither .
.PHONY: mythril
mythril:
@echo "Running Mythril analysis..."
myth analyze src/
# ======================
# Help
# ======================
.PHONY: help
help:
@echo "Arenium Protocol - Available Commands:"
@echo ""
@echo "Build Commands:"
@echo " build - Compile all contracts"
@echo " clean - Remove build artifacts"
@echo " install - Install dependencies"
@echo " update - Update dependencies"
@echo ""
@echo "Test Commands:"
@echo " test - Run all tests"
@echo " test-unit - Run unit tests only"
@echo " test-integration - Run integration tests only"
@echo " test-fork - Run fork tests only"
@echo " test-gas - Run gas report"
@echo " test-coverage - Run coverage report"
@echo ""
@echo "Deployment Commands:"
@echo " deploy-base-sepolia - Deploy all contracts to Base Sepolia"
@echo " deploy-manager-base - Deploy PredictionMarketManager only"
@echo " deploy-amm-base - Deploy AMMContract only"
@echo " deploy-avalanche - Deploy to Avalanche (future)"
@echo ""
@echo "Interaction Commands:"
@echo " interact-amm - Run AMM interaction script"
@echo " interact-market - Run Market interaction script"
@echo " create-market - Create a new prediction market"
@echo ""
@echo "Development Utilities:"
@echo " format - Format code"
@echo " format-check - Check code formatting"
@echo " doc - Generate documentation"
@echo " size - Check contract sizes"
@echo " anvil - Start local Anvil node"
@echo " deploy-local - Deploy to local Anvil"
@echo ""
@echo "Security & Analysis:"
@echo " slither - Run Slither analysis"
@echo " mythril - Run Mythril analysis"
# Default target
.DEFAULT_GOAL := help