forked from Ion-Protocol/nucleus-boring-vault
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
69 lines (54 loc) · 3.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
include .env
check-configs:
@echo "l1_file: ${l1_file} l2_file ${l2_file}"
bun lzConfigCheck.cjs ${l1_file} ${l2_file}
checkL1:
@echo "Setting environment variable LIVE_DEPLOY_READ_FILE_NAME to $(file)"
@export LIVE_DEPLOY_READ_FILE_NAME=$(file) && forge test --mp test/LiveDeploy.t.sol --fork-url=${L1_RPC_URL}
checkL2:
@echo "Setting environment variable LIVE_DEPLOY_READ_FILE_NAME to $(file)"
@export LIVE_DEPLOY_READ_FILE_NAME=$(file) && forge test --mp test/LiveDeploy.t.sol --fork-url=${L2_RPC_URL}
deployL1:
@echo "Setting environment variable LIVE_DEPLOY_READ_FILE_NAME to $(file)"
cp ./deployment-config/out-template.json ./deployment-config/out.json
@export LIVE_DEPLOY_READ_FILE_NAME=$(file) && forge script script/deploy/deployAll.s.sol --sig "run(string)" $(file) --fork-url=${L1_RPC_URL}
deployL2:
@echo "Setting environment variable LIVE_DEPLOY_READ_FILE_NAME to $(file)"
cp ./deployment-config/out-template.json ./deployment-config/out.json
@export LIVE_DEPLOY_READ_FILE_NAME=$(file) && forge script script/deploy/deployAll.s.sol --sig "run(string)" $(file) --fork-url=${L2_RPC_URL}
live-deployL1:
@echo "Setting environment variable LIVE_DEPLOY_READ_FILE_NAME to $(file)"
cp ./deployment-config/out-template.json ./deployment-config/out.json
@export LIVE_DEPLOY_READ_FILE_NAME=$(file) && forge script script/deploy/deployAll.s.sol --sig "run(string)" $(file) --fork-url=${L1_RPC_URL} --private-key=$(PRIVATE_KEY) --broadcast --slow --verify
mv ./deployment-config/out.json ./deployment-config/outL1.json
live-deployL2:
@echo "Setting environment variable LIVE_DEPLOY_READ_FILE_NAME to $(file)"
cp ./deployment-config/out-template.json ./deployment-config/out.json
@export LIVE_DEPLOY_READ_FILE_NAME=$(file) && forge script script/deploy/deployAll.s.sol --sig "run(string)" $(file) --fork-url=${L2_RPC_URL} --private-key=$(PRIVATE_KEY) --broadcast --slow --verify
mv ./deployment-config/out.json ./deployment-config/outL2.json
prettier:
prettier --write '**/*.{md,yml,yaml,ts,js}'
solhint:
solhint -w 0 'src/**/*.sol'
slither:
slither src
prepare:
husky
deploy-createx-l1:
forge script script/DeployCustomCreatex.s.sol --rpc-url ${L1_RPC_URL} --private-key ${PRIVATE_KEY} --slow --no-metadata
deploy-createx-l2:
forge script script/DeployCustomCreatex.s.sol --rpc-url ${L2_RPC_URL} --private-key ${PRIVATE_KEY} --slow --no-metadata
check-configs:
bun lzConfigCheck.cjs
chain1 := $(shell cast chain-id -r $(L1_RPC_URL))
chain2 := $(shell cast chain-id -r $(L2_RPC_URL))
symbol := $(shell cat deployment-config/$(fileL1) | jq -r ".boringVault.boringVaultSymbol")
post-deploy:
mkdir -p ./nucleus-deployments/$(symbol)
mv ./deployment-config/outL1.json ./nucleus-deployments/$(symbol)/L1Out.json
mv ./deployment-config/outL2.json ./nucleus-deployments/$(symbol)/L2Out.json
cp ./broadcast/deployAll.s.sol/$(chain1)/run-latest.json ./nucleus-deployments/$(symbol)/L1.json
cp ./broadcast/deployAll.s.sol/$(chain2)/run-latest.json ./nucleus-deployments/$(symbol)/L2.json
cp ./deployment-config/$(fileL1) ./nucleus-deployments/$(symbol)/L1Config.json
cp ./deployment-config/$(fileL2) ./nucleus-deployments/$(symbol)/L2Config.json
cd nucleus-deployments && git checkout -b $(symbol) && git add . && git commit -m "$(symbol) deployment" && git push origin $(symbol) && git checkout main