forked from revert-finance/v3utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (38 loc) · 1.15 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
ifneq (,$(wildcard ./.env))
include .env
export
endif
DEPLOY_CMD = forge script script/$(CONTRACT).s.sol:$(CONTRACT)Script --rpc-url $(RPC_URL) --broadcast --legacy --gas-price 0
VERIFY_CMD = forge script script/Verify.s.sol:Verify$(CONTRACT)Script
build: src/V3Utils.sol clean
forge build
test: src/V3Utils.sol test/*
forge test
.PHONY: clean v3utils v3automation structhash
clean:
forge clean && rm -rf cache
v3utils:
$(eval CONTRACT=V3Utils)
v3automation:
$(eval FOUNDRY_PROFILE=linker)
$(eval CONTRACT=V3Automation)
v3automation-check:
forge script script/V3Automation.s.sol:BeforeV3AutomationScript
@if [[ $$(cast co $(STRUCT_HASH_ADDRESS) --rpc-url $(RPC_URL) | wc -m) -eq 3 ]]; then echo 'structhash not deployed yet. =>> `make deploy-structhash` first'; exit 1; fi
structhash:
$(eval CONTRACT=StructHash)
deploy-%: %
$(DEPLOY_CMD)
deploy-v3utils:
deploy-structhash:
deploy-v3automation:
verify-%: %
$(VERIFY_CMD)
verify-v3utils:
verify-structhash:
verify-v3automation: v3automation-check v3automation
$(VERIFY_CMD)
init-v3utils:
init-v3automation:
init-%: %
forge script script/Init.s.sol:$(CONTRACT)InitializeScript --rpc-url $(RPC_URL) --broadcast