> ## Documentation Index
> Fetch the complete documentation index at: https://seilabs-docs-evm-cookbook.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate Your EVM dApp to Sei

> Step-by-step checklist for teams that already run on another EVM chain and want to redeploy on Sei, including environment prep, contract migration, liquidity planning, and chain-specific guidance for Ethereum, Arbitrum, Base, Polygon, and Avalanche.

Sei has full EVM bytecode compatibility, instant finality, and sub-second blocks. This guide is for product teams that already run on Polygon, Base, Ethereum, Arbitrum, Avalanche, or another EVM chain. It shows what you need to do to bring your dApp stack to Sei.

<Info>
  **Why migrate to Sei?**

  * Block times are 400 ms, which is 30× faster than Ethereum and 2 to 5× faster than most L2s.
  * Throughput is approximately 100 MGas/s, which is 20× higher than Ethereum mainnet.
  * Finality is instant (approximately 400 ms). You do not wait for confirmations or for safe or finalized states.
  * Parallelized execution gives higher throughput without code changes.
  * Full EVM compatibility lets you deploy your existing Solidity contracts unchanged.
</Info>

## Chain comparison overview

Before you start the migration steps, see how Sei compares with your source chain:

| Feature | Sei | Ethereum | Arbitrum | Base | Polygon PoS | Avalanche C-Chain |
| - | - | - | - | - | - | - |
| Chain ID | 1329 | 1 | 42161 | 8453 | 137 | 43114 |
| Block time | 400 ms | \~12 s | \~250 ms | \~2 s | \~2 s | \~2 s |
| Finality | Instant (\~400 ms) | \~15 min (finalized) | \~7 days (L1 settlement) | \~7 days (L1 settlement) | \~5 s (Heimdall v2) | \~1 s |
| Gas limit | 12.5 M | 60M | 32M | 375M | 45M | Dynamic |
| Per-tx gas cap | 12.5 M | \~16.7 M | 32 M | \~25 M | 45 M | Dynamic |
| Native token | SEI | ETH | ETH | ETH | POL (MATIC) | AVAX |
| Parallel execution | Yes | No | No | No | No | No |
| Base fee burn | No (100% to validators) | Yes (EIP-1559) | Yes | Yes | Yes | Yes |
| EVM version | Pectra (without blobs) | Fusaka | Fusaka | Pectra | Pectra | Cancun |

## Chain-specific migration guides

Select your source chain to see the migration considerations for that chain:

