Skip to content

Commit ce1e2f5

Browse files
authored
feat: update Makefile (#2292)
1 parent ca40ffa commit ce1e2f5

1 file changed

Lines changed: 46 additions & 3 deletions

File tree

claim_contracts/Makefile

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help \
1+
.PHONY: help launch-env \
22
calldata-update-merkle-root calldata-update-limit-timestamp calldata-approve-spending calldata-unpause calldata-pause \
33
deploy-token deploy-token-sepolia deploy-token-mainnet \
44
deploy-claimable-local deploy-claimable-sepolia deploy-claimable-base-sepolia deploy-claimable-mainnet deploy-claimable-base-mainnet \
@@ -40,9 +40,52 @@ APPROVE_AMOUNT ?= 2600000000000000000000000000
4040
AMOUNT_TO_CLAIM = $(shell curl -S -H "Content-Type: application/json" http://localhost:4000/api/proof/\$(CLAIMER) | jq -r .amount)
4141
MERKLE_PROOF_TO_CLAIM = $(shell curl -S -H "Content-Type: application/json" http://localhost:4000/api/proof/\$(CLAIMER) | jq .proof | tr -d '"\n ')
4242

43+
# Mainnet launch environment — the file the launch runbook tells the operator to keep and source.
44+
# The mainnet deploy targets depend on `launch-env`, so its values (and anything still MISSING) are
45+
# printed right before the deploy prompts for the key, instead of relying on the operator having
46+
# sourced the right file in the right shell.
47+
LAUNCH_ENV ?= $(HOME)/align-launch.env
48+
LAUNCH_ENV_VARS = ETH_RPC BASE_RPC ETH_TOKEN BASE_TOKEN CLAIM_ADMIN_SAFE ETH_DISTRIBUTOR_SAFE \
49+
BASE_DISTRIBUTOR_SAFE ETH_TREASURY_SAFE DEPLOYER START_TIMESTAMP ETH_DEADLINE \
50+
BASE_DEADLINE SMOKE_TEST_ADDRESS ETH_AMOUNT BASE_AMOUNT ETH_CLAIM BASE_CLAIM \
51+
ETH_ROOT BASE_ROOT
52+
# Reported as set/MISSING only — never printed. The deploy targets read ETHERSCAN_API_KEY straight
53+
# from the environment, so an unset one only surfaces as a forge argument error.
54+
LAUNCH_ENV_SECRETS = ETHERSCAN_API_KEY
55+
4356
help: ## 📚 Show help for each of the Makefile recipes
4457
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
4558

59+
launch-env: ## 🔎 Print the launch runbook variables from $(LAUNCH_ENV) (MISSING when unset)
60+
@if [ ! -r "$(LAUNCH_ENV)" ]; then \
61+
echo "launch env file not found: $(LAUNCH_ENV)"; \
62+
echo "Create it from the 'Environment' section of the launch runbook,"; \
63+
echo "or pass LAUNCH_ENV=/dev/null to run without it."; \
64+
exit 1; \
65+
fi; \
66+
echo "launch env: $(LAUNCH_ENV)"; \
67+
. "$(LAUNCH_ENV)"; \
68+
missing=0; \
69+
for v in $(LAUNCH_ENV_VARS); do \
70+
eval "val=\$${$$v:-}"; \
71+
if [ -n "$$val" ]; then \
72+
printf ' %-24s %s\n' "$$v" "$$val"; \
73+
else \
74+
printf ' %-24s MISSING\n' "$$v"; \
75+
missing=$$((missing + 1)); \
76+
fi; \
77+
done; \
78+
for v in $(LAUNCH_ENV_SECRETS); do \
79+
eval "val=\$${$$v:-}"; \
80+
if [ -n "$$val" ]; then \
81+
printf ' %-24s set\n' "$$v"; \
82+
else \
83+
printf ' %-24s MISSING\n' "$$v"; \
84+
missing=$$((missing + 1)); \
85+
fi; \
86+
done; \
87+
echo "($$missing missing — expected for values a later runbook step still has to produce)"
88+
4689
# Calldata
4790

4891
calldata-update-merkle-root: ## 💾 Calldata for the method `updateMerkleRoot` to use in a transaction
@@ -121,7 +164,7 @@ deploy-claimable-base-sepolia: ## 🚀 Deploy the airdrop contract in Base Sepol
121164
--verify \
122165
--etherscan-api-key $(ETHERSCAN_API_KEY)
123166

124-
deploy-claimable-mainnet: ## 🚀 Deploy the airdrop contract in Mainnet
167+
deploy-claimable-mainnet: launch-env ## 🚀 Deploy the airdrop contract in Mainnet
125168
cd script && \
126169
forge script DeployClaimableAirdrop.s.sol \
127170
--sig "run(string)" mainnet \
@@ -131,7 +174,7 @@ deploy-claimable-mainnet: ## 🚀 Deploy the airdrop contract in Mainnet
131174
--verify \
132175
--etherscan-api-key $(ETHERSCAN_API_KEY)
133176

134-
deploy-claimable-base-mainnet: ## 🚀 Deploy the airdrop contract in Base Mainnet
177+
deploy-claimable-base-mainnet: launch-env ## 🚀 Deploy the airdrop contract in Base Mainnet
135178
cd script && \
136179
forge script DeployClaimableAirdrop.s.sol \
137180
--sig "run(string)" base-mainnet \

0 commit comments

Comments
 (0)