Skip to content
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
All notable changes to this project will be documented in this file.

## 1.7.0

### Added

- [DeFi Wrapper] use case distributor now has `claim` command and `distribute` command now supports modes for `snapshot` generation

### Fixed

- IPFS utils now support CIDv1

## 1.6.0

### Fixed
Expand Down
File renamed without changes.
52 changes: 26 additions & 26 deletions docs/cli/commands/contracts/lazy-oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ yarn start contracts lazy-oracle -h

### Read

| Command | Description |
| ------------------------------------ | ----------------------------------------------------------------------------------- |
| info | get lazy oracle base info |
| DEFAULT_ADMIN_ROLE | Calls the read-only function "DEFAULT_ADMIN_ROLE" on the contract. |
| LIDO_LOCATOR | Calls the read-only function "LIDO_LOCATOR" on the contract. |
| MAX_LIDO_FEE_RATE_PER_SECOND | Calls the read-only function "MAX_LIDO_FEE_RATE_PER_SECOND" on the contract. |
| MAX_QUARANTINE_PERIOD | Calls the read-only function "MAX_QUARANTINE_PERIOD" on the contract. |
| MAX_REWARD_RATIO | Calls the read-only function "MAX_REWARD_RATIO" on the contract. |
| UPDATE_SANITY_PARAMS_ROLE | Calls the read-only function "UPDATE_SANITY_PARAMS_ROLE" on the contract. |
| batch-validator-statuses \<pubkeys> | get batch to mass check the validator statuses in PredepositGuarantee contract |
| batch-vaults-info \<offset> \<limit> | get batch vaults info |
| getRoleAdmin \<role> | Calls the read-only function "getRoleAdmin" on the contract. |
| getRoleMember \<role> \<index> | Calls the read-only function "getRoleMember" on the contract. |
| getRoleMemberCount \<role> | Calls the read-only function "getRoleMemberCount" on the contract. |
| getRoleMembers \<role> | Calls the read-only function "getRoleMembers" on the contract. |
| hasRole \<role> \<account> | Calls the read-only function "hasRole" on the contract. |
| latest-report-data (lrd) | get latest report data |
| latest-report-timestamp (lrt) | get latest report timestamp |
| max-lido-fee-rate-per-second (max-lfs) | get the max Lido fee rate per second, in ether |
| max-reward-ratio-bp (mrr) | get max reward ratio |
| quarantine-period (qp) | get quarantine period |
| quarantine-value (qv) \<vault> | get the amount of total value that is pending in the quarantine for the given vault |
| supportsInterface \<interfaceId> | Calls the read-only function "supportsInterface" on the contract. |
| vault-info (vi) \<vault> | get the vault data info |
| vault-quarantine (vq) \<vault> | get vault quarantine |
| vaults-count (vc) | get vaults count |
| Command | Description |
| -------------------------------------- | ----------------------------------------------------------------------------------- |
| info | get lazy oracle base info |
| DEFAULT_ADMIN_ROLE | Calls the read-only function "DEFAULT_ADMIN_ROLE" on the contract. |
| LIDO_LOCATOR | Calls the read-only function "LIDO_LOCATOR" on the contract. |
| MAX_LIDO_FEE_RATE_PER_SECOND | Calls the read-only function "MAX_LIDO_FEE_RATE_PER_SECOND" on the contract. |
| MAX_QUARANTINE_PERIOD | Calls the read-only function "MAX_QUARANTINE_PERIOD" on the contract. |
| MAX_REWARD_RATIO | Calls the read-only function "MAX_REWARD_RATIO" on the contract. |
| UPDATE_SANITY_PARAMS_ROLE | Calls the read-only function "UPDATE_SANITY_PARAMS_ROLE" on the contract. |
| batch-validator-statuses \<pubkeys> | get batch to mass check the validator statuses in PredepositGuarantee contract |
| batch-vaults-info \<offset> \<limit> | get batch vaults info |
| getRoleAdmin \<role> | Calls the read-only function "getRoleAdmin" on the contract. |
| getRoleMember \<role> \<index> | Calls the read-only function "getRoleMember" on the contract. |
| getRoleMemberCount \<role> | Calls the read-only function "getRoleMemberCount" on the contract. |
| getRoleMembers \<role> | Calls the read-only function "getRoleMembers" on the contract. |
| hasRole \<role> \<account> | Calls the read-only function "hasRole" on the contract. |
| latest-report-data (lrd) | get latest report data |
| latest-report-timestamp (lrt) | get latest report timestamp |
| max-lido-fee-rate-per-second (max-lfs) | get the max Lido fee rate per second, in ether |
| max-reward-ratio-bp (mrr) | get max reward ratio |
| quarantine-period (qp) | get quarantine period |
| quarantine-value (qv) \<vault> | get the amount of total value that is pending in the quarantine for the given vault |
| supportsInterface \<interfaceId> | Calls the read-only function "supportsInterface" on the contract. |
| vault-info (vi) \<vault> | get the vault data info |
| vault-quarantine (vq) \<vault> | get vault quarantine |
| vaults-count (vc) | get vaults count |
36 changes: 18 additions & 18 deletions docs/cli/commands/contracts/vault-viewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ yarn start contracts v-v -h

