Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion pages/build/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"type": "separator",
"title": "Smart Contracts"
},
"pointers": "Pointer Contracts",
"dev-smart-contracts": "Choosing a VM",
"dev-querying-state": "Querying Blockchain State",
"cosmwasm-general": "CosmWasm (General)",
"evm-general": "EVM (General)",
"evm-cli-tutorial": "EVM (CLI)",
"nft-contract-tutorial": "NFT Contracts",
"pointer-contracts": "Pointer Contracts",

"-- Assets": {
"type": "separator",
Expand Down
392 changes: 334 additions & 58 deletions pages/build/ibc-protocol.mdx

Large diffs are not rendered by default.

175 changes: 85 additions & 90 deletions pages/build/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,94 +6,89 @@ import { LinkCard } from '../../components/LinkCard';
Learn the fundamentals of Sei blockchain development.

<div className='grid grid-cols-1 md:grid-cols-3 gap-4 my-8'>
<LinkCard
icon={<IconTools />}
title='Understanding Sei Architecture'
link='/learn/differences-with-ethereum'
description={`Explore Sei's unique architecture and how it differs from Ethereum.`}
preview={{
content: "Learn about Sei's consensus mechanism and architecture tailored for optimized performance and scalability.",
highlights: [
"Unique consensus for fast finality",
"Efficient transaction execution",
"Parallel transaction processing",
"Seamless dApp integration",
],
}}
/>
<LinkCard
icon={<IconCoins />}
title='Exploring Token Standards'
link='/build/dev-token-standards'
description={`Learn how to create and integrate tokens using Sei’s standards.`}
preview={{
content: "Detailed guidance on creating fungible and non-fungible tokens using Sei's standards.",
highlights: [
"Standardized fungible and non-fungible tokens",
"Deploying ERC-20/ERC-721 equivalents",
"Cross-chain token compatibility",
"Gas-optimized token transfers",
],
}}
/>
<LinkCard
icon={<IconCode />}
title='Deploying EVM-Compatible Contracts'
link='/build/evm-general'
description={`Learn how to deploy, interact with, and optimize EVM-compatible contracts on Sei.`}
preview={{
content: "Step-by-step guidance for deploying Ethereum-compatible contracts on Sei.",
highlights: [
"EVM compatibility explained",
"Deploying existing Solidity contracts",
"Optimizing contract performance on Sei",
"Debugging and migrating contracts",
],
}}
/>
<LinkCard
icon={<IconBrain />}
title='Developing CosmWasm Smart Contracts'
link='/build/cosmwasm-general'
description={`Build high-performance, flexible smart contracts with CosmWasm on Sei.`}
preview={{
content: "Unlock new possibilities by developing CosmWasm smart contracts tailored for Sei.",
highlights: [
"Understanding CosmWasm basics",
"Use cases: DeFi, NFTs, and more",
"Deployment and testing workflows",
"Integrating CosmWasm contracts with dApps",
],
}}
/>
<LinkCard
icon={<IconLayoutDashboard />}
title='Connecting Frontends to Smart Contracts'
link='/build/building-a-frontend'
description={`Learn how to build and connect frontend interfaces for Sei-based dApps.`}
preview={{
content: "Create performant and user-friendly frontends that seamlessly interact with Sei’s backend.",
highlights: [
"Choosing the right frameworks (e.g., React)",
"Connecting to Sei’s smart contracts",
"Handling blockchain events",
"Best practices for dApp UX/UI",
],
}}
/>
<LinkCard
icon={<IconArrowsExchange />}
title='Cross-Chain Interoperability with IBC'
link='/build/ibc-protocol'
description={`Enable seamless communication between Sei and other blockchains using IBC.`}
preview={{
content: "Implement cross-chain features with IBC to connect Sei with the broader blockchain ecosystem.",
highlights: [
"Introduction to the IBC protocol",
"Setting up cross-chain communication",
"Ensuring data integrity and security",
"Use cases: Cross-chain DeFi, NFTs, and more",
],
}}
/>
<LinkCard
icon={<IconTools />}
title='Understanding Sei Architecture'
link='/learn/differences-with-ethereum'
description={`Explore Sei's unique architecture and how it differs from Ethereum.`}
preview={{
content: "Learn about Sei's consensus mechanism and architecture tailored for optimized performance and scalability.",
highlights: ['Unique consensus for fast finality', 'Efficient transaction execution', 'Parallel transaction processing', 'Seamless dApp integration']
}}
/>
<LinkCard
icon={<IconCoins />}
title='Exploring Token Standards'
link='/build/dev-token-standards'
description={`Learn how to create and integrate tokens using Sei’s standards.`}
preview={{
content: "Detailed guidance on creating fungible and non-fungible tokens using Sei's standards.",
highlights: [
'Standardized fungible and non-fungible tokens',
'Deploying ERC-20/ERC-721 equivalents',
'Cross-chain token compatibility',
'Gas-optimized token transfers'
]
}}
/>
<LinkCard
icon={<IconCode />}
title='Deploying EVM-Compatible Contracts'
link='/build/evm-general'
description={`Learn how to deploy, interact with, and optimize EVM-compatible contracts on Sei.`}
preview={{
content: 'Step-by-step guidance for deploying Ethereum-compatible contracts on Sei.',
highlights: [
'EVM compatibility explained',
'Deploying existing Solidity contracts',
'Optimizing contract performance on Sei',
'Debugging and migrating contracts'
]
}}
/>
<LinkCard
icon={<IconBrain />}
title='Developing CosmWasm Smart Contracts'
link='/build/cosmwasm-general'
description={`Build high-performance, flexible smart contracts with CosmWasm on Sei.`}
preview={{
content: 'Unlock new possibilities by developing CosmWasm smart contracts tailored for Sei.',
highlights: [
'Understanding CosmWasm basics',
'Use cases: DeFi, NFTs, and more',
'Deployment and testing workflows',
'Integrating CosmWasm contracts with dApps'
]
}}
/>
<LinkCard
icon={<IconLayoutDashboard />}
title='Connecting Frontends to Smart Contracts'
link='/build/building-a-frontend'
description={`Learn how to build and connect frontend interfaces for Sei-based dApps.`}
preview={{
content: 'Create performant and user-friendly frontends that seamlessly interact with Sei’s backend.',
highlights: [
'Choosing the right frameworks (e.g., React)',
'Connecting to Sei’s smart contracts',
'Handling blockchain events',
'Best practices for dApp UX/UI'
]
}}
/>
<LinkCard
icon={<IconArrowsExchange />}
title='Cross-Chain Interoperability with IBC'
link='/build/ibc-protocol'
description={`Enable seamless communication between Sei and other blockchains using IBC.`}
preview={{
content: 'Implement cross-chain features with IBC to connect Sei with the broader blockchain ecosystem.',
highlights: [
'Introduction to the IBC protocol',
'Setting up cross-chain communication',
'Ensuring data integrity and security',
'Use cases: Cross-chain DeFi, NFTs, and more'
]
}}
/>
</div>
6 changes: 6 additions & 0 deletions pages/build/pointers/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"overview": "Overview",
"pointer-contracts": "Standard [20, 721, 1155]",
"pointer-ibc": "IBC",
"pointer-tokenfactory": "Tokenfactory"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ImageWithCaption } from "../../components";
import PointerContractsWithout from "../../public/assets/pointer-contracts-without.png";
import PointerContractsSimplified from "../../public/assets/pointer-contracts-simplified.png";
import HowItWorks from "../../public/assets/pointer-contracts-how-it-works.png";
import { ImageWithCaption } from '../../../components';
import PointerContractsWithout from '../../../public/assets/pointer-contracts-without.png';
import PointerContractsSimplified from '../../../public/assets/pointer-contracts-simplified.png';
import HowItWorks from '../../../public/assets/pointer-contracts-how-it-works.png';

