Skip to content

Commit

Permalink
temp: keep token standards in original form
Browse files Browse the repository at this point in the history
  • Loading branch information
seyian-writer committed Jan 9, 2025
1 parent 2be1cc0 commit 2385a29
Showing 1 changed file with 77 additions and 172 deletions.
249 changes: 77 additions & 172 deletions pages/build/dev-token-standards.mdx
Original file line number Diff line number Diff line change
@@ -1,175 +1,80 @@
import { TokenCard } from '../../components/TokenCard';
import { Box, Divider } from '@mantine/core';
import {Tabs, Blockquote, Title} from '@mantine/core';

# Token Standards

This section outlines the token standards supported on Sei and their specific functions within the blockchain ecosystem.

<br/>

<Box mb="md">
<TokenCard
title="Sei Token"
tooltip="The native token for transactions and governance on Sei."
details={[
{ label: 'EVM Conversion', content: 'Convert Sei to wei by entering an amount.' },
{ label: 'Cosmos Conversion', content: 'Convert Sei to Cosmos units by entering an amount.' },
]}
/>
</Box>

<Divider variant="dashed" color="#9E1F19" />

<Box mt="md" mb="md">
<TokenCard
title="Fungible Tokens"
tooltip="Interchangeable digital assets using ERC20 and CW20 standards."
details={[
{ label: 'TokenFactory', content: 'Integrated with Cosmos modules for efficient queries and performance.' },
{
title: "Token Factory Guide",
sections: [
{
content: "Create tokens with unique identifiers linked to your account using the `tokenfactory` module. Token creators get **admin** rights for minting, burning, and transferring."
},
{
content: "Requirements:\n- `seid` CLI\n- Wallet with SEI tokens on devnet"
},
{
content: "1. Create a denom in the format `factory/{ACCOUNT}/{DENOM}`.",
command: "seid tx tokenfactory create-denom $DENOM --from=$ACCOUNT --chain-id=arctic-1 --node=https://rpc.arctic-1.seinetwork.io/ --broadcast-mode=block --fees=20000usei"
},
{
content: "2. Set token metadata with a JSON file:",
command: "seid tx tokenfactory set-denom-metadata $METADATA_FILE --fees 20000usei -b block -y --from $ADDR"
},
{
content: "3. Mint tokens. Specify `$AMOUNT` and use the generated token denom:",
command: "seid tx tokenfactory mint $AMOUNT --from=$ACCOUNT --chain-id=arctic-1 --node=https://rpc.arctic-1.seinetwork.io/ --broadcast-mode=block --fees=20000usei"
},
{
content: "4. Burn tokens to reduce supply. Replace `$AMOUNT` accordingly:",
command: "seid tx tokenfactory burn $AMOUNT --from=$ACCOUNT --chain-id=arctic-1 --node=https://rpc.arctic-1.seinetwork.io/ --broadcast-mode=block --fees=20000usei"
},
{
content: "5. Create an EVM pointer contract for compatibility. Converts your token to ERC20 for EVM use:",
command: "seid tx evm register-evm-pointer NATIVE factory/${ACCOUNT}/${DENOM} --from=$ACCOUNT --fees 20000usei --evm-rpc=https://evm-rpc.arctic-1.seinetwork.io/"
},
{
content: "You have sucessfully completed the Token Factory tutorial. For more advanced usage, see the [Token Factory documentation](https://github.com/sei-protocol/sei-chain/tree/main/x/tokenfactory)."
}
]
},
{ label: 'ERC20 Standard', content: 'Defines interchangeable tokens for EVM-based dApps.' },
{ label: 'CW20 Standard', content: 'Cosmos equivalent of ERC20 for compatibility with Cosmos dApps.' },
{ label: 'Cross-Chain Compatibility', content: 'Enables seamless cross-chain interaction through pointer contracts.' }
]}
referenceGuides={[
{
title: "Pointer Contract Guide",
sections: [
{
content: "Deploy a pointer contract for cross-chain compatibility using the `seid` CLI tool.",
},
{
content: "1. Check if a pointer exists for the token or contract with:",
command: "seid q evm pointer [type] [pointee] [flags]"
},
{
content: "2. Deploy a pointer contract linking a CosmWasm contract with an EVM pointer:",
command: "seid tx evm register-evm-pointer CW20 $CW20_TOKEN_ADDRESS --from=$SENDER --chain-id=pacific-1 --broadcast-mode=block --gas=200000 --fees=5000usei --node=https://rpc.sei-apis.com"
},
{
content: "3. Confirm pointer registration with:",
command: "seid query evm pointer [type] [pointee] [flags]"
},
{
content: "Refer to [Pointer Contracts Documentation](/dev-interoperability/pointer-contracts) for more details."
}
]
}
]}
/>
</Box>