### Read

| Command | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| DEFAULT_ADMIN_ROLE | Calls the read-only function "DEFAULT_ADMIN_ROLE" on the contract. |
| LAZY_ORACLE | Calls the read-only function "LAZY_ORACLE" on the contract. |
| LIDO_LOCATOR | Calls the read-only function "LIDO_LOCATOR" on the contract. |
| VAULT_HUB | Calls the read-only function "VAULT_HUB" on the contract. |
| has-role \<vault> \<role> \<member> | check if an address has a role in a vault |
| isContract \<account> | Calls the read-only function "isContract" on the contract. |
| is-vault-owner \<vault address> \<owner> | checks if a given address is the owner of a connection vault |
| role-members \<vault> \<roles> | get the VaultMembers for each specified role on a single vault |
| role-members-batch \<vault addresses> \<roles> | get VaultMembers for each role on multiple vaults |
| vault-data \<vault> | get aggregated data for a single vault |
| by-owner-batch \<owner> \<offset> \<limit> | get vaults owned by `_owner` using batch pagination over the global vault list |
| Command | Description |
| ------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| DEFAULT_ADMIN_ROLE | Calls the read-only function "DEFAULT_ADMIN_ROLE" on the contract. |
| LAZY_ORACLE | Calls the read-only function "LAZY_ORACLE" on the contract. |
| LIDO_LOCATOR | Calls the read-only function "LIDO_LOCATOR" on the contract. |
| VAULT_HUB | Calls the read-only function "VAULT_HUB" on the contract. |
| has-role \<vault> \<role> \<member> | check if an address has a role in a vault |
| isContract \<account> | Calls the read-only function "isContract" on the contract. |
| is-vault-owner \<vault address> \<owner> | checks if a given address is the owner of a connection vault |
| role-members \<vault> \<roles> | get the VaultMembers for each specified role on a single vault |
| role-members-batch \<vault addresses> \<roles> | get VaultMembers for each role on multiple vaults |
| vault-data \<vault> | get aggregated data for a single vault |
| by-owner-batch \<owner> \<offset> \<limit> | get vaults owned by `_owner` using batch pagination over the global vault list |
| by-role-address-batch (by-ra) \<role> \<member> \<offset> \<limit> | get vaults where `_member` has `_role`, scanning a batch of the global vault list |
| vaults-count | get the number of vaults connected to the VaultHub |
| vaults-data-batch \<offset> \<limit> | get aggregated data for a batch of vaults |
| my | get all my vaults |
| my-by-role \<role> | get all vaults where I have a role |
| all | get all vaults connected to vault hub |
| vaults-count | get the number of vaults connected to the VaultHub |
| vaults-data-batch \<offset> \<limit> | get aggregated data for a batch of vaults |
| my | get all my vaults |
| my-by-role \<role> | get all vaults where I have a role |
| all | get all vaults connected to vault hub |
48 changes: 36 additions & 12 deletions docs/cli/commands/defi-wrapper/distributor.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The Distributor commands are used to manage the distribution of side tokens via
| add-token | add a new token to distribute |
| set-merkle-root | updates merkle root and CID on the distributor contract |
| distribute | generates and optionally uploads new distribution data |
| claim | permissionlessly claim rewards to recipients |

