-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
112 lines (94 loc) · 3.14 KB
/
Makefile
File metadata and controls
112 lines (94 loc) · 3.14 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
102
103
104
105
106
107
108
109
110
111
112
###############################################################################
# Makefile for Foundry Deployment & Testing
###############################################################################
include .env
# ---------------------------------------------------------------------------
# Variables
# ---------------------------------------------------------------------------
# RPC URLs (override if you wish, e.g., `make deploy BASE_RPC=...`)
BASE_RPC ?= $(BASE_INFURA_URL)
SEPOLIA_RPC ?= $(SEPOLIA_INFURA_URL)
BASE_SEPOLIA_RPC ?= $(BASE_SEPOLIA_INFURA_URL)
# Sender addresses
BASE_SENDER ?= 0x22b0112c1f84b646394F701d15C97De4147BE2aD
SEPOLIA_SENDER ?= 0x39053B170bBD9580d0b86e8317c685aEFB65f1ec
# Common Forge script flags
FORGE_COMMON_FLAGS = \
--broadcast \
-i 1 \
-vvvv \
--via-ir \
--verify \
--optimize
# Base-specific flags
BASE_FLAGS = $(FORGE_COMMON_FLAGS) --etherscan-api-key $(BASE_ETHERSCAN_API_KEY)
# Sepolia-specific flags
SEPOLIA_FLAGS = $(FORGE_COMMON_FLAGS) --etherscan-api-key $(ETH_ETHERSCAN_API_KEY)
# ---------------------------------------------------------------------------
# Deployment & Setup Targets
# ---------------------------------------------------------------------------
.PHONY: deploy deploy-sepolia deploy-base-sepolia deploy-base deploy-anvil \
deposit-count recipient-nonces flatten \
test-escrow test-escrow-with-fee gas create-payments init-repo-base-sepolia
# ----------------------
# Deploy to Sepolia
# ----------------------
deploy-sepolia:
forge script script/Deploy.Sepolia.sol \
--rpc-url $(SEPOLIA_RPC) \
--sender $(SEPOLIA_SENDER) \
$(SEPOLIA_FLAGS)
# ----------------------
# Deploy to Base Sepolia
# ----------------------
deploy-base-sepolia:
forge script script/Deploy.BaseSepolia.s.sol \
--rpc-url $(BASE_SEPOLIA_RPC) \
--sender $(SEPOLIA_SENDER) \
$(BASE_FLAGS)
# ----------------------
# Deploy to Base Mainnet
# ----------------------
deploy-base:
forge clean
forge script script/Deploy.Base.s.sol \
--rpc-url $(BASE_RPC) \
--sender $(BASE_SENDER) \
$(BASE_FLAGS)
# ----------------------
# Deploy to Anvil (Local)
# ----------------------
deploy-anvil:
forge script script/Deploy.Anvil.s.sol:DeployAnvil \
--fork-url http://localhost:8545 \
--broadcast \
--unlocked \
-vvvv \
--via-ir
# ----------------------
# Initialize Repo on Base Sepolia
# ----------------------
init-repo:
forge script script/InitRepo.BaseSepolia.s.sol \
--rpc-url $(BASE_SEPOLIA_RPC) \
--sender $(SEPOLIA_SENDER) \
$(BASE_FLAGS)
# ---------------------------------------------------------------------------
# Testing Targets
# ---------------------------------------------------------------------------
test-escrow:
forge test --match-path test/Escrow.t.sol
# ---------------------------------------------------------------------------
# Utility Scripts
# ---------------------------------------------------------------------------
gas:
forge script script/utils/Gas.s.sol
create-payments:
forge script script/utils/CreatePayments.s.sol \
--rpc-url $(SEPOLIA_RPC) \
--sender $(SEPOLIA_SENDER) \
--broadcast \
-i 1 \
-vvvv
coverage:
forge coverage --ir-minimum --report lcov