<Divider variant="dashed" color="#9E1F19" />

<Box mt="md" mb="md">
<TokenCard
title="Smart Contract Tokens"
tooltip="Tokens managed through smart contracts using ERC20 and CW20 standards."
details={[
{ label: 'ERC20 Standard', content: 'Defines fungible tokens for EVM-based chains.' },
{ label: 'CW20 Standard', content: 'Cosmos equivalent of ERC20 for seamless dApp integration.' },
{ label: 'Pointer Contracts', content: 'Facilitates interactions between CW20 and ERC20 across Cosmos and EVM.' },
{
title: "Smart Contract Token Guide",
sections: [
{
content: "Guidelines for deploying and interacting with smart contract tokens.",
},
{
content: "1. Deploy the smart contract using the following command:",
command: "seid tx wasm store [wasm-file] --from=[key] --gas=[gas] --fees=[fee]"
},
{
content: "2. Deploy the smart contract using the following command:",
command: "seid tx wasm store [wasm-file] --from=[key] --gas=[gas] --fees=[fee]"
},
{
content: "3. Deploy the smart contract using the following command:",
command: "seid tx wasm store [wasm-file] --from=[key] --gas=[gas] --fees=[fee]"
},
]
}
]}
/>
</Box>

<Divider variant="dashed" color="#9E1F19" />

<Box mt="md" mb="md">
<TokenCard
title="NFTs"
tooltip="Unique digital assets using ERC721 and CW721 standards with optional royalties."
details={[
{ label: 'ERC721 Standard', content: 'Defines unique tokens for EVM-based chains.' },
{ label: 'CW721 Standard', content: 'Cosmos equivalent of ERC721 for Cosmos-based dApps.' },
{ label: 'Royalty Standards', content: 'Supports ERC2981 and CW2981 for creator royalties.' },
{ label: 'Cross-Chain Compatibility', content: 'Pointer contracts enable cross-standard NFT interactions.' },
{
title: "NFT Deployment Guide",
sections: [
{
content: "Instructions to deploy and manage NFTs on Sei.",
},
{
content: "1. Deploy the NFT smart contract:",
command: "seid tx wasm store [nft-wasm-file] --from=[key] --gas=[gas] --fees=[fee]"
},
{
content: "2. Deploy the NFT smart contract:",
command: "seid tx wasm store [nft-wasm-file] --from=[key] --gas=[gas] --fees=[fee]"
},
{
content: "3. Deploy the NFT smart contract:",
command: "seid tx wasm store [nft-wasm-file] --from=[key] --gas=[gas] --fees=[fee]"
}
]
}
]}
/>
</Box>

<Divider variant="dashed" color="#9E1F19" />

<Box mt="md">
<TokenCard
title="IBC Tokens"
tooltip="Tokens bridged from other Cosmos chains via the IBC protocol."
details={[
{ label: 'IBC Protocol', content: 'Enables token transfers between Cosmos chains.' },
{ label: 'Channel Configuration', content: 'Displays detailed channel information for each network.' }
]}
/>
</Box>
In this section, we delve into the various token standards supported on Sei. Understanding these standards is crucial for developers as they form the foundation of many decentralized applications.

