Skip to content

Commit 8b3e51d

Browse files
authored
Enable claimability through calldata (#1686)
1 parent 33be83f commit 8b3e51d

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

claim_contracts/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44
help: ## 📚 Show help for each of the Makefile recipes
55
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
66

7+
# Calldata
8+
9+
calldata-update-merkle-root: ## 💾 Calldata for the method `updateMerkleRoot` to use in a transaction
10+
cast calldata "updateMerkleRoot(bytes32)" $(MERKLE_ROOT)
11+
12+
calldata-update-limit-timestamp: ## 💾 Calldata for the method `extendClaimPeriod` to use in a transaction
13+
cast calldata "extendClaimPeriod(uint256)" $(LIMIT_TIMESTAMP)
14+
15+
calldata-approve-spending: ## 💾 Calldata for the method `approve` to use in a transaction
16+
cast calldata "approve(address,uint256)" $(CLAIM_PROXY_ADDRESS) 2600000000000000000000000000
17+
18+
calldata-unpause: ## 💾 Calldata for the method `unpause` to use in a transaction
19+
cast calldata "unpause()"
20+
21+
calldata-pause: ## 💾 Calldata for the method `pause` to use in a transaction
22+
cast calldata "pause()"
23+
724
# Deployments
825

926
RPC_URL?=http://localhost:8545

claim_contracts/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,38 @@
4646

4747
## Enabling Claimability
4848

49+
### By Calldata
50+
51+
> [!IMPORTANT]
52+
>
53+
> - This step-by-step **assumes** that the claimable proxy contract **is already deployed** and that **is already paused**. If it is not paused, the first transaction should be to pause it using this calldata `cast calldata "pause()"`.
54+
> - This method **only** generates the necessary calldata to call the methods through transactions. It does **not** actually call the methods. This method is useful for copy-pasting the calldata into a multisig wallet.
55+
> - Steps 1, 2, and 4 can be batched into a single transaction in a multisig wallet. This multisig must be the `ClaimableAirdrop` contract owner.
56+
> - Step 3 must be done by the token distributor multisig as it is the one that has the tokens to be claimed.
57+
58+
> [!WARNING]
59+
> - Double-check the data you passing into the commands, any mistake can lead to undesired behavior.
60+
61+
1. Update the merkle root
62+
```
63+
// Example merkle_root = 0x97619aea42a289b94acc9fb98f5030576fa7449f1dd6701275815a6e99441927
64+
cast calldata "updateMerkleRoot(bytes32)" <merkle_root>
65+
```
66+
2. Update the claim time limit
67+
```
68+
// Example timestamp = 2733427549
69+
cast calldata "extendClaimPeriod(uint256)" <timestamp>
70+
```
71+
3. Approve the claimable proxy contract to spend the token from the distributor (_2.6B, taking into account the 18 decimals_)
72+
```
73+
// Example claim_proxy_address = 0x0234947ce63d1a5E731e5700b911FB32ec54C3c6
74+
cast calldata "approve(address,uint256)" <claim_proxy_address> 2600000000000000000000000000
75+
```
76+
4. Unpause the claimable contract (it is paused by default)
77+
```
78+
cast calldata "unpause()"
79+
```
80+
4981
### Local
5082

5183
1. Deploy the claimable contract as explained above.

0 commit comments

Comments
 (0)