Skip to content

Commit e5557d6

Browse files
author
ilitteri
committed
Update Makefile
1 parent 1c0625f commit e5557d6

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

claim_contracts/Makefile

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
.PHONY: help deploy-aligned-token-implementation deploy-aligned-token-proxy deploy-claimable-airdrop-implementation deploy-claimable-airdrop-proxy upgrade-aligned-token-implementation aligned-token-proxy-deploy-data aligned-token-init-data aligned-token-upgrade-data aligned-token-create2 aligned-token-proxy-create2
22

3-
RPC_URL?=http://localhost:8545
4-
PRIVATE_KEY?=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
5-
VERSION?=1
63

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

107
# Deployments
118

9+
RPC_URL?=http://localhost:8545
10+
PRIVATE_KEY?=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
11+
VERSION?=1
12+
1213
MINT?="1 ether"
1314
OWNER?=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
1415
BENEFICIARY1?=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
1516
BENEFICIARY2?=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
1617
BENEFICIARY3?=0x90F79bf6EB2c4f870365E785982E1f101E93b906
1718

19+
CLAIM_TIME_LIMIT?=1632960000
20+
MERKLE_ROOT?=0x90076b5fb9a6c81d9fce83dfd51760987b8c49e7c861ea25b328e6e63d2cd3df
21+
TOKEN_OWNER?=$(OWNER)
22+
1823
deploy-aligned-token-implementation: ## 🚀 Deploy the AlignedToken implementation contract
1924
cd script/aligned_token && \
2025
forge script DeployAlignedTokenImplementation.s.sol \
@@ -45,8 +50,8 @@ deploy-claimable-airdrop-implementation: ## 🚀 Deploy the ClaimableAirdrop imp
4550
deploy-claimable-airdrop-proxy: ## 🚀 Deploy the ClaimableAirdrop proxy contract
4651
cd script/claimable_airdrop && \
4752
forge script DeployClaimableAirdropProxy.s.sol \
48-
--sig "run(address,uint256,address,address,address,address)" \
49-
$(IMPLEMENTATION) $(VERSION) $(OWNER) $(BENEFICIARY1) $(BENEFICIARY2) $(BENEFICIARY3) $(MINT) \
53+
--sig "run(address,uint256,address,address,address,uint256,bytes32)" \
54+
$(IMPLEMENTATION) $(VERSION) $(OWNER) $(TOKEN) $(BENEFICIARY1) $(CLAIM_TIME_LIMIT) $(MERKLE_ROOT) \
5055
--rpc-url $(RPC_URL) \
5156
--private-key $(PRIVATE_KEY) \
5257
--broadcast
@@ -98,11 +103,28 @@ aligned-token-proxy-create2: ## 🚀 Generate the create2 data for the AlignedTo
98103
--sig "run(address,uint256, address,address,address,address,uint256,bytes32,address)" \
99104
$(IMPLEMENTATION) $(VERSION) $(OWNER) $(BENEFICIARY1) $(BENEFICIARY2) $(BENEFICIARY3) $(MINT) $(SALT) $(DEPLOYER
100105

106+
# Misc
107+
108+
approve:
109+
cd script && \
110+
forge script ApproveERC20.s.sol \
111+
--sig "run(address,address,uint256)" \
112+
$(TOKEN) $(AIRDROP) $(AMOUNT) \
113+
--rpc-url $(RPC_URL) \
114+
--private-key $(HOLDER_PRIVATE_KEY) \
115+
--broadcast
116+
101117
# Test targets
102118

103-
test-token: ## 🚀 Test the AlignedToken contract
104-
cast call $(ADDRESS) "name()(string)" --rpc-url http://localhost:8545
105-
cast call $(ADDRESS) "totalSupply()(uint256)" --rpc-url http://localhost:8545
119+
test-token:
120+
cast call $(ADDRESS) "name()(string)" --rpc-url $(RPC_URL)
121+
cast call $(ADDRESS) "totalSupply()(uint256)" --rpc-url $(RPC_URL)
122+
123+
AMOUNT_TO_CLAIM=$(shell curl -S -H "Content-Type: application/json" http://localhost:4000/api/proof/\$(CLAIMER) | jq -r .amount)
124+
MERKLE_PROOF_TO_CLAIM=$(shell curl -S -H "Content-Type: application/json" http://localhost:4000/api/proof/\$(CLAIMER) | jq .proof | tr -d '"\n ')
125+
test-claim:
126+
cast send $(AIRDROP) --private-key $(CLAIMER_PRIVATE_KEY) "claim(uint256,bytes32[])" $(AMOUNT_TO_CLAIM) "$(MERKLE_PROOF_TO_CLAIM)" --rpc-url $(RPC_URL)
106127

107-
test-airdrop: ## 🚀 Test the ClaimableAirdrop contract
108-
cast call $(ADDRESS) "hasClaimed(address)(bool)" --rpc-url http://localhost:8545
128+
test-claimed:
129+
cast call $(AIRDROP) "hasClaimed(address)(bool)" $(CLAIMER) --rpc-url $(RPC_URL)
130+
cast balance --erc20 $(TOKEN) $(CLAIMER) --rpc-url $(RPC_URL)

0 commit comments

Comments
 (0)