-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (40 loc) · 1.27 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
# Makefile for Dolce Vita Collector
include .env
# Scripts
FETCH_RESERVES_SCRIPT := script/FetchReserves.s.sol
MINT_TO_TREASURY_SCRIPT := script/MintToTreasury.s.sol
# Log directory
LOG_DIR := ./logs
# Timeout duration (5 minutes)
TIMEOUT := 300
# Determine if it's a dry run
ifneq ($(dry),)
PRIVATE_KEY_ARG := --sender $(SENDER)
EXTRA_ARGS := -vvvv
else
PRIVATE_KEY_ARG := --private-key ${PRIVATE_KEY}
EXTRA_ARGS := --broadcast -vvvv
endif
.PHONY: fetch-reserves mint-to-treasury run-all clean
$(LOG_DIR):
@mkdir -p $(LOG_DIR)
fetch-reserves: $(LOG_DIR)
@echo "Fetching reserves list for all networks..."
@forge script ${FETCH_RESERVES_SCRIPT} -vvvv || true
@if [ -f "./logs/reserves.json" ] && [ -s "./logs/reserves.json" ]; then \
echo "Reserves fetched successfully"; \
else \
echo "Failed to fetch reserves" && exit 1; \
fi
mint:
@if [ -z "$(NETWORK)" ]; then \
echo "Error: NETWORK is not set. Use 'make mint NETWORK=<network_name>' or set NETWORK in .env file."; \
exit 1; \
fi
@echo "Minting for network: $(NETWORK)"
TARGET_NETWORK=$(NETWORK) forge script script/MintToTreasury.s.sol:MintToTreasuryScript --broadcast
clean:
@find $(LOG_DIR) -type f -delete
@find broadcast -mindepth 1 -delete
@find cache -mindepth 1 -delete
@find out -mindepth 1 -delete