-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
57 lines (45 loc) · 1007 Bytes
/
Makefile
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
# Use bash as shell
SHELL := /bin/bash
# Load environment variables
ifneq (,$(wildcard ./.env))
include .env
export
endif
# Phony targets
.PHONY: install clean build test format docs snapshot diff deploy
# Default: install deps, clean build outputs, format code, build code, run tests
all: install clean format build test
# Install dependencies
install:
@forge install
# Clean build outputs
clean:
@forge clean
# Build contracts + tests
build:
@forge build
# Run tests
test:
@forge test -vvv
# Execute scripts/deploy given environment variables
deploy:
@forge script scripts/Deploy.sol:Deploy \
--broadcast \
--optimize \
--optimizer-runs 1000000 \
--extra-output-files abi \
--rpc-url $(RPC_URL)
# Save gas snapshot
snapshot:
@forge snapshot
# Compare current gas profile to saved gas snapshot
diff:
@forge snapshot --diff
# Format contracts
format:
@forge fmt
# Generate and serve docs
docs:
@forge doc --build
@open http://localhost:4000
@forge doc --serve --port 4000