# Pointer Contracts

Expand All @@ -10,19 +10,23 @@ Intended to be efficient and quick to deploy, a pointer simply serves as an inte

## Why Pointer Contracts

<ImageWithCaption img={PointerContractsWithout} alt="Without Pointer Contracts" caption="A world without pointer contracts"/>
<ImageWithCaption img={PointerContractsWithout} alt='Without Pointer Contracts' caption='A world without pointer contracts' />

Wallets and clients for feature-rich protocols typically support only a single execution environment.
EVM wallets handle ERC-20 coins and ERC-721 NFTs but cannot interact with cosmwasm contracts due to different token standards and interaction methods.
The same problem exists for clients built for other protocols (like cosmwasm) which cannot directly interact with Ethereum-based contracts or ERC tokens.

Pointer Contracts solve this by enabling interoperability of either protocol, regardless of the client interface.

<ImageWithCaption img={PointerContractsSimplified} alt="With Pointer Contracts" caption="With pointer contracts, all tokens can be accessed by wallets of either environment"/>
<ImageWithCaption
img={PointerContractsSimplified}
alt='With Pointer Contracts'
caption='With pointer contracts, all tokens can be accessed by wallets of either environment'
/>

## How Pointer Contracts Work

<ImageWithCaption img={HowItWorks} alt="How Pointer Contracts Work" caption="Pointer contracts enable seamless interoperability"/>
<ImageWithCaption img={HowItWorks} alt='How Pointer Contracts Work' caption='Pointer contracts enable seamless interoperability' />