<Tabs>
  <Tab title="Ethereum">
    ### Migrating from Ethereum Mainnet

    **Key differences:**

    | Aspect | Ethereum | Sei | Migration impact |
    | - | - | - | - |
    | Block time | \~12 seconds | 400 ms | Reduce `deadline` buffers in DEX swaps by 30× |
    | Finality | \~15 min for finalized | Instant (\~400 ms) | Remove confirmation polling logic |
    | Gas limit | \~16.7M per TX (EIP-7825) | 12.5 M per block/TX | Split large batch deployments |
    | Fee model | EIP-1559 with burn | EIP-1559 with different parameters | Update fee estimation UIs |
    | Pending state | Yes | No | Remove pending transaction logic |

    **What to update:**

    1. **Time-based logic:** If your contracts use block timestamps for deadlines, reduce the timeouts proportionally. A 30-minute deadline on Ethereum is approximately 150 blocks. On Sei, the deadline should be approximately 45 seconds (approximately 112 blocks).

    2. **Confirmation requirements:** Remove any logic that waits for multiple confirmations or checks "safe" versus "finalized" states. Sei has instant finality.

    3. **Gas estimation:** Sei's parallelized execution can make gas estimates vary slightly. Add a modest buffer (10 to 15%) to your `gasLimit` calculations.

    4. **Fee UI:** Simplify your frontend. You can use a single `gasPrice` input instead of `maxFeePerGas` and `maxPriorityFeePerGas`.

    ```ts theme={null}
    // Before (Ethereum EIP-1559)
    const tx = await contract.method({
      maxFeePerGas: ethers.parseUnits('50', 'gwei'),
      maxPriorityFeePerGas: ethers.parseUnits('2', 'gwei')
    });

    // After (Sei - simplified)
    const tx = await contract.method({
      gasPrice: ethers.parseUnits('50', 'gwei') // Sei minimum gas price is 50 gwei (live on mainnet — query with eth_gasPrice)
    });
    ```

    <Note>Sei enforces a minimum gas price of 50 gwei. The mempool rejects transactions below this price. Query the live value with `eth_gasPrice`, which returns the base fee plus a suggested tip.</Note>

    5. **PREVRANDAO and DIFFICULTY:** If you use these opcodes for any randomness, integrate a VRF oracle instead. On Sei, their values are derived from block time, not from true randomness.
  </Tab>

  <Tab title="Arbitrum">
    ### Migrating from Arbitrum

    **Key differences:**

    | Aspect | Arbitrum | Sei | Migration impact |
    | - | - | - | - |
    | Architecture | Optimistic Rollup (L2) | L1 | No L1 data availability concerns |
    | Finality | \~7 days for L1 settlement | Instant (\~400 ms) | Simplify withdrawal flows |
    | Sequencer | Centralized sequencer | Decentralized validators | No sequencer downtime risk |
    | Block time | \~250 ms | 400 ms | Slightly slower, but with true finality |
    | L1 gas | Pays L1 data costs | No L1 dependency | Simpler fee structure |

    **What to update:**

    1. **Remove L1 interactions:** Find any logic that posts data to Ethereum L1 or reads data from it. Remove that logic, or replace it with a Sei-native alternative.

    2. **Sequencer assumptions:** Remove any sequencer uptime checks or fallback logic. Sei uses decentralized consensus.

    3. **Withdrawal delays:** If your protocol has 7-day withdrawal windows for "L1 finality," you can remove them. Sei settles instantly.

    4. **ArbOS precompiles:** Replace any Arbitrum-specific precompiles:

    ```solidity theme={null}
    // Arbitrum-specific (remove)
    // import { ArbSys } from "@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol";
    // uint256 blockNum = ArbSys(0x64).arbBlockNumber();

    // Sei equivalent
    uint256 blockNum = block.number; // Standard EVM
    ```

    5. **Cross-chain messaging:** Replace Arbitrum's native bridge with [LayerZero V2](/evm/bridging/layerzero) for omnichain connectivity.
  </Tab>

  <Tab title="Base">
    ### Migrating from Base

    **Key differences:**

    | Aspect | Base | Sei | Migration impact |
    | - | - | - | - |
    | Architecture | OP Stack Rollup (L2) | L1 | No L1 data availability concerns |
    | Finality | \~7 days for L1 settlement | Instant (\~400 ms) | Simplify withdrawal flows |
    | Block time | \~2 seconds | 400 ms | 5× faster block production |
    | Sequencer | Coinbase-operated | Decentralized validators | No single point of failure |
    | EIP-4844 blobs | Supported | Not supported | Remove blob transaction logic |

    **What to update:**

    1. **Remove blob transactions:** Sei does not support EIP-4844 blob transactions. If you use them for data availability, store the data differently or use Sei's native mechanisms.

    2. **OP Stack precompiles:** Remove any precompile calls that are specific to Optimism or Base:

    ```solidity theme={null}
    // Base-specific (remove)
    // L1Block(0x4200000000000000000000000000000000000015).number();

    // Use standard EVM on Sei
    uint256 blockNum = block.number;
    ```

    3. **Fault proof assumptions:** Remove any logic that accounts for the 7-day challenge period. Sei has instant finality.

    4. **Sequencer fee logic:** Base has a separate L1 data fee component. On Sei, fees are simpler: `Gas Used × Gas Price`.

    5. **Coinbase Wallet integrations:** Update your wallet connection logic to use the Sei network parameters:

    ```ts theme={null}
    // Update network config
    const seiMainnet = {
      chainId: '0x531', // 1329 in hex
      chainName: 'Sei',
      nativeCurrency: { name: 'Sei', symbol: 'SEI', decimals: 18 },
      rpcUrls: ['https://evm-rpc.sei-apis.com'],
      blockExplorerUrls: ['https://seiscan.io']
    };
    ```
  </Tab>

  <Tab title="Polygon">
    ### Migrating from Polygon PoS

    **Key differences:**

    | Aspect | Polygon PoS | Sei | Migration impact |
    | - | - | - | - |
    | Native token | POL (MATIC) | SEI | Update all token references |
    | Block time | \~2 seconds | 400 ms | 5× faster blocks |
    | Finality | \~5 s (Heimdall v2) | Instant (\~400 ms) | Remove finality delay handling |
    | Checkpoints | Periodic to Ethereum | None | Simpler architecture |
    | Reorgs | Possible (rare) | Never | Remove reorg handling |

    **What to update:**

    1. **Token references:** Replace all MATIC and POL references with SEI:

    ```solidity theme={null}
    // Before (Polygon)
    // IERC20(0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270).transfer(...); // WMATIC

    // After (Sei) - use native SEI or wrapped version
    // Check ecosystem contracts for canonical WSEI address
    ```

    2. **Checkpoint logic:** Remove any logic that waits for Polygon checkpoints to Ethereum. Sei has instant finality.

    3. **Heimdall and Bor assumptions:** Remove any Polygon-specific validator or sidechain logic.

    4. **Reorg handling:** You can safely remove the code that handles block reorganizations. Sei's consensus prevents reorgs.

    5. **Gas price oracles:** Polygon's gas prices can spike significantly. Sei's fees are more stable because of higher throughput:

    ```ts theme={null}
    // Polygon - needed aggressive gas price management
    const gasPrice = await provider.getGasPrice();
    const boostedPrice = gasPrice.mul(120).div(100); // 20% buffer

    // Sei - simpler approach works
    const gasPrice = await provider.getGasPrice(); // Usually sufficient as-is
    ```

    6. **Bridge integrations:** Replace the Polygon Bridge with [LayerZero](/evm/bridging/layerzero) or other Sei-supported bridges.
  </Tab>

  <Tab title="Avalanche">
    ### Migrating from Avalanche C-Chain

    **Key differences:**

    | Aspect | Avalanche C-Chain | Sei | Migration impact |
    | - | - | - | - |
    | Native token | AVAX | SEI | Update all token references |
    | Block time | \~2 seconds | 400 ms | 5× faster blocks |
    | Finality | \~1 second | Instant (\~400 ms) | Similar, slightly faster |
    | Subnets | Supported | N/A | Remove subnet logic |
    | Gas limit | Dynamic (post-Octane) | 12.5 M | Large tx headroom varies, so benchmark deployments |

    **What to update:**

    1. **Token references:** Replace AVAX with SEI:

    ```solidity theme={null}
    // Before (Avalanche)
    // IERC20(0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7).transfer(...); // WAVAX

    // After (Sei)
    // Use native SEI or check ecosystem contracts for WSEI
    ```

    2. **Subnet interactions:** If your dApp uses Avalanche Subnets, redesign that architecture for Sei's single-chain model, or use cross-chain messaging.

    3. **Avalanche-specific precompiles:** Remove C-Chain precompile calls:

    ```solidity theme={null}
    // Avalanche-specific (remove)
    // INativeMinter(0x0200000000000000000000000000000000000001).mintNativeCoin(...)

    // Use standard EVM patterns on Sei
    ```

    4. **Gas limit adjustments:** Avalanche now uses a dynamic gas model after Octane. Sei has a fixed `12.5M` cap per block and per transaction. If you have large transactions, benchmark them on Sei and split them when needed:

    ```ts theme={null}
    // If deploying large contracts, batch by gas
    const MAX_GAS_PER_BATCH = 11_500_000; // Leave buffer under 12.5M
    ```

    5. **TWAP calculations:** Both chains have fast blocks. If you migrate oracle logic, adjust your observation windows:

    ```solidity theme={null}
    // Avalanche: 1 hour = ~1800 blocks
    // Sei: 1 hour = ~9000 blocks
    uint32 constant TWAP_PERIOD = 9000; // Adjust for Sei's block time
    ```
  </Tab>
