generated from ahmedali8/hardhat-ts-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
43 lines (36 loc) · 1.08 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
# Include .env file and export its environment variables
# (-include to ignore error if it does not exist)
-include .env
# Update dependencies
setup:
@make update-libs
@make create-env
@make install-nodejs-deps
update-libs:
@git submodule update --init --recursive # equivalent to: forge install
install-nodejs-deps:
@yarn install --immutable
# Create .env file if it doesn't exist, using .env.example as a template
create-env:
@[ ! -f ./.env ] && (echo "Copying .env.example to .env" && cp ./.env.example ./.env) || echo ".env exists"
# Test
test-all:
@yarn test
@forge test
# Foundry Coverage
foundry-report:
@bash ./shell/foundry-coverage.sh
# Deploy (use "@" to hide the command from your shell)
deploy-contract:
@read -p "Enter contract name: " contract; \
read -p "Enter chain: " chain; \
if [ -n "$$contract" ] && [ -n "$$chain" ]; then \
echo "Deploying contract: $$contract on chain: $$chain"; \
forge script scripts/foundry/$$contract.s.sol \
--broadcast \
--rpc-url "$$chain" \
--verify \
-vvvv; \
else \
echo "Contract name and chain cannot be empty."; \
fi