|
1 | 1 | .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 |
2 | 2 |
|
3 | | -RPC_URL?=http://localhost:8545 |
4 | | -PRIVATE_KEY?=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 |
5 | | -VERSION?=1 |
6 | 3 |
|
7 | 4 | help: ## 📚 Show help for each of the Makefile recipes |
8 | 5 | @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
9 | 6 |
|
10 | 7 | # Deployments |
11 | 8 |
|
| 9 | +RPC_URL?=http://localhost:8545 |
| 10 | +PRIVATE_KEY?=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 |
| 11 | +VERSION?=1 |
| 12 | + |
12 | 13 | MINT?="1 ether" |
13 | 14 | OWNER?=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 |
14 | 15 | BENEFICIARY1?=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 |
15 | 16 | BENEFICIARY2?=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC |
16 | 17 | BENEFICIARY3?=0x90F79bf6EB2c4f870365E785982E1f101E93b906 |
17 | 18 |
|
| 19 | +CLAIM_TIME_LIMIT?=1632960000 |
| 20 | +MERKLE_ROOT?=0x90076b5fb9a6c81d9fce83dfd51760987b8c49e7c861ea25b328e6e63d2cd3df |
| 21 | +TOKEN_OWNER?=$(OWNER) |
| 22 | + |
18 | 23 | deploy-aligned-token-implementation: ## 🚀 Deploy the AlignedToken implementation contract |
19 | 24 | cd script/aligned_token && \ |
20 | 25 | forge script DeployAlignedTokenImplementation.s.sol \ |
@@ -45,8 +50,8 @@ deploy-claimable-airdrop-implementation: ## 🚀 Deploy the ClaimableAirdrop imp |
45 | 50 | deploy-claimable-airdrop-proxy: ## 🚀 Deploy the ClaimableAirdrop proxy contract |
46 | 51 | cd script/claimable_airdrop && \ |
47 | 52 | 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) \ |
50 | 55 | --rpc-url $(RPC_URL) \ |
51 | 56 | --private-key $(PRIVATE_KEY) \ |
52 | 57 | --broadcast |
@@ -98,11 +103,28 @@ aligned-token-proxy-create2: ## 🚀 Generate the create2 data for the AlignedTo |
98 | 103 | --sig "run(address,uint256, address,address,address,address,uint256,bytes32,address)" \ |
99 | 104 | $(IMPLEMENTATION) $(VERSION) $(OWNER) $(BENEFICIARY1) $(BENEFICIARY2) $(BENEFICIARY3) $(MINT) $(SALT) $(DEPLOYER |
100 | 105 |
|
| 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 | + |
101 | 117 | # Test targets |
102 | 118 |
|
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) |
106 | 127 |
|
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