> For the complete documentation index, see [llms.txt](https://docs.megaeth.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.megaeth.com/spec/megaevm.md).

# MegaEVM

- [Overview](https://docs.megaeth.com/spec/megaevm/overview.md): MegaEVM specification index — dual gas model, resource limits, gas detention, system contracts, and per-spec behavioral history.
- [Dual Gas Model](https://docs.megaeth.com/spec/megaevm/dual-gas-model.md): MegaETH dual gas model specification — compute gas, storage gas, SALT bucket multiplier, and per-operation storage gas schedule.
- [Resource Limits](https://docs.megaeth.com/spec/megaevm/resource-limits.md): MegaETH per-transaction and per-block resource limits — compute gas, data size, KV updates, and state growth ceilings with enforcement semantics.
- [Resource Accounting](https://docs.megaeth.com/spec/megaevm/resource-accounting.md): MegaETH resource accounting specification — counter semantics, revert behavior, and per-opcode metering for compute gas, data size, KV updates, and state growth.
- [Gas Detention](https://docs.megaeth.com/spec/megaevm/gas-detention.md): MegaETH gas detention specification — compute gas caps triggered by volatile data access (block environment, oracle SLOAD).
- [Gas Forwarding](https://docs.megaeth.com/spec/megaevm/gas-forwarding.md): MegaETH 98/100 gas forwarding rule — CALL, DELEGATECALL, STATICCALL, CALLCODE, and CREATE/CREATE2 forwarding semantics.
- [Contract Limits](https://docs.megaeth.com/spec/megaevm/contract-limits.md): MegaETH contract size limits — 512 KB max bytecode, 536 KB max initcode, inherited from MiniRex.
- [Precompiles](https://docs.megaeth.com/spec/megaevm/precompiles.md): MegaETH precompile gas overrides — KZG Point Evaluation and ModExp cost schedules diverging from standard Ethereum.
- [SELFDESTRUCT](https://docs.megaeth.com/spec/megaevm/selfdestruct.md): SELFDESTRUCT opcode on MegaETH — EIP-6780 semantics, same-transaction destruction, beneficiary account metering, and spec history from MiniRex to Rex5.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.megaeth.com/spec/megaevm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