</Tabs>

## Step 1: Evaluate compatibility

Review the [Divergence from Ethereum](/evm/differences-with-ethereum) page. Confirm that every assumption your contracts and frontends make still holds.

| Dimension | Sei EVM | Practical effect |
| - | - | - |
| Block time | 400 ms | Faster TX inclusion means smaller `deadline` buffers and quicker price oracles |
| Finality | Instant (\~400 ms) | No separate "safe/latest" commitment levels to poll |
| Gas limit | 12.5M gas + 21 MB byte limit | Batch contract deployments by 12.5M gas blocks |
| Base fee | Dynamic but never burned | Validators receive 100% of fees |
| Execution | Parallelized EVM | No changes to your Solidity code are necessary |
| Address format | Dual (0x + sei1...) | Same private key derives both addresses |

<Warning>
  **Features that need attention:**

  * **Pending state:** Sei does not have a pending state. A transaction is either included or not.
  * **Blob opcodes:** Sei does not support EIP-4844 blob transactions.
  * **PREVRANDAO entropy:** Use VRF oracles for randomness. PREVRANDAO returns a value derived from block time, not true randomness.
  * **SELFDESTRUCT:** Refactor to "soft close" patterns. This opcode is deprecated.
</Warning>

## Step 2: Prepare your development environment

### Add Sei network configuration

