-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
110 lines (86 loc) · 2.96 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
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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Kolektivo Makefile
#
# WARNING: This file is part of the git repo. DO NOT INCLUDE SENSITIVE DATA!
#
# The Kolektivo smart contracts project uses this Makefile to execute common
# tasks.
#
# The Makefile supports a help command, i.e. `make help`.
#
# Expected enviroment variables are defined in the `dev.env` file.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# -----------------------------------------------------------------------------
# Common
.PHONY: clean
clean: ## Remove build artifacts
@forge clean
.PHONY: build
build: ## Build project
@forge build
.PHONY: update
update: ## Update dependencies
@forge update
.PHONY: test
test: ## Run whole testsuite
@forge test -vvv
.PHONY: fmt
fmt: ## Format code
@forge fmt
.PHONY: fmt-check
fmt-check: ## Check whether code formatted correctly
@forge fmt --check
# -----------------------------------------------------------------------------
# Individual Component Tests
.PHONY: testOracle
testOracle: ## Run Oracle tests
@forge test -vvv --match-contract "Oracle"
.PHONY: testTreasury
testTreasury: ## Run Treasury tests
@forge test -vvv --match-contract "Treasury"
.PHONY: testElasticToken
testElasticToken: ## Run Elastic Receipt Token tests
@forge test -vvv --match-contract "ElasticReceiptToken"
.PHONY: testReserveToken
testReserveToken: ## Run CuracaoReserveToken tests
@forge test -vvv --match-contract "CuracaoReserveToken"
.PHONY: testReserve
testReserve: ## Run Reserve tests
@forge test -vvv --match-contract "Reserve"
.PHONY: testGeoNFT
testGeoNFT: ## Run GeoNFT tests
@forge test -vvv --match-contract "GeoNFT"
.PHONY: testMento
testMento: ## Run Mento tests
@forge test -vvv --match-contract "Mento"
# -----------------------------------------------------------------------------
# Static Analyzers
.PHONY: analyze-slither
analyze-slither: ## Run slither analyzer against project (requires solc-select)
@solc-select install 0.8.10
@solc-select use 0.8.10
@slither src
# Something like this:
# @docker run -v $(pwd):/tmp mythril/myth analyze /tmp/<PATH TO CONTRACT>
.PHONY: analyze-mythril
analyze-mythril: ## Run mythril analyzer against project (requires docker)
@echo "NOT YET IMPLEMENTED"
.PHONY: analyze-c4udit
analyze-c4udit: ## Run c4udit analyzer against project
@c4udit src
# -----------------------------------------------------------------------------
# Reports
.PHONY: gas-report
gas-report: ## Print gas report and create gas snapshots file
@forge snapshot
@forge test --gas-report
.PHONY: cov-report
cov-report: ## Print coverage report and create lcov report file
@forge coverage --report lcov
@forge coverage
# -----------------------------------------------------------------------------
# Help Command
.PHONY: help
help:
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'