-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathMakefile
64 lines (40 loc) · 2.09 KB
/
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
58
59
60
61
62
63
64
# By default we want to build.
all: install build
# ===== Basic Development Rules =======================================================================================
# Install forge dependencies (not needed if submodules are already initialized).
install:; forge install && yarn install
# Build contracts and inject the Poseidon library.
build:; forge build
# Run tests, with debug information and gas reports.
test:; FOUNDRY_PROFILE=debug forge test
# ===== Profiling Rules ===============================================================================================
# Benchmark the tests.
bench:; FOUNDRY_PROFILE=bench forge test --gas-report
# Snapshot the current test usages.
snapshot:; FOUNDRY_PROFILE=bench forge snapshot
# ===== Deployment Rules ==============================================================================================
# Deploy contracts
deploy: install build; node --no-warnings src/script/deploy.js deploy
deploy-testnet: install build; node --no-warnings src/script/deploy.js deploy-testnet
deploy-devnet: install build; node --no-warnings src/script/deploy.js deploy-devnet
mock: install build; node --no-warnings src/script/deploy.js mock
local-mock: install build; node --no-warnings src/script/deploy.js local-mock
set-op-gas-limit: install build; node --no-warnings src/script/deploy.js set-op-gas-limit
# Upgrade contracts
# upgrade: install build; node --no-warnings scripts/deploy.js upgrade
# ===== Utility Rules =================================================================================================
# Format the solidity code.
format:; forge fmt; npx prettier --write .
# Checks the formatting
format-check:; forge fmt --check; npx prettier --check .
# Lint the solidity code.
lint:; yarn lint
# Clean the build artifacts.
clean:; forge clean
# Get a test coverage report.
coverage:; forge coverage
# Update forge dependencies.
update:; forge update
# ===== Documentation Rules ============================================================================================
# Generate the documentation.
doc:; forge doc --build; forge doc --serve -p 3000