generated from llamaxyz/llama-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
33 lines (28 loc) · 1.39 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
# include .env file and export its env vars
# (-include to ignore error if it does not exist)
-include .env
# deps
update :; forge update
install :; forge install
# Build & test
build :; forge clean && forge build
test :; forge clean && forge test --etherscan-api-key ${ETHERSCAN_API_KEY} $(call compute_test_verbosity,${V}) # Usage: make test [optional](V=<{1,2,3,4,5}>)
match :; forge clean && forge test --etherscan-api-key ${ETHERSCAN_API_KEY} -m ${MATCH} $(call compute_test_verbosity,${V}) # Usage: make match MATCH=<TEST_FUNCTION_NAME> [optional](V=<{1,2,3,4,5}>)
report :; forge clean && forge test --gas-report | sed -e/╭/\{ -e:1 -en\;b1 -e\} -ed | cat > .gas-report
# Deploy and Verify Contract
deploy-contract :; forge script script/DeployContract.s.sol:DeployContract --rpc-url ${RPC_POLYGON_URL} --broadcast --private-key ${PRIVATE_KEY} --verify --etherscan-api-key ${POLYGONSCAN_API_KEY} -vvvv
verify-contract :; forge script script/DeployContract.s.sol:DeployContract --rpc-url ${RPC_POLYGON_URL} --verify --etherscan-api-key ${POLYGONSCAN_API_KEY} -vvvv
# Clean & lint
clean :; forge clean
lint :; npx prettier --write */*.sol
# Defaults to -v if no V=<{1,2,3,4,5} specified
define compute_test_verbosity
$(strip \
$(if $(filter 1,$(1)),-v,\
$(if $(filter 2,$(1)),-vv,\
$(if $(filter 3,$(1)),-vvv,\
$(if $(filter 4,$(1)),-vvvv,\
$(if $(filter 5,$(1)),-vvvvv,\
-v
))))))
endef