From 421bdb43fc5191a6779b6d3e4510c95f1c64196f Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 8 Jan 2025 14:34:38 -0300 Subject: [PATCH 1/5] Simplify local deployment --- claim_contracts/README.md | 42 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/claim_contracts/README.md b/claim_contracts/README.md index 65c2ba6a13..115af36710 100644 --- a/claim_contracts/README.md +++ b/claim_contracts/README.md @@ -1,27 +1,26 @@ -# +# Aligned Token Claim Contracts -## Local +## How to run locally -### Requisites - -- Foundry - -### Run +> [!IMPORTANT] +> Foundry must be installed and running. + +1. Run `anvil` in one terminal. +2. Get your local **foundation** and **token distributor** wallet addresses and write them down in the `claim_contracts/script-config/config.example.json` file. +3. Run `make deploy-token-local DEPLOYER_PRIVATE_KEY=` in another terminal. +4. Write down the forge script's output (the addresses of the token proxy and its admin preferably). +5. From the output of the previous step, complete the `claim_contracts/script-config/config.example.json` file with the token proxy address. +6. Run `make deploy-claimable DEPLOYER_PRIVATE_KEY=`. +7. Write down the forge script's output (the addresses of the claimable proxy and its admin preferably). +8. From the output of the previous step, complete the `claim_contracts/script-config/config.example.json` file with the claimable proxy address. +9. Run `make claimable-update-root RPC_URL=http://localhost:8545 OWNER_PRIVATE_KEY= AIRDROP= MERKLE_ROOT=`. +10. Run `make claimable-update-timestamp RPC_URL=http://localhost:8545 OWNER_PRIVATE_KEY= AIRDROP= TIMESTAMP=2733427549`. +11. Run `make approve-claimable RPC_URL=http://localhost:8545 DISTRIBUTOR_PRIVATE_KEY= TOKEN= AIRDROP=`. +12. Run `make claimable-unpause RPC_URL=http://localhost:8545 OWNER_PRIVATE_KEY= AIRDROP=`. -1. Run anvil in one terminal: - ``` - anvil - ``` -2. Deploy the token - ``` - make deploy-token - ``` -3. Write down the token proxy address that is printed in the console output. Do this in the `config.example.json` file, under the `tokenProxy` key. -4. Deploy the claimable contract - ``` - make deploy-claimable-local - ``` -5. Write down the claimable contract proxy address that is printed in the console output. +> [!NOTE] +> You can do the previous steps in one run with `make deploy-example MERKLE_ROOT= TIMESTAMP=2733427549`. +> Remember to write down the addresses of the proxies and their admins. ## Testnet (Sepolia) @@ -56,6 +55,7 @@ > - 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 From edcfa915266cc79bd6a2eea2c60c01c3b496b50f Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 8 Jan 2025 14:34:42 -0300 Subject: [PATCH 2/5] Update Makefile --- claim_contracts/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/claim_contracts/Makefile b/claim_contracts/Makefile index d1f5ab3517..8f0233b526 100644 --- a/claim_contracts/Makefile +++ b/claim_contracts/Makefile @@ -23,16 +23,19 @@ calldata-pause: ## 💾 Calldata for the method `pause` to use in a transaction # Deployments +# Requires MERKLE_ROOT, TIMESTAMP +# CONFIG, RPC_URL, DEPLOYER_PRIVATE_KEY are optional +deploy-example: deploy-token-local deploy-claimable-local claimable-update-root claimable-update-timestamp approve-claimable claimable-unpause + RPC_URL?=http://localhost:8545 DEPLOYER_PRIVATE_KEY?=0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a CONFIG?=example -deploy-token: ## 🚀 Deploy the token contract +deploy-token-local: ## 🚀 Deploy the token contract cd script && \ forge script DeployAlignedToken.s.sol \ - --sig "run(string)" \ - $(CONFIG) \ + --sig "run(string)" example \ --private-key $(DEPLOYER_PRIVATE_KEY) \ - --rpc-url $(RPC_URL) \ + --rpc-url http://localhost:8545 \ --broadcast \ --verbosity 3 @@ -186,6 +189,3 @@ OWNER_PRIVATE_KEY?=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f test-airdrop: cast call $(AIRDROP) "paused()(bool)" --rpc-url $(RPC_URL) cast call $(AIRDROP) "owner()(address)" --rpc-url $(RPC_URL) - -# Requires MERKLE_ROOT, TIMESTAMP -deploy-example: deploy-token deploy-claimable-local claimable-update-root claimable-update-timestamp approve-claimable claimable-unpause From d4a50d0abd4f500d268d54200186b4481ac9bcfb Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 8 Jan 2025 14:42:40 -0300 Subject: [PATCH 3/5] Add Sepolia deployment step-by-step --- claim_contracts/README.md | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/claim_contracts/README.md b/claim_contracts/README.md index 115af36710..c5816b01b4 100644 --- a/claim_contracts/README.md +++ b/claim_contracts/README.md @@ -22,26 +22,23 @@ > You can do the previous steps in one run with `make deploy-example MERKLE_ROOT= TIMESTAMP=2733427549`. > Remember to write down the addresses of the proxies and their admins. -## Testnet (Sepolia) +## How to run in Sepolia testnet -### Requisites - -- Foundry -- Etherscan API key - -### Run - -1. Create a file `script-config/config.sepolia.json` following the example in `script-config/config.sepolia.example.json`. -2. Deploy the token - ``` - make deploy-token-testnet RPC_URL= PRIVATE_KEY= - ``` -3. Write down the `token-proxy-address` that is printed in the console output. Do this in the `config.sepolia.json` file, under the `tokenProxy` key. -4. Deploy the claimable contract - ``` - make deploy-claimable-testnet RPC_URL= DEPLOYER_PRIVATE_KEY= ETHERSCAN_API_KEY= - ``` -5. Write down the `claimable-proxy-address` that is printed in the console output. +> [!IMPORTANT] +> Foundry must be installed and running. +> You must have an Etherscan API key. + +1. Get your **foundation** and **token distributor** wallet addresses and write them down in the `claim_contracts/script-config/config.sepolia.json` file (as it is done in the `claim_contracts/script-config/config.example.json` file). +2. Run `make deploy-token-testnet DEPLOYER_PRIVATE_KEY= RPC_URL= ETHERSCAN_API_KEY=`. +3. Write down the forge script's output (the addresses of the token proxy and its admin preferably). +4. From the output of the previous step, complete the `claim_contracts/script-config/config.sepolia.json` file with the token proxy address. +5. Run `make deploy-claimable-testnet DEPLOYER_PRIVATE_KEY= RPC_URL= ETHERSCAN_API_KEY=`. +6. Write down the forge script's output (the addresses of the claimable proxy and its admin preferably). +7. From the output of the previous step, complete the `claim_contracts/script-config/config.sepolia.json` file with the claimable proxy address. +8. Run `make claimable-update-root RPC_URL= OWNER_PRIVATE_KEY= AIRDROP= MERKLE_ROOT=`. +9. Run `make claimable-update-timestamp RPC_URL= OWNER_PRIVATE_KEY= AIRDROP= TIMESTAMP=2733427549`. +10. Run `make approve-claimable RPC_URL= DISTRIBUTOR_PRIVATE_KEY= TOKEN= AIRDROP=`. +11. Run `make claimable-unpause RPC_URL= OWNER_PRIVATE_KEY= AIRDROP=`. ## Enabling Claimability From 9302a59acbac5adacff7e10ca0299dfb6a0921e7 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 8 Jan 2025 14:43:01 -0300 Subject: [PATCH 4/5] Remove extra change --- claim_contracts/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/claim_contracts/README.md b/claim_contracts/README.md index c5816b01b4..be94234e95 100644 --- a/claim_contracts/README.md +++ b/claim_contracts/README.md @@ -52,7 +52,6 @@ > - 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 From d4742297387042d393ac73eaa218ddd35ddfc601 Mon Sep 17 00:00:00 2001 From: ilitteri Date: Wed, 8 Jan 2025 18:28:04 -0300 Subject: [PATCH 5/5] Specify which config fields should be modified on each step --- claim_contracts/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/claim_contracts/README.md b/claim_contracts/README.md index be94234e95..9798ccb89c 100644 --- a/claim_contracts/README.md +++ b/claim_contracts/README.md @@ -6,13 +6,13 @@ > Foundry must be installed and running. 1. Run `anvil` in one terminal. -2. Get your local **foundation** and **token distributor** wallet addresses and write them down in the `claim_contracts/script-config/config.example.json` file. +2. Get your local **foundation** and **token distributor** wallet addresses and write them down in the `claim_contracts/script-config/config.example.json` file. **Only the `foundation` and `tokenDistributor` fields should be modified in this step**. 3. Run `make deploy-token-local DEPLOYER_PRIVATE_KEY=` in another terminal. 4. Write down the forge script's output (the addresses of the token proxy and its admin preferably). -5. From the output of the previous step, complete the `claim_contracts/script-config/config.example.json` file with the token proxy address. +5. From the output of the previous step, complete the `claim_contracts/script-config/config.example.json` file with the token proxy address. **Only the `tokenProxy` field should be modified in this step**. 6. Run `make deploy-claimable DEPLOYER_PRIVATE_KEY=`. 7. Write down the forge script's output (the addresses of the claimable proxy and its admin preferably). -8. From the output of the previous step, complete the `claim_contracts/script-config/config.example.json` file with the claimable proxy address. +8. From the output of the previous step, complete the `claim_contracts/script-config/config.example.json` file with the claimable proxy address. **Only the `claimableProxy` field should be modified in this step**. 9. Run `make claimable-update-root RPC_URL=http://localhost:8545 OWNER_PRIVATE_KEY= AIRDROP= MERKLE_ROOT=`. 10. Run `make claimable-update-timestamp RPC_URL=http://localhost:8545 OWNER_PRIVATE_KEY= AIRDROP= TIMESTAMP=2733427549`. 11. Run `make approve-claimable RPC_URL=http://localhost:8545 DISTRIBUTOR_PRIVATE_KEY= TOKEN= AIRDROP=`. @@ -28,13 +28,13 @@ > Foundry must be installed and running. > You must have an Etherscan API key. -1. Get your **foundation** and **token distributor** wallet addresses and write them down in the `claim_contracts/script-config/config.sepolia.json` file (as it is done in the `claim_contracts/script-config/config.example.json` file). +1. Get your **foundation** and **token distributor** wallet addresses and write them down in the `claim_contracts/script-config/config.sepolia.json` file (as it is done in the `claim_contracts/script-config/config.example.json` file). **Only the `foundation` and `tokenDistributor` fields should be modified in this step**. 2. Run `make deploy-token-testnet DEPLOYER_PRIVATE_KEY= RPC_URL= ETHERSCAN_API_KEY=`. 3. Write down the forge script's output (the addresses of the token proxy and its admin preferably). -4. From the output of the previous step, complete the `claim_contracts/script-config/config.sepolia.json` file with the token proxy address. +4. From the output of the previous step, complete the `claim_contracts/script-config/config.sepolia.json` file with the token proxy address. **Only the `tokenProxy` field should be modified in this step**. 5. Run `make deploy-claimable-testnet DEPLOYER_PRIVATE_KEY= RPC_URL= ETHERSCAN_API_KEY=`. 6. Write down the forge script's output (the addresses of the claimable proxy and its admin preferably). -7. From the output of the previous step, complete the `claim_contracts/script-config/config.sepolia.json` file with the claimable proxy address. +7. From the output of the previous step, complete the `claim_contracts/script-config/config.sepolia.json` file with the claimable proxy address. **Only the `claimableProxy` field should be modified in this step**. 8. Run `make claimable-update-root RPC_URL= OWNER_PRIVATE_KEY= AIRDROP= MERKLE_ROOT=`. 9. Run `make claimable-update-timestamp RPC_URL= OWNER_PRIVATE_KEY= AIRDROP= TIMESTAMP=2733427549`. 10. Run `make approve-claimable RPC_URL= DISTRIBUTOR_PRIVATE_KEY= TOKEN= AIRDROP=`. @@ -52,6 +52,7 @@ > - 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