Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions claim_contracts/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help \
.PHONY: help launch-env \
calldata-update-merkle-root calldata-update-limit-timestamp calldata-approve-spending calldata-unpause calldata-pause \
deploy-token deploy-token-sepolia deploy-token-mainnet \
deploy-claimable-local deploy-claimable-sepolia deploy-claimable-base-sepolia deploy-claimable-mainnet deploy-claimable-base-mainnet \
Expand Down Expand Up @@ -40,9 +40,52 @@ APPROVE_AMOUNT ?= 2600000000000000000000000000
AMOUNT_TO_CLAIM = $(shell curl -S -H "Content-Type: application/json" http://localhost:4000/api/proof/\$(CLAIMER) | jq -r .amount)
MERKLE_PROOF_TO_CLAIM = $(shell curl -S -H "Content-Type: application/json" http://localhost:4000/api/proof/\$(CLAIMER) | jq .proof | tr -d '"\n ')

# Mainnet launch environment — the file the launch runbook tells the operator to keep and source.
# The mainnet deploy targets depend on `launch-env`, so its values (and anything still MISSING) are
# printed right before the deploy prompts for the key, instead of relying on the operator having
# sourced the right file in the right shell.
LAUNCH_ENV ?= $(HOME)/align-launch.env
LAUNCH_ENV_VARS = ETH_RPC BASE_RPC ETH_TOKEN BASE_TOKEN CLAIM_ADMIN_SAFE ETH_DISTRIBUTOR_SAFE \
BASE_DISTRIBUTOR_SAFE ETH_TREASURY_SAFE DEPLOYER START_TIMESTAMP ETH_DEADLINE \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low: launch-env prints every var in LAUNCH_ENV_VARS in cleartext (line ~77 printf ' %-24s %s\n' "$$v" "$$val"), including DEPLOYER. Everywhere else in this Makefile the deployer secret is named DEPLOYER_PRIVATE_KEY (e.g. line 29), so DEPLOYER reads like it should be the address — but the name alone doesn't enforce that. If an operator populates the launch-env file by copy-pasting from a different convention and puts a private key under DEPLOYER, this target will echo it straight to the terminal/CI log right before a mainnet deploy. Consider renaming to DEPLOYER_ADDRESS (or adding a comment noting it must be an address, never a key) to remove the ambiguity.

BASE_DEADLINE SMOKE_TEST_ADDRESS ETH_AMOUNT BASE_AMOUNT ETH_CLAIM BASE_CLAIM \
ETH_ROOT BASE_ROOT
# Reported as set/MISSING only — never printed. The deploy targets read ETHERSCAN_API_KEY straight
# from the environment, so an unset one only surfaces as a forge argument error.
LAUNCH_ENV_SECRETS = ETHERSCAN_API_KEY

help: ## 📚 Show help for each of the Makefile recipes
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

launch-env: ## 🔎 Print the launch runbook variables from $(LAUNCH_ENV) (MISSING when unset)
@if [ ! -r "$(LAUNCH_ENV)" ]; then \
echo "launch env file not found: $(LAUNCH_ENV)"; \
echo "Create it from the 'Environment' section of the launch runbook,"; \
echo "or pass LAUNCH_ENV=/dev/null to run without it."; \
exit 1; \
fi; \
echo "launch env: $(LAUNCH_ENV)"; \
. "$(LAUNCH_ENV)"; \
missing=0; \
for v in $(LAUNCH_ENV_VARS); do \
eval "val=\$${$$v:-}"; \
if [ -n "$$val" ]; then \
printf ' %-24s %s\n' "$$v" "$$val"; \
else \
printf ' %-24s MISSING\n' "$$v"; \
missing=$$((missing + 1)); \
fi; \
done; \
for v in $(LAUNCH_ENV_SECRETS); do \
eval "val=\$${$$v:-}"; \
if [ -n "$$val" ]; then \
printf ' %-24s set\n' "$$v"; \
else \
printf ' %-24s MISSING\n' "$$v"; \
missing=$$((missing + 1)); \
fi; \
done; \
echo "($$missing missing — expected for values a later runbook step still has to produce)"

# Calldata

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

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

deploy-claimable-base-mainnet: ## 🚀 Deploy the airdrop contract in Base Mainnet
deploy-claimable-base-mainnet: launch-env ## 🚀 Deploy the airdrop contract in Base Mainnet
cd script && \
forge script DeployClaimableAirdrop.s.sol \
--sig "run(string)" base-mainnet \
Expand Down
Loading