Skip to content

Commit

Permalink
Merge branch 'testnet' into example_claimable_upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jrchatruc authored Dec 23, 2024
2 parents b261f80 + 8b3e51d commit 2c01985
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
17 changes: 17 additions & 0 deletions claim_contracts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@
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}'

# Calldata

calldata-update-merkle-root: ## 💾 Calldata for the method `updateMerkleRoot` to use in a transaction
cast calldata "updateMerkleRoot(bytes32)" $(MERKLE_ROOT)

calldata-update-limit-timestamp: ## 💾 Calldata for the method `extendClaimPeriod` to use in a transaction
cast calldata "extendClaimPeriod(uint256)" $(LIMIT_TIMESTAMP)

calldata-approve-spending: ## 💾 Calldata for the method `approve` to use in a transaction
cast calldata "approve(address,uint256)" $(CLAIM_PROXY_ADDRESS) 2600000000000000000000000000

calldata-unpause: ## 💾 Calldata for the method `unpause` to use in a transaction
cast calldata "unpause()"

calldata-pause: ## 💾 Calldata for the method `pause` to use in a transaction
cast calldata "pause()"

# Deployments

RPC_URL?=http://localhost:8545
Expand Down
32 changes: 32 additions & 0 deletions claim_contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,38 @@

## Enabling Claimability

### By Calldata

> [!IMPORTANT]
>
> - 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()"`.
> - 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.
> - Steps 1, 2, and 4 can be batched into a single transaction in a multisig wallet. This multisig must be the `ClaimableAirdrop` contract owner.
> - Step 3 must be done by the token distributor multisig as it is the one that has the tokens to be claimed.
> [!WARNING]
> - Double-check the data you passing into the commands, any mistake can lead to undesired behavior.
1. Update the merkle root
```
// Example merkle_root = 0x97619aea42a289b94acc9fb98f5030576fa7449f1dd6701275815a6e99441927
cast calldata "updateMerkleRoot(bytes32)" <merkle_root>
```
2. Update the claim time limit
```
// Example timestamp = 2733427549
cast calldata "extendClaimPeriod(uint256)" <timestamp>
```
3. Approve the claimable proxy contract to spend the token from the distributor (_2.6B, taking into account the 18 decimals_)
```
// Example claim_proxy_address = 0x0234947ce63d1a5E731e5700b911FB32ec54C3c6
cast calldata "approve(address,uint256)" <claim_proxy_address> 2600000000000000000000000000
```
4. Unpause the claimable contract (it is paused by default)
```
cast calldata "unpause()"
```

### Local

1. Deploy the claimable contract as explained above.
Expand Down

0 comments on commit 2c01985

Please sign in to comment.