> ## 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.

# 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. However, 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. Governance proposals can change this floor, so do not hard-code a specific value.

To read the current minimum, use `eth_gasPrice`:

<CodeGroup>
  ```ts viem theme={null}
  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={null}
  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 it does not burn the base fee. All fees go to validators. On Ethereum, part of the fee is burned.

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

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

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

### Effective gas price on receipts

For dynamic-fee (type 2) transactions, the `effectiveGasPrice` field of the transaction receipt reports the **actual price charged**, not the fee cap. That price is `min(baseFee + maxPriorityFeePerGas, maxFeePerGas)`. This matches standard EIP-1559 semantics. Clients such as ethers and Hardhat therefore see the same `effectiveGasPrice` behavior that they expect from Ethereum.

In practice, when your priority tip plus the base fee stays below `maxFeePerGas`, the receipt reports `baseFee + maxPriorityFeePerGas`, not `maxFeePerGas`. To compute what a transaction paid, use the receipt's `effectiveGasPrice`, not `maxFeePerGas`.

## SSTORE cost

On Sei, governance can adjust the gas cost of `SSTORE` (a write to contract storage). The current cost is **72,000 gas** on both Sei Mainnet and Sei Testnet. For details, see [Differences with Ethereum](/evm/differences-with-ethereum#sstore-gas-cost). Treat this number 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={null}
  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={null}
  const gas = await provider.estimateGas({
    from: signer.address,
    to: contractAddress,
    data: encodedCalldata,
  });
  ```
</CodeGroup>

<Warning>Estimate the absolute storage-write cost with a live `eth_estimateGas` call against a Sei RPC. A Foundry `forge test --gas-report --fork-url <sei rpc>` report forks the chain *state*, but it runs the standard EVM gas schedule of revm. It therefore shows `SSTORE` at the Ethereum cost (approximately 22,100) instead of the Sei cost (approximately 72,000). Use the report for relative profiling of your own logic.</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. |


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