## Command Details

Expand Down Expand Up @@ -125,18 +126,20 @@ Generates a new rewards distribution based on pool shares, and provides options

**Options:**

| Option | Description | Default |
| ---------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------- |
| `--blacklist [addresses...]` | A list of addresses to exclude from the distribution. | `[]` |
| `--from-block [block]` | The starting block for calculating pool share balances. | `undefined` |
| `--to-block [block]` | The ending block for calculating pool share balances. | `undefined` |
| `--max-batch-size [size]` | The maximum number of blocks to fetch events for in a single batch. | `50000` |
| `--output-path [path]` | The local file path to save the generated distribution data. | `./distribution-[merkle-root].json` |
| `--skip-write` | If set, the distribution data will not be written to a local file. | `false` |
| `--skip-transfer` | If set, the command will not attempt to transfer the reward tokens to the distributor contract. | `false` |
| `--ipfs-gateway [gateway]` | A custom IPFS gateway to fetch previous distribution data from. | `undefined` |
| `--upload [pinningUrl]` | A URL for a pinning service to upload the distribution data to. | `false` |
| `--skip-set-root` | If set, the new Merkle root will not be set on the distributor contract. | `false` |
| Option | Description | Default |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------- |
| `--blacklist [addresses...]` | A list of addresses to exclude from the distribution. | `[]` |
| `--mode [mode]` | distribution calculation mode, `integral` or `snapshot`. `integral` mode calculates based on historical holding share while `snapshot` calculates by balances on toBlock | `integral` |
| `--from-block [block]` | The starting block for calculating pool share balances. | `undefined` |
| `--to-block [block]` | The ending block for calculating pool share balances. | `undefined` |
| `--max-batch-size [size]` | The maximum number of blocks to fetch events for in a single batch. | `50000` |
| `--output-path [path]` | The local file path to save the generated distribution data. | `./distribution-[merkle-root].json` |
| `--skip-write` | If set, the distribution data will not be written to a local file. | `false` |
| `--skip-transfer` | If set, the command will not attempt to transfer the reward tokens to the distributor contract. | `false` |
| `--ipfs-gateway [gateway]` | A custom IPFS gateway to fetch previous distribution data from. | `undefined` |
| `--upload [pinningUrl]` | (unstable) uploading distribution data to provided pinning service URL | `undefined` |
| `--upload-authorization [token]` | Authorization token for uploading distribution data to pinning service, used as `Authorization: Bearer <token>` | `undefined` |
| `--skip-set-root` | If set, the new Merkle root will not be set on the distributor contract. | `false` |

**Example:**

Expand All @@ -146,3 +149,24 @@ yarn start dw uc d w distribute 0x... 0xtoken1... 1000 0xtoken2... 500.5 --uploa
```

**Use Case:** To perform a complete rewards distribution run. This command can calculate rewards, generate the necessary data, upload it to IPFS, and update the smart contract all in one go, making it a powerful tool for automating rewards distribution.

### claim

Allows to permissionlessly claim distributed tokens to set or all recipients.

**Arguments:**

- `<pool address>`: The contract address of the pool.
- `--recipients [addresses...]`: (optional) The addresses(space separated) of the recipients to claim the distributed tokens for, if not provided, all recipients will be claimed.
- `--tokens [addresses]`: (optional) The addresses(space separated) of the tokens to claim, if not provided, all tokens in the distribution will be claimed.
- `--ipfs-gateway [gateway]`: (optional) A custom IPFS gateway to fetch distribution data from, if not provided, the default gateway will be used.
- `--print-only`: (optional) If set, the claim data will be printed to the console without sending any transactions.

**Example:**

```bash
# distribute rewards to specific recipients for specific tokens
yarn start dw uc d w claim 0x<poolAddress> --recipients 0x<recipientAddress1> 0x<recipientAddress2> --tokens 0x<tokenAddress1> 0x<tokenAddress2>
```

**Use Case:** Manually claim personal rewards or force claim for all recipients
Loading
Loading