Each smart contract is limited to **one** associated pointer contract, which must be registered on chain when deploying.
This prevents conflicts and provides a reference point for verifying the authenticity of the paired contract itself.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Callout } from "nextra/components";
import { Callout } from 'nextra/components';

<Callout type="info" emoji="ℹ️">
For an overview of Pointer Contracts click [here](/dev-interoperability/pointer-contracts).
<Callout type='info' emoji='ℹ️'>
For an overview of Pointer Contracts click [here](/dev-interoperability/pointer-contracts).
</Callout>

### Deploying Pointer Contracts

This section guides you through the process of deploying a Pointer Contract for various token standards using the seid CLI tool.

<Callout type="info" emoji="ℹ️">
For an in-depth understanding of Sei token standards, click [here](/dev-token-standards).
<Callout type='info' emoji='ℹ️'>
For an in-depth understanding of Sei token standards, click [here](/dev-token-standards).
</Callout>

#### Prerequisites
Expand Down Expand Up @@ -80,9 +80,9 @@ Usage:
<Callout type="info">
For a quick-reference for flags/args and syntax, use the `--help` flag with any command. For example:

```bash
seid tx evm --help
```
```bash
seid tx evm --help
```

</Callout>

Expand All @@ -109,8 +109,9 @@ seid tx evm register-cw-pointer ERC20 $ERC20_TOKEN_ADDRESS --from=$SENDER --chai
- `--fees`: Indicates the transaction fee.
- `--node`: Points to the specific Sei node RPC URL you're connecting to for transaction submission.