Sei offers support for four main token types:
- [Sei Token](#sei-token)
- [Token Factory Tokens](#tokenfactory)
- [Smart Contract Tokens](#smart-contract-tokens)
- [IBC Tokens](#ibc-tokens)

## **Sei Token**

The Sei token is the native token of the Sei blockchain, serving multiple roles within the ecosystem.

- **Fee Token**: Used to pay transaction fees on the Sei network.
- **Governance Token**: Used to participate in governance decisions affecting the network.


**EVM**

`1sei = 10**18 wei = 1000000000000000000wei`

`1sei = 10**9 wei = 1000000000gwei` (giga-wei)

**Native**

`1sei = 10**18 asei = 1000000000000000000asei` (atto-sei)

`1sei = 10**9 nsei = 1000000000nsei` (nano-sei)

`1sei = 10**6 usei = 1000000usei` (micro-sei)

`1gwei = 1nsei`

## **Fungible Tokens**

Fungible tokens are digital assets that are interchangeable with one another and are not unique. Sei supports both ERC20 and CW20 fungible token standards, so developers have the option to create tokens using the native TokenFactory or via smart contract standards.

### TokenFactory

TokenFactory allows for the creation of tokens that are natively integrated into the base chain modules. This integration means bank balances are available through native bank queries, unlike CW20 or ERC20 tokens which require querying the smart contract directly.

- **Native Integration**: Tokens created via TokenFactory are integrated into the chain allowing the core modules to efficiently interact with these tokens and RPC clients to return their balances in native bank and account queries.
- **Efficient Queries**: Tokens are available through native queries, making it more efficient than querying smart contracts directly.
- **Recommended Use**: Ideal for scenarios where performance and ease of access are priorities or for native applications.

Learn more about creating tokens using TokenFactory in the [TokenFactory Tutorial](/dev-tutorials/tokenfactory-tutorial).

### Smart Contract Tokens

- **ERC20**: The ERC20 standard defines a common set of rules for fungible tokens on EVM-based blockchains. These tokens can be transferred, approved, and queried using standard functions.
- **CW20**: The CW20 standard is the wasm equivalent of ERC20, providing similar functionalities with much easier tracking and no need for external indexers.
- **Standard Compatibility**: Supporting both CW20 and ERC20 ensure compatibility with existing dApps and ecosystems while enabling onboarding of EVM-centric projects.
- **Interoperability**: Both standards support pointer contracts, enabling seamless interaction between native and EVM environments.
- **Interoperability and Pointer Contracts**: [Pointer contracts](/dev-tutorials/pointer-contracts) enable interoperability between ERC20 and CW20 tokens, allowing for seamless interaction between the two standards. A registry is kept to track pointer contracts and facilitate interoperability.
- **Recommended Use**: Suitable for applications needing standard token interactions for use with existing dApps and maximum compatibility.


<Blockquote mt="lg">
<Title order={4} mb="sm">Interoperability</Title>
Regardless of the choice, both TokenFactory and CW20/ERC20 tokens can have pointer contracts deployed, facilitating seamless cross-vm interoperability.

For more detailed guidance, refer to the [Pointer Contracts Documentation](/dev-tutorials/pointer-contracts).
</Blockquote>

## **NFTs**

Non-fungible tokens (NFTs) represent unique digital assets. Sei supports both ERC721 and CW721 standards as well as their counterparts with royalties (2981).

- **ERC721**: The ERC721 standard defines the structure for non-fungible tokens on EVM-based blockchains. Each token is unique and cannot be exchanged on a one-to-one basis like fungible tokens.
- **CW721**: The CW721 standard is the wasm equivalent of ERC721, providing similar functionalities with the added benefit of not requiring complicated indexing techniques and platforms to track them.
- **CW2981 & ERC2981**: These standards define royalty mechanisms for NFTs, ensuring creators receive a percentage of sales.
- **Interoperability**: Similar to fungible tokens, NFTs can interact across different standards using pointer contracts.
- **Pointer Contract Registry**: A registry for tracking pointer contracts specific to NFTs.

## **IBC Tokens**

Inter-Blockchain Communication (IBC) is a trustless permissionless interchain messaging protocol that enables communication between many different chains. IBC tokens are tokens bridged from one chain to another using the IBC protocol. Channels are set up to establish communication between the chains. Each channel has a unique identifier and specific configurations. View the [IBC Channel](https://github.com/sei-protocol/chain-registry/blob/main/ibc_info.json) section of the Sei chain registry for channel information.

0 comments on commit 2385a29

Please sign in to comment.