forked from bgd-labs/protocol-v3.2-pdp-patch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (26 loc) · 1.35 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
# include .env file and export its env vars
# (-include to ignore error if it does not exist)
-include .env
# deps
update:; forge update
# Build & test
build :; forge build --sizes
test :; forge test -vvv
# Utilities
download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${address} ${address}
git-diff :
@mkdir -p diffs
@npx prettier ${before} ${after} --write
@git diff --no-index --diff-algorithm=patience --ignore-space-at-eol ${before} ${after} | \
awk 'BEGIN { in_diff_block = 0; skip_block = 0; buffer = "" } \
/^diff --git/ { \
if (in_diff_block && skip_block == 0) { printf "%s", buffer } \
in_diff_block = 1; skip_block = 0; buffer = $$0 "\n" \
} \
/similarity index 100%/ { skip_block = 1 } \
{ if (in_diff_block && !/^diff --git/) { buffer = buffer $$0 "\n" } } \
END { if (in_diff_block && skip_block == 0) { printf "%s", buffer } }' > diffs/${out}.diff
deploy :
forge script scripts/Deploy.s.sol:Deploy${chain} --rpc-url ${chain} --ledger --mnemonic-indexes ${MNEMONIC_INDEX} --sender ${LEDGER_SENDER} --verify --slow --broadcast
npx catapulta-verify -b broadcast/Deploy.s.sol/${chainId}/run-latest.json
deploy-zk :; FOUNDRY_PROFILE=zksync forge script zksync/scripts/Deploy.s.sol:Deployzksync --zksync --system-mode=true --rpc-url zksync --private-key ${PRIVATE_KEY} --sender ${SENDER} --verify --slow --broadcast