Skip to content

Commit

Permalink
tokenfactory details
Browse files Browse the repository at this point in the history
  • Loading branch information
mj850 committed May 27, 2024
1 parent f9ffae1 commit 28e3c1e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pages/dev-tutorials/pointer-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,6 @@ seid tx evm register-evm-pointer CW721 $CW721_TOKEN_ADDRESS --from=$SENDER --cha
- `--gas`: Specifies the maximum amount of gas that can be consumed by the transaction.
- `--fees`: Indicates the transaction fee.
- `--node`: Points to the specific Sei node RPC URL you're connecting to for transaction submission.

### For TokenFactory Tokens
Refer to the [Tokenfactory tutorial](./tokenfactory-tutorial.mdx) for details on how to create a tokenfactory denom and an associated pointer contract.
49 changes: 48 additions & 1 deletion pages/dev-tutorials/tokenfactory-tutorial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,51 @@ Understanding these arguments will help you execute the commands more confidentl
For detailed descriptions of these arguments, use `seid help` in the CLI.
</Callout>

## Updating Token Metadata

When creating a token, it is important to specify details regarding the denom amounts and aliases so your token can be correctly parsed on wallets and explorers.

### 1. Create Token Metadata file
Create a token metadata `json` file. The file below is an example metadata file for the Sei token.
```json
{
"name": "sei",
"description": "The native token of Sei.",
"denom_units": [
{
"denom": "usei,
"exponent": 0,
"aliases": [
"microsei"
],
},
{
"denom": "msei",
"exponent": 3,
"aliases": [
"millisei"
]
},
{
"denom": "sei",
"exponent": 6,
}
],
"base": "usei",
"display": "sei",
}
```

The `base` field denotes the smallest denom that this token can be represented in.
Note that if you intend to create a [pointer contract](#create-pointer-contract), the `denom_units` with the largest exponent will be used as the display denom. (`sei` in this case).

### 2. Set token metadata using seid
```sh
seid tx tokenfactory set-denom-metadata $METADATA_FILE --fees 20000usei -b block -y --from $ADDR
```

Replace `$METADATA_FILE` with the path to your metadata file created in step 1. and `$ADDR` with the address of the token admin.

## Minting Tokens

```bash copy
Expand Down Expand Up @@ -109,7 +154,7 @@ seid tx evm deploy-erc20 $DENOM $NAME $SYMBOL $DECIMAL --from=$ACCOUNT --evm-rpc
**Parameters**

- `DENOM`: The denomination of the token for which you want to create an ERC20 pointer. This should match the TokenFactory token you created.
- `DENOM`: The name you wish to assign to your ERC20 pointer token. It should match the name of the TokenFactory token.
- `NAME`: The name you wish to assign to your ERC20 pointer token. It should match the name of the TokenFactory token.
- `SYMBOL`: The symbol for your ERC20 pointer token. It should correspond with the symbol of the TokenFactory token.
- `DECIMAL`: The number of decimals for your ERC20 pointer token. This should align with the decimals of the TokenFactory token (typically 6).

Expand All @@ -120,6 +165,8 @@ seid tx evm deploy-erc20 $DENOM $NAME $SYMBOL $DECIMAL --from=$ACCOUNT --evm-rpc

Executing this command creates an ERC20 token and outputs the contract address. This token is linked to the TokenFactory token, meaning any activities involving this ERC20 token will also reflect on the state of the TokenFactory token and vice versa.

Note that if you wish to specify denoms on your ERC20 tokens, you will need to [set the token metadata](#updating-token-metadata) for the base tokenfactory token. The denom with the largest exponent will be used.

<Callout type="info">
Learn more about EVM interoperability and pointer contracts
[here](../interoperability/overview.mdx).
Expand Down

0 comments on commit 28e3c1e

Please sign in to comment.