forked from luxfi/standard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (77 loc) · 2.1 KB
/
Makefile
File metadata and controls
101 lines (77 loc) · 2.1 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
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
# Lux Standard Makefile for Foundry
-include .env
.PHONY: all test clean deploy
# Build
build:
forge build
# Clean
clean:
forge clean
rm -rf cache_forge
# Test
test:
forge test
test-verbose:
forge test -vvvv
test-gas:
forge test --gas-report
# Coverage
coverage:
forge coverage
coverage-report:
forge coverage --report lcov
# Format
format:
forge fmt
# Lint
lint:
forge fmt --check
# Deploy with CREATE2 for deterministic addresses
deploy-local:
forge script script/DeployWithCreate2.s.sol:DeployWithCreate2 --rpc-url localhost --broadcast
deploy-testnet:
forge script script/DeployWithCreate2.s.sol:DeployWithCreate2 --rpc-url testnet --broadcast --verify
deploy-mainnet:
forge script script/DeployWithCreate2.s.sol:DeployWithCreate2 --rpc-url mainnet --broadcast --verify
# Compute addresses before deployment
compute-addresses:
forge script script/DeployWithCreate2.s.sol:ComputeCreate2Addresses
# Install
install:
forge install foundry-rs/forge-std --no-commit
forge install openzeppelin/openzeppelin-contracts@v4.9.3 --no-commit
# Update
update:
forge update
# Snapshot
snapshot:
forge snapshot
# Anvil
anvil:
anvil
anvil-fork-mainnet:
anvil --fork-url ${RPC_MAINNET}
anvil-fork-testnet:
anvil --fork-url ${RPC_TESTNET}
# Verify
verify:
forge verify-contract ${contract} ${address} --chain-id ${chain} --etherscan-api-key ${ETHERSCAN_API_KEY}
# Slither
slither:
slither src/
# Help
help:
@echo "Usage:"
@echo " make build - Build contracts"
@echo " make test - Run tests"
@echo " make test-verbose - Run tests with verbose output"
@echo " make test-gas - Run tests with gas report"
@echo " make coverage - Generate coverage report"
@echo " make format - Format code"
@echo " make lint - Check code formatting"
@echo " make deploy-local - Deploy to local network"
@echo " make deploy-testnet - Deploy to testnet"
@echo " make deploy-mainnet - Deploy to mainnet"
@echo " make install - Install dependencies"
@echo " make anvil - Start local Anvil node"
@echo " make snapshot - Create gas snapshot"