Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(claim_contracts): update README #1620

Open
wants to merge 3 commits into
base: testnet
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion claim_contracts/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.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
.PHONY: help deps 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


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}'

deps: ## 📄 Install contract dependencies
forge install

# Deployments

RPC_URL?=http://localhost:8545
Expand Down
52 changes: 31 additions & 21 deletions claim_contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,41 @@

## Local deploying

To deploy the contracts, set the following environment variables:
Install the dependencies:

- `DEPLOYER_PRIVATE_KEY`: The private key of the account that's going to deploy the contracts.
- `SAFE_ADDRESS`: The address of the safe that's going to own the Proxy admin that in turn owns the token and airdrop contracts.
- `OWNER1_ADDRESS`, `OWNER2_ADDRESS`, and `OWNER3_ADDRESS`: The three owners of the token.
- `MINT_AMOUNT`: The amount to mint to each account (the contract actually supports minting different amounts of the token to each owner, but in the deploy script we simplified it).
- `RPC_URL`: The url of the network to deploy to.
- `CLAIM_TIME_LIMIT`: The claim time limit timestamp.
- `MERKLE_ROOT`: The merkle root of all valid token claims.

Example:
```
export DEPLOYER_PRIVATE_KEY=<deployer_private_key>
export SAFE_ADDRESS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
export OWNER1_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
export OWNER2_ADDRESS=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
export OWNER3_ADDRESS=0x90F79bf6EB2c4f870365E785982E1f101E93b906
export MINT_AMOUNT=100
export RPC_URL=http://localhost:8545
export CLAIM_TIME_LIMIT=2733247661
export MERKLE_ROOT=0x90076b5fb9a6c81d9fce83dfd51760987b8c49e7c861ea25b328e6e63d2cd3df
make deps
```

Then run the following script:
### Token

To deploy the token, modify the file `script-config/config.example.json` and set the following values:

- `safe`: The address of the safe that's going to own the Proxy admin that in turn owns the token and airdrop contracts.
- `salt`: The salt used to generate CREATE2 addresses.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should the salt be generated?

- `deployer`: The address of the account that's going to deploy the contracts.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify that deployer must be a CREATE2 deterministic deploy factory

- `foundation`: The address of the Aligned Foundation account.
- `claimSupplier`: The address of the account that's going to supply the tokens.
- `limitTimestampToClaim`: The claim time limit timestamp.
- `claimMerkleRoot`: The merkle root of all valid token claims.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The json file includes claimSupplierPrivateKey. Should we have it?


Also, set the following environment variables:

- `PRIVATE_KEY`: The private key of the account that's going to deploy the contracts. This MUST be the same account as the one in `deployer`.
- `RPC_URL`: The url of the network to deploy to.

Then run the script:

```
./deployClaim.sh
make deploy-token
```

> [!TIP]
> You can create another config file on `script-config/config.custom_name.json` and run the script with
> ```
> make deploy-token CONFIG=custom_name
> ```

### Airdrop

TBD