Skip to content

Commit

Permalink
introduce dropdowns for rules/limits & args + edits
Browse files Browse the repository at this point in the history
  • Loading branch information
salmad3 committed Sep 19, 2024
1 parent dee21c5 commit ff77b02
Show file tree
Hide file tree
Showing 2 changed files with 1,400 additions and 1,204 deletions.
59 changes: 37 additions & 22 deletions pages/dev-tutorials/tokenfactory-allow-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Callout } from 'nextra/components';

# Token Allowlists

The SEI Token Factory module enables token creators to restrict who can interact with their custom tokens through the
The Sei Token Factory module enables token creators to restrict who can interact with their custom tokens through the
use of allowlists.

This tutorial will walk you through:
Expand All @@ -22,10 +22,39 @@ To create a token on the devnet, ensure you have the following setup:

<Callout type='info'>You can obtain devnet tokens from one of the faucets listed [here](../dev-ecosystem-providers/faucets).</Callout>

## Creating a Denom with Allow List
<details>
<summary>Command Line Argument Overview</summary>

1. First, create a JSON file that contains the list of addresses you want to include in your allow list.
The format of the allow list is as follows:
When executing commands in this tutorial, you'll encounter several arguments. Here's a brief overview of what each means:

- `--allow-list $ALLOW_LIST_FILE_PATH`: This specifies the path to the allowlist file that we have created in the previous step. E.g. `allowlist.json`.
- `--chain-id arctic-1`: This specifies the network where the command will be executed. In this case, `arctic-1` is the identifier for the Sei devnet.
- `--node https://rpc.arctic-1.seinetwork.io/ `: This points to the RPC URL of the node you are interacting with.
- `--broadcast-mode block`: This determines how your transaction is broadcasted to the network. The `block` mode means the transaction will wait to be included in a block before returning a response. This is a safer option as it confirms your transaction is processed.
- `--fees 20000usei`: This is used to specify the transaction fee.

Understanding these arguments will help you execute the commands more confidently and customize them as needed for different scenarios.

<Callout type='info'>For detailed descriptions of these arguments, use `seid help` in the CLI.</Callout>

</details>

<details>
<summary>Validation Rules & Limits</summary>

- **Valid Addresses**: All addresses in the allowlist must be valid in their respective formats (SEI Bech32 or EVM 0x prefixed). Invalid addresses will result in a validation error.
- **Address Conversion**: EVM addresses (0x prefixed) are automatically converted to SEI Bech32 addresses when the allowlist is processed.
- **No Duplicates**: Duplicate addresses in the allowlist are not allowed and will result in a validation error.
- **Maximum Size**: By default, the maximum number of addresses allowed in the allowlist is 2,000. This limit can be configured by the chain administrator by setting `DenomAllowListMaxSize`.
- **Non-Empty List**: The allowlist cannot be empty when provided. If you wish to remove the allowlist, you need to pass an empty JSON object `{}`.
- **Additional Considerations**: Ensure to handle error cases and validation properly when interacting with the allowlist.

</details>

## Creating a Denom with Allowlist

1. First, create a JSON file that contains the list of addresses you want to include in your allowlist.
The format of the allowlist is as follows:

```json
{
Expand All @@ -37,10 +66,10 @@ The format of the allow list is as follows:
}
```

> Ensure that all addresses are valid SEI (Bech32) or EVM (0x-prefixed) addresses. Note that 0x addresses will be converted to Bech32 addresses when the allow list is persisted.
> The maximum number of addresses allowed in the allow list is 2000 by default. This can be configured by the chain administrator.
> Ensure that all addresses are valid SEI (Bech32) or EVM (0x-prefixed) addresses. Note that 0x addresses will be converted to Bech32 addresses when the allowlist is persisted.
> The maximum number of addresses allowed in the allowlist is 2000 by default. This can be configured by the chain administrator.

2. Create a new denom with the specified allow list.
2. Create a new denom with the specified allowlist.

```bash
seid tx tokenfactory create-denom $SUBDENOM \
Expand All @@ -64,23 +93,9 @@ The format of the allow list is as follows:
-y
```

### Understanding Command Line Arguments

When executing commands in this tutorial, you'll encounter several arguments. Here's a brief overview of what each means:

- `--allow-list $ALLOW_LIST_FILE_PATH`: This specifies the path to the allow list file that we have created in the previous step. E.g. `allowlist.json`.
- `--chain-id arctic-1`: This specifies the network where the command will be executed. In this case, `arctic-1` is the identifier for the Sei devnet.
- `--node https://rpc.arctic-1.seinetwork.io/ `: This points to the RPC URL of the node you are interacting with.
- `--broadcast-mode block`: This determines how your transaction is broadcasted to the network. The `block` mode means the transaction will wait to be included in a block before returning a response. This is a safer option as it confirms your transaction is processed.
- `--fees 20000usei`: This is used to specify the transaction fee.

Understanding these arguments will help you execute the commands more confidently and customize them as needed for different scenarios.

<Callout type='info'>For detailed descriptions of these arguments, use `seid help` in the CLI.</Callout>

## Updating an Existing Denom Allowlist

To update the allow list of a token, you can use the following command:
To update the allowlist of a token, you can use the following command:

```bash
seid tx tokenfactory update-denom $DENOM \
Expand Down
Loading

0 comments on commit ff77b02

Please sign in to comment.