-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
140 lines (100 loc) · 2.94 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
output=output
echo=off
# solc =
ifneq ($(use_solc), true)
HARDHAT=1
endif
all: main
ifndef HARDHAT
SRCS= $(wildcard ./contracts/*.sol)
ifneq ($(fs), )
SRCS = $(fs)
endif
SRCS_OBJS = $(patsubst %.sol, %_output, $(SRCS))
main: select clean build
build: $(SRCS_OBJS)
define show_title
@echo -n "--------------------------------------------------------"
@echo -n $(1)
@echo "--------------------------------------------------------"
endef
$(SRCS_OBJS):%_output : %.sol
$(call show_title, $<)
@solc @openzeppelin=`pwd`/node_modules/@openzeppelin --optimize --overwrite --abi --bin -o $(output)/$@ $<
@echo "output-->:"
@ls $(output)/$@
select:
ifneq ($(v), )
@solc-select use $(v)
endif
#v=0.8.0
install:
ifneq ($(v), )
@solc-select install $(v)
endif
clean:
@echo "clean ${output}"
@rm -v -rf $(output)/*
else
#use npx hardhat
main: clean build
build:
npx hardhat compile
clean:
#npx
npx hardhat clean
endif
upgrade:
npx hardhat run ./scripts/violas_proof_deploy_upgrade.js
deploy:
npx hardhat run ./scripts/violas_proof_deploy_upgrade.js
init:init_main init_datas
init_main:
npx hardhat run ./scripts/init_main.js
init_datas:
npx hardhat run ./scripts/init_datas.js
show_contracts:
npx hardhat run ./scripts/show_contract.js
define hardhat_run
@npx hardhat run ./scripts/switchs/$(strip $1)/$(subst _.,.,$(subst __,_,$(strip $(2))_$(strip $(3))_$(strip $(4)).js))
endef
define show_conf
@npx hardhat run ./scripts/switchs/$(strip $1)/show_confs.js
endef
open:
$(call show_conf, "contracts")
$(call hardhat_run , "contracts", open, $(target), $(index))
$(call show_conf, "contracts")
close:
$(call show_conf, "contracts")
$(call hardhat_run , "contracts", close, $(target), $(index))
$(call show_conf, "contracts")
use: init_tokens_script
$(call show_conf, "tokens")
$(call hardhat_run, "tokens", open, $(target))
$(call show_conf, "tokens")
unuse: init_tokens_script
$(call show_conf, "tokens")
$(call hardhat_run , "tokens", close, $(target))
$(call show_conf, "tokens")
init_tokens_script:
@npx hardhat run scripts/switchs/tokens/update_token_scripts.js
clean_tokens_script:
@npx hardhat run scripts/switchs/tokens/clean_tokens_scripts.js
show_tokens_conf:
$(call show_conf, "tokens")
show_contracts_conf:
$(call show_conf, "contracts")
show_deploys_conf:
@npx hardhat run ./scripts/tokens/show_erc20_tokens_conf.js
show_deploys_tokens:
@npx hardhat run ./scripts/tokens/show_erc20_tokens.js
deploys_erc20:
@npx hardhat run ./scripts/tokens/deploy_erc20_tokens.js
mint_to_senders:
@npx hardhat run ./scripts/tokens/mint_erc20_tokens_to_sender.js
mint_to_faucet:
@npx hardhat run ./scripts/tokens/mint_erc20_tokens_to_faucet.js
help:
@npx hardhat run scripts/helps.js
.PHONY: select build clean deploy init init_main init_datas show_contracts show_contracts_conf show_tokens_conf open close use unuse init_tokens_script clean_tokens_script show_deploys_conf deploys_erc20 show_deploys_tokens