**Hardhat configuration:**

```ts title="hardhat.config.ts" theme={null}
import { defineConfig, configVariable } from 'hardhat/config';
import hardhatToolboxMochaEthers from '@nomicfoundation/hardhat-toolbox-mocha-ethers';

export default defineConfig({
  networks: {
    seiMainnet: {
      type: 'http',
      chainId: 1329,
      url: 'https://evm-rpc.sei-apis.com',
      accounts: [configVariable('SEI_PRIVATE_KEY')]
    },
    seiTestnet: {
      type: 'http',
      chainId: 1328,
      url: 'https://evm-rpc-testnet.sei-apis.com',
      accounts: [configVariable('SEI_PRIVATE_KEY')]
    }
  },
  plugins: [hardhatToolboxMochaEthers]
});
```

Store your deployer key in Hardhat's encrypted keystore with `npx hardhat keystore set SEI_PRIVATE_KEY`. In Hardhat 3, `hardhat-verify` (bundled with the toolbox) enables contract verification through Sourcify by default.

**Foundry configuration:**

```toml title="foundry.toml" theme={null}
[profile.default]
src = "src"
out = "out"
libs = ["lib"]

[rpc_endpoints]
sei_mainnet = "https://evm-rpc.sei-apis.com"
sei_testnet = "https://evm-rpc-testnet.sei-apis.com"

# Verification uses Sourcify (no API key needed)
# Run: forge verify-contract --verifier sourcify --chain-id <CHAIN_ID> <ADDRESS> <PATH:CONTRACT>
```

For complete setup instructions, see the [Hardhat tutorial](/evm/evm-hardhat) and the [Foundry guide](/evm/evm-foundry).

### Wallet configuration

Preconfigure MetaMask or other wallets with the Sei chain parameters:

```ts theme={null}
const seiMainnet = {
  chainId: '0x531', // 1329
  chainName: 'Sei',
  nativeCurrency: { name: 'Sei', symbol: 'SEI', decimals: 18 },
  rpcUrls: ['https://evm-rpc.sei-apis.com'],
  blockExplorerUrls: ['https://seiscan.io']
};

await window.ethereum.request({
  method: 'wallet_addEthereumChain',
  params: [seiMainnet]
});
```

## Step 3: Bootstrap common infrastructure

Sei already exposes canonical helper contracts. Reference them instead of redeploying them:

| Component | Address | Notes |
| - | - | - |
| Permit2 | `0xB952578f3520EE8Ea45b7914994dcf4702cEe578` | Shared allowance manager for DEX and wallet flows |
| Multicall3 | `0xcA11bde05977b3631167028862bE2a173976CA11` | Enables batching and view aggregation |
| ImmutableCreate2Factory | `0x0000000000FFe8B47B3e2130213B802212439497` | Deterministic deployments with `CREATE2` |
| SingletonFactory | `0xce0042B868300000d44A59004Da54A005ffdcf9f` | EIP-2470 singleton factory |

For LayerZero, Safe, and other third-party contracts, see the full [Ecosystem Contracts page](/evm/ecosystem-contracts).

## Step 4: Port contracts and configuration

### Parameterize chain-specific constants

```solidity theme={null}
// Example: Chain-aware deadline calculation
function getDeadline(uint256 secondsFromNow) internal view returns (uint256) {
    if (block.chainid == 1329) { // Sei Mainnet
        // ~2.5 blocks per second on Sei
        return block.timestamp + secondsFromNow;
    } else if (block.chainid == 1) { // Ethereum
        // ~1 block per 12 seconds on Ethereum
        return block.timestamp + secondsFromNow;
    }
    return block.timestamp + secondsFromNow;
}
```

### Adjust gas and size assumptions

* Keep `gasLimit` buffers modest, but make sure that calldata stays under 21 MB.
* Sei's gas limit is 12.5M per block, so large deployments may need batching.

### Refactor deprecated patterns

```solidity theme={null}
// Before: SELFDESTRUCT (deprecated)
function destroy() external onlyOwner {
    selfdestruct(payable(owner));
}

// After: Soft close pattern
bool public closed;

function close() external onlyOwner {
    closed = true;
    // Transfer remaining funds
    payable(owner).transfer(address(this).balance);
}

modifier notClosed() {
    require(!closed, "Contract is closed");
    _;
}
```

## Step 5: Plan bridging and cross-chain connectivity

### LayerZero V2

Sei's LayerZero Endpoint ID is `30280`. See the complete [LayerZero integration guide](/evm/bridging/layerzero).

