> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sei.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Gas and Fees

> Sei gas price floor, EIP-1559 fee model differences, and SSTORE cost

# Gas and Fees

Sei supports both legacy and EIP-1559 transactions, but the fee model differs from Ethereum in three ways that affect how you estimate and set gas.

## Legacy Gas Price Floor

Legacy transactions (type 0) on Sei must meet a minimum gas price set by on-chain governance. This floor can change via governance proposals — do not hard-code a specific value.

Use `eth_gasPrice` to read the current minimum:

<CodeGroup>
  ```ts viem theme={"dark"}
  import { createPublicClient, http } from 'viem';
  import { sei } from 'viem/chains';

  const client = createPublicClient({ chain: sei, transport: http() });
  const gasPrice = await client.getGasPrice();
  ```

  ```ts ethers theme={"dark"}
  import { ethers } from 'ethers';

  const provider = new ethers.JsonRpcProvider('https://evm-rpc.sei-apis.com');
  const feeData = await provider.getFeeData();
  const gasPrice = feeData.gasPrice;
  ```
</CodeGroup>

## EIP-1559 Fee Model

Sei supports EIP-1559 transactions (type 2), but does not burn the base fee. Fees go entirely to validators rather than being partially burned as on Ethereum.

This does not affect how you construct or send transactions — `maxFeePerGas` and `maxPriorityFeePerGas` work as expected. It is relevant only if your application models token supply or displays fee-burn information to users.

<CodeGroup>
  ```ts viem theme={"dark"}
  const fees = await client.estimateFeesPerGas();
  // fees.maxFeePerGas and fees.maxPriorityFeePerGas are usable as-is
  ```

  ```ts ethers theme={"dark"}
  const feeData = await provider.getFeeData();
  // feeData.maxFeePerGas and feeData.maxPriorityFeePerGas are usable as-is
  ```
</CodeGroup>

## SSTORE Cost

The gas cost of `SSTORE` (writing to contract storage) is governance-adjustable on Sei. It is currently **72,000 gas** — the same on mainnet and testnet (see [Divergence from Ethereum](/evm/differences-with-ethereum#sstore-gas-cost)) — but treat that as the current value, not a constant: do not hard-code storage write estimates in your application.

Always use `eth_estimateGas` for any transaction that writes to storage:

<CodeGroup>
  ```ts viem theme={"dark"}
  const gas = await client.estimateGas({
    account,
    to: contractAddress,
    data: encodedCalldata,
  });

  // Add a buffer for governance changes during high-activity periods
  const gasWithBuffer = (gas * 120n) / 100n; // 20% buffer
  ```

  ```ts ethers theme={"dark"}
  const gas = await provider.estimateGas({
    from: signer.address,
    to: contractAddress,
    data: encodedCalldata,
  });
  ```
</CodeGroup>

<Warning>A Foundry `forge test --gas-report --fork-url <sei rpc>` report forks chain *state* but runs revm's standard EVM gas schedule, so it shows `SSTORE` at the Ethereum cost (\~22,100) rather than Sei's \~72,000. Use it for relative profiling of your own logic; estimate the absolute storage-write cost with a live `eth_estimateGas` against a Sei RPC.</Warning>

## Summary

| Behavior         | Ethereum              | Sei                                       |
| ---------------- | --------------------- | ----------------------------------------- |
| Legacy gas floor | Protocol minimum      | Governance-set, can change                |
| Base fee         | Burned                | Paid to validators                        |
| SSTORE cost      | Fixed by EIP          | Governance-adjustable                     |
| `estimateGas`    | Always correct to use | Required — do not hard-code storage costs |