<Callout type="info" emoji="ℹ️">
Source code for pointer contracts can be seen in the [contracts directory](https://github.com/sei-protocol/sei-chain/tree/main/contracts/src) of the [sei-chain](https://github.com/sei-protocol/sei-chain) repo.
<Callout type='info' emoji='ℹ️'>
Source code for pointer contracts can be seen in the [contracts directory](https://github.com/sei-protocol/sei-chain/tree/main/contracts/src) of the
[sei-chain](https://github.com/sei-protocol/sei-chain) repo.
</Callout>

### For ERC721 Tokens
Expand Down Expand Up @@ -177,6 +178,3 @@ 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.
100 changes: 100 additions & 0 deletions pages/build/pointers/pointer-ibc.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Deploying IBC Pointers

## Overview

IBC (Inter-Blockchain Communication) pointers allow tokens originating from another blockchain to have an ERC-compatible representation within the Sei network. This guide outlines the steps required to submit a governance proposal to register an IBC token with an ERC pointer.

## Prerequisites

Before submitting a governance proposal to register an IBC pointer, ensure you have:

- **Token metadata** (including the token denomination, name, symbol, and decimals).
- **Sufficient deposit** proposal submission has no cost, but to be eligible for voting there is a deposit, to prevent abuse.
- **Test before mainnet** especially if it's your first time, try sending the proposal on a testnet.

## Metadata Requirements

For an IBC token, metadata must be included in the governance proposal. The metadata ensures the token is properly recognized within the ERC-compatible execution environment.

### Example Metadata JSON

```json
{
"id": "1",
"title": "Register IBC Pointer",
"description": "Register an ERC-compatible pointer for an IBC token.",
"proposal_type": "/seiprotocol.seichain.evm.AddERCNativePointerProposalV2",
"messages": [
{
"@type": "/seiprotocol.seichain.evm.AddERCNativePointerProposalV2",
"title": "Register IBC Pointer",
"description": "Create an ERC-compatible pointer for an IBC token.",
"token": "ibc/<IBC_DENOM_HASH>",
"name": "Token Name",
"symbol": "TOKEN",
"decimals": <DECIMALS>
}
],
"total_deposit": [
{
"denom": "<DEPOSIT_DENOM>",
"amount": "<DEPOSIT_AMOUNT>"
}
]
}
```

### Metadata Fields

- **`token`**: The IBC denomination hash of the token to be registered.
- **`name`**: The human-readable token name.
- **`symbol`**: The token's ticker symbol.
- **`decimals`**: The decimal precision of the token.
- **`total_deposit`**: The deposit amount required for governance consideration.

## Submitting the Governance Proposal

Use the following command to submit the proposal:

```bash
seid tx gov submit-proposal add-erc-native-pointer "Register IBC Pointer" "Register an ERC-compatible pointer for an IBC token" ibc/<IBC_DENOM_HASH> "Token Name" "TOKEN" <DECIMALS> <DEPOSIT_AMOUNT><DEPOSIT_DENOM> --from=<GOVERNANCE_ADDRESS> --chain-id=<CHAIN_ID> --fees=<FEE_AMOUNT><FEE_DENOM> --gas=<GAS_LIMIT>
```

### Command Breakdown

- **Proposal Title & Description**: Describes the purpose of the pointer registration.
- **IBC Denomination Hash**: The IBC token identifier.
- **Token Name & Symbol**: Used for display purposes.
- **Decimals**: The token’s decimal precision.
- **Deposit**: Required governance deposit to proceed with the proposal.
- **From**: Address submitting the proposal.
- **Chain ID**: Specifies the network.
- **Fees & Gas**: Specifies transaction fees and gas limits.

## Monitoring the Proposal Status

After submission, check the proposal status with:

```bash
seid q gov proposal <PROPOSAL_ID>
```

### Possible Proposal Statuses

- **`PROPOSAL_STATUS_VOTING_PERIOD`**: Proposal is under review and open for voting.
- **`PROPOSAL_STATUS_PASSED`**: Proposal has been approved.
- **`PROPOSAL_STATUS_REJECTED`**: Proposal has been rejected.

## Confirming Pointer Registration

Once the proposal is passed and executed, confirm the pointer registration using:

```bash
seid q evm pointer ERC20 ibc/<IBC_DENOM_HASH>
```

If the registration was successful, this query should return the associated ERC-compatible representation of the IBC token.

## Conclusion

Registering an IBC pointer requires a governance proposal with correctly formatted metadata. Once the proposal passes, the pointer is officially recognized within the ERC-compatible execution environment, allowing seamless integration across different blockchain ecosystems. Ensure all required details are accurate before submitting the proposal to avoid delays or rejections.
Loading