```ts title="layerzero.config.ts" theme={null}
import { EndpointId } from '@layerzerolabs/lz-definitions';

const seiContract = {
  eid: EndpointId.SEI_V2_MAINNET, // 30280
  contractName: 'MyOFT'
};
```

### Other bridge options

* **Circle CCTP:** For USDC bridging (check availability)

## Step 6: Handle assets and oracles

### Oracle integration

Sei supports these oracles:

| Provider | Use case | Documentation |
| - | - | - |
| Pyth Network | High-frequency price feeds | [Pyth Network](https://docs.pyth.network/) |
| Chainlink | Industry-standard data feeds | [Chainlink on Sei](/evm/oracles/chainlink) |
| RedStone | Modular oracle with push model | [RedStone on Sei](/evm/oracles/redstone) |
| API3 | First-party oracle data | [API3 on Sei](/evm/oracles/api3) |

<Info>**TWAP adjustments:** Sei blocks arrive approximately 30× faster than Ethereum blocks. Shorten your TWAP observation windows to keep your time-weighted calculations comparable.</Info>

## Step 7: Launch checklist

### Sei Testnet deployment

* [ ] Deploy all contracts to Sei Testnet (chain ID: `1328`)
* [ ] Run the full integration test suite
* [ ] Verify the contracts with [Sourcify](/evm/evm-verify-contracts)
* [ ] Test wallet connections and transaction flows
* [ ] Validate your oracle integrations
* [ ] If applicable, test cross-chain messaging

### Sei Mainnet deployment

* [ ] Deploy the contracts to Sei Mainnet (chain ID: `1329`)
* [ ] Run the smoke tests again
* [ ] Verify all contracts on Sourcify
* [ ] Update the frontend configurations
* [ ] Prepare migration documentation for your users

<Warning>**Fee redistribution:** If your protocol redistributes "burn rebates" to users, redesign that logic so it does not expect a base-fee burn component. Sei does not burn fees.</Warning>

## Step 8: Operational readiness

### Contract verification

Automate verification in CI with [Sourcify](/evm/evm-verify-contracts):

```bash theme={null}
# Foundry verification
forge verify-contract --watch \
  --verifier sourcify \
  --chain-id 1329 \
  <CONTRACT_ADDRESS> \
  <CONTRACT_NAME>
```

### RPC and indexer health

* **Primary RPC:** `https://evm-rpc.sei-apis.com`
* **Testnet RPC:** `https://evm-rpc-testnet.sei-apis.com`
* For mission-critical paths, consider self-hosted nodes or [premium RPC providers](/learn/rpc-providers).

### Monitoring gas parameters

Query fee data periodically to keep your dashboards up to date:

```ts theme={null}
// Monitor current gas prices
const feeHistory = await provider.send('eth_feeHistory', ['0x5', 'latest', []]);
const gasPrice = await provider.getGasPrice();
```

## Example: Uniswap V3-style deployment

Use these steps to reproduce a Uniswap V3 experience on Sei:

1. **Routers and factories:** Deploy your own, or fork the existing DragonSwap stack:
   * Router: `0xdD489C75be1039ec7d843A6aC2Fd658350B067Cf`
   * V3 Factory: `0x75FC67473A91335B5b8F8821277262a13B38c9b3`
   * Position Manager: `0x8B3c541c30f9b29560f56B9E44b59718916B69EF`

2. **Permit and Multicall:** Point your frontend SDK to the shared `Permit2` and `Multicall3` addresses above.

3. **Liquidity migration script:** Build a helper that:
   * Withdraws LP on the source chain
   * Bridges the underlying tokens to Sei
   * Mints new Sei LP positions
   * Includes gas estimates tuned for Sei's 12.5M block cap

4. **Price oracles:** Reuse your TWAP or Chainlink logic, but shorten the observation windows for Sei's faster blocks.

5. **Verification:** Submit your contracts to [Sourcify](/evm/evm-verify-contracts) and the [Ecosystem Contracts registry](/evm/ecosystem-contracts).

## Helpful references

* [Divergence from Ethereum](/evm/differences-with-ethereum): opcode, gas, and state differences
* [EVM Networks](/evm/networks): RPCs, explorers, and MetaMask payloads
* [Precompiles](/evm/precompiles/example-usage): interoperability patterns
* [Ecosystem Contracts](/evm/ecosystem-contracts): canonical addresses
* [LayerZero Integration](/evm/bridging/layerzero): cross-chain messaging
* [Contract Verification](/evm/evm-verify-contracts): contract verification guide


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.