|
| 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 | + |
| 3 | + |
| 4 | +help: ## 📚 Show help for each of the Makefile recipes |
| 5 | + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
| 6 | + |
| 7 | +# Deployments |
| 8 | + |
| 9 | +RPC_URL?=http://localhost:8545 |
| 10 | +PRIVATE_KEY?=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d |
| 11 | + |
| 12 | +deploy-all: ## 🚀 Deploy all contracts |
| 13 | + cd script && forge script DeployAll.s.sol --private-key $(PRIVATE_KEY) --rpc-url $(RPC_URL) --broadcast |
| 14 | + |
| 15 | +deploy-token: ## 🚀 Deploy the token contract |
| 16 | + cd script && \ |
| 17 | + forge script DeployAlignedToken.s.sol \ |
| 18 | + --private-key $(PRIVATE_KEY) \ |
| 19 | + --rpc-url $(RPC_URL) \ |
| 20 | + --broadcast |
| 21 | + |
| 22 | +MINT?="1 ether" |
| 23 | +OWNER?=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 |
| 24 | +BENEFICIARY1?=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 |
| 25 | +BENEFICIARY2?=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC |
| 26 | +BENEFICIARY3?=0x90F79bf6EB2c4f870365E785982E1f101E93b906 |
| 27 | + |
| 28 | +CLAIM_TIME_LIMIT?=1632960000 |
| 29 | +MERKLE_ROOT?=0x90076b5fb9a6c81d9fce83dfd51760987b8c49e7c861ea25b328e6e63d2cd3df |
| 30 | +TOKEN_OWNER?=$(OWNER) |
| 31 | + |
| 32 | +deploy-proxy-admin: ## 🚀 Deploy the ProxyAdmin contract |
| 33 | + cd script/proxy_admin && \ |
| 34 | + forge script DeployProxyAdmin.s.sol \ |
| 35 | + --sig "run(address)" \ |
| 36 | + $(OWNER) \ |
| 37 | + --rpc-url $(RPC_URL) \ |
| 38 | + --private-key $(PRIVATE_KEY) \ |
| 39 | + --broadcast |
| 40 | + |
| 41 | +deploy-aligned-token-implementation: ## 🚀 Deploy the AlignedToken implementation contract |
| 42 | + cd script/aligned_token && \ |
| 43 | + forge script DeployAlignedTokenImplementation.s.sol \ |
| 44 | + --rpc-url $(RPC_URL) \ |
| 45 | + --private-key $(PRIVATE_KEY) \ |
| 46 | + --broadcast |
| 47 | + |
| 48 | +deploy-aligned-token-proxy: ## 🚀 Deploy the AlignedToken proxy contract |
| 49 | + cd script/aligned_token && \ |
| 50 | + forge script DeployAlignedTokenProxy.s.sol \ |
| 51 | + --sig "run(address,address,address,address,address,address,uint256)" \ |
| 52 | + $(PROXY_ADMIN) $(IMPLEMENTATION) $(OWNER) $(BENEFICIARY1) $(BENEFICIARY2) $(BENEFICIARY3) $(MINT) \ |
| 53 | + --rpc-url $(RPC_URL) \ |
| 54 | + --private-key $(PRIVATE_KEY) \ |
| 55 | + --broadcast |
| 56 | + |
| 57 | +deploy-claimable-airdrop-implementation: ## 🚀 Deploy the ClaimableAirdrop implementation contract |
| 58 | + cd script/claimable_airdrop && \ |
| 59 | + forge script DeployClaimableAirdropImplementation.s.sol \ |
| 60 | + --rpc-url $(RPC_URL) \ |
| 61 | + --private-key $(PRIVATE_KEY) \ |
| 62 | + --broadcast |
| 63 | + |
| 64 | +deploy-claimable-airdrop-proxy: ## 🚀 Deploy the ClaimableAirdrop proxy contract |
| 65 | + cd script/claimable_airdrop && \ |
| 66 | + forge script DeployClaimableAirdropProxy.s.sol \ |
| 67 | + --sig "run(address,address,address,address,address,uint256,bytes32)" \ |
| 68 | + $(PROXY_ADMIN) $(IMPLEMENTATION) $(OWNER) $(TOKEN) $(BENEFICIARY1) $(CLAIM_TIME_LIMIT) $(MERKLE_ROOT) \ |
| 69 | + --rpc-url $(RPC_URL) \ |
| 70 | + --private-key $(PRIVATE_KEY) \ |
| 71 | + --broadcast |
| 72 | + |
| 73 | +# Upgrades |
| 74 | + |
| 75 | +upgrade-aligned-token-implementation: ## 🚀 Upgrade the AlignedToken implementation contract |
| 76 | + cd script/aligned_token && \ |
| 77 | + forge script UpgradeAlignedTokenImplementation.s.sol \ |
| 78 | + --sig "function run(address,address,uint256,address,address,address,address,uint256)" \ |
| 79 | + $(PROXY) $(IMPLEMENTATION) $(VERSION) $(OWNER) $(BENEFICIARY1) $(BENEFICIARY2) $(BENEFICIARY3) $(MINT)\ |
| 80 | + --rpc-url $(RPC_URL) \ |
| 81 | + --private-key $(PRIVATE_KEY) \ |
| 82 | + --broadcast |
| 83 | + |
| 84 | +# Deployment Data |
| 85 | + |
| 86 | +aligned-token-proxy-deploy-data: ## 🚀 Generate the deployment data for the AlignedToken proxy contract |
| 87 | + cd script/aligned_token && \ |
| 88 | + forge script AlignedTokenProxyDeploymentData.s.sol \ |
| 89 | + --sig "run(address,uint256, address,address,address,address,uint256)" \ |
| 90 | + $(IMPLEMENTATION) $(VERSION) $(OWNER) $(BENEFICIARY1) $(BENEFICIARY2) $(BENEFICIARY3) $(MINT) |
| 91 | + |
| 92 | +aligned-token-init-data: ## 🚀 Generate the init data for the AlignedToken proxy contract |
| 93 | + cd script/aligned_token && \ |
| 94 | + forge script AlignedTokenInitData.s.sol \ |
| 95 | + --sig "run(address,uint256, address,address,address,address,uint256)" \ |
| 96 | + $(IMPLEMENTATION) $(VERSION) $(OWNER) $(BENEFICIARY1) $(BENEFICIARY2) $(BENEFICIARY3) $(MINT) |
| 97 | + |
| 98 | +aligned-token-upgrade-data: ## 🚀 Generate the upgrade data for the AlignedToken proxy contract |
| 99 | + cd script/aligned_token && \ |
| 100 | + forge script AlignedTokenUpgradeData.s.sol \ |
| 101 | + --sig "run(address,uint256, address,address,address,address,uint256)" \ |
| 102 | + $(IMPLEMENTATION) $(VERSION) $(OWNER) $(BENEFICIARY1) $(BENEFICIARY2) $(BENEFICIARY3) $(MINT) |
| 103 | + |
| 104 | +SALT?=0x0000000000000000000000000000000000000000000000000000000000000000 |
| 105 | +# Sepolia Safe CreateCall contract. |
| 106 | +DEPLOYER?=0x9b35Af71d77eaf8d7e40252370304687390A1A52 |
| 107 | + |
| 108 | +aligned-token-create2: ## 🚀 Generate the create2 data for the AlignedToken proxy contract |
| 109 | + cd script/aligned_token && \ |
| 110 | + forge script AlignedTokenCreate2.s.sol \ |
| 111 | + --sig "run(uint256,bytes32,address)" \ |
| 112 | + $(VERSION) $(SALT) $(DEPLOYER) |
| 113 | + |
| 114 | +aligned-token-proxy-create2: ## 🚀 Generate the create2 data for the AlignedToken proxy contract |
| 115 | + cd script/aligned_token && \ |
| 116 | + forge script AlignedTokenCreate2.s.sol \ |
| 117 | + --sig "run(address,uint256, address,address,address,address,uint256,bytes32,address)" \ |
| 118 | + $(IMPLEMENTATION) $(VERSION) $(OWNER) $(BENEFICIARY1) $(BENEFICIARY2) $(BENEFICIARY3) $(MINT) $(SALT) $(DEPLOYER |
| 119 | + |
| 120 | +# Misc |
| 121 | + |
| 122 | +approve: |
| 123 | + cd script && \ |
| 124 | + forge script ApproveERC20.s.sol \ |
| 125 | + --sig "run(address,address,uint256)" \ |
| 126 | + $(TOKEN) $(AIRDROP) $(AMOUNT) \ |
| 127 | + --rpc-url $(RPC_URL) \ |
| 128 | + --private-key $(HOLDER_PRIVATE_KEY) \ |
| 129 | + --broadcast |
| 130 | + |
| 131 | +# Test targets |
| 132 | + |
| 133 | +test-token: |
| 134 | + cast call $(ADDRESS) "name()(string)" --rpc-url $(RPC_URL) |
| 135 | + cast call $(ADDRESS) "totalSupply()(uint256)" --rpc-url $(RPC_URL) |
| 136 | + |
| 137 | +# The following target needs the proof API running on localhost:4000 |
| 138 | +AMOUNT_TO_CLAIM=$(shell curl -S -H "Content-Type: application/json" http://localhost:4000/api/proof/\$(CLAIMER) | jq -r .amount) |
| 139 | +MERKLE_PROOF_TO_CLAIM=$(shell curl -S -H "Content-Type: application/json" http://localhost:4000/api/proof/\$(CLAIMER) | jq .proof | tr -d '"\n ') |
| 140 | +test-claim: |
| 141 | + cast send $(AIRDROP) --private-key $(CLAIMER_PRIVATE_KEY) "claim(uint256,bytes32[])" $(AMOUNT_TO_CLAIM) "$(MERKLE_PROOF_TO_CLAIM)" --rpc-url $(RPC_URL) |
| 142 | + |
| 143 | +test-claimed: |
| 144 | + cast call $(AIRDROP) "hasClaimed(address)(bool)" $(CLAIMER) --rpc-url $(RPC_URL) |
| 145 | + cast balance --erc20 $(TOKEN) $(CLAIMER) --rpc-url $(RPC_URL) |
| 146 | + |
| 147 | +OWNER_PRIVATE_KEY?=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 |
| 148 | + |
| 149 | +test-pause: |
| 150 | + cast send $(AIRDROP) --private-key $(OWNER_PRIVATE_KEY) "pause()" --rpc-url $(RPC_URL) |
| 151 | + |
| 152 | +test-unpause: |
| 153 | + cast send $(AIRDROP) --private-key $(OWNER_PRIVATE_KEY) "unpause()" --rpc-url $(RPC_URL) |
0 commit comments