-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (51 loc) · 2.42 KB
/
Makefile
File metadata and controls
69 lines (51 loc) · 2.42 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
include .env.example
ENV_PATH=.env.example
FORGE_DAPP_OUT=out
# Deploy the empty proxy addresses.
deploy-empty-proxies:
DOTENV_CONFIG_PATH=$(ENV_PATH) HARDHAT_NETWORK=hardhat npx hardhat task:deployEmptyUUPSProxies
# Deploy the pauser set contract.
deploy-pauser-set:
DOTENV_CONFIG_PATH=$(ENV_PATH) HARDHAT_NETWORK=hardhat npx hardhat compile:specific --contract contracts/immutable
DOTENV_CONFIG_PATH=$(ENV_PATH) HARDHAT_NETWORK=hardhat npx hardhat task:deployPauserSet
# Ensure that the empty proxy and pauser set addresses exists as these are required for contract compilation.
ensure-addresses: deploy-empty-proxies deploy-pauser-set
forge-test: ensure-addresses
forge soldeer install && forge test
prettier:
npx prettier . --write
compile:
npx hardhat compile
clean:
npx hardhat clean
get-accounts:
DOTENV_CONFIG_PATH=$(ENV_PATH) npx hardhat get-accounts
# Define it as a phony target to avoid conflicts with the test directory
.PHONY: test
test: clean
DOTENV_CONFIG_PATH=$(ENV_PATH) npx hardhat test --network hardhat $(if $(GREP),--grep '$(GREP)',)
# Here, we purposely use a logical OR (||) instead of an if statement with a negation to avoid having
# discrepancies between running locally and in the CI. This is because some shell environments
# handle exit statuses of pipelines differently.
check-selectors:
DAPP_OUT=$(FORGE_DAPP_OUT) forge selectors list | tail -n +2 | diff ./docs/contract_selectors.txt - &> /dev/null || { \
echo "Contract selectors are not up-to-date."; \
echo "Please run 'make update-selectors' to update them."; \
exit 1; \
}
update-selectors:
DAPP_OUT=$(FORGE_DAPP_OUT) forge selectors list | tail -n +2 > ./docs/contract_selectors.txt
check-bindings: ensure-addresses
python3 ../ci/contracts_bindings_update.py --project host check
update-bindings: ensure-addresses
python3 ../ci/contracts_bindings_update.py --project host update
lint-bindings:
cd rust_bindings && cargo clippy -- -D warnings && cd ..
# Update auto-generated files for conformance checks
update-conformance: update-bindings update-selectors
# Make sure all Solidity contracts use the expected SPDX license identifier (BSD-3-Clause-Clear)
# We also check lib/ but exclude external dependencies (forge-std, OpenZeppelin-derived FhevmECDSA).
check-spdx-headers:
bash ../ci/check_spdx_licenses.sh contracts lib --exclude forge-std --exclude cryptography/FhevmECDSA.sol
# Conform to pre-commit checks
conformance: prettier update-conformance