> For the complete documentation index, see [llms.txt](https://agrawain.gitbook.io/roadmap-hacking-smart-contract/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agrawain.gitbook.io/roadmap-hacking-smart-contract/yul.md).

# YUL

Yul es un lenguaje intermedio diseñado específicamente para el ecosistema de Ethereum, utilizado para crear contratos inteligentes altamente optimizados. Sirve como un puente entre lenguajes de alto nivel como Solidity y el lenguaje de máquina de la Ethereum Virtual Machine (EVM). Al ser más cercano al nivel del hardware, Yul permite a los desarrolladores escribir código que maximiza la eficiencia del contrato en términos de consumo de gas y rendimiento.

#### Principales características:

* **Optimización avanzada:** Permite escribir código optimizado utilizando operaciones de bajo nivel y estructuras más simples que las ofrecidas por Solidity.
* **Compatibilidad con múltiples plataformas:** Soporta tanto la EVM como eWASM, haciéndolo versátil para diferentes entornos de ejecución en blockchain.
* **Integración con Solidity:** Yul puede integrarse con contratos Solidity a través de Inline Assembly, lo que facilita el uso de secciones optimizadas dentro de un contrato más complejo.
* **Control preciso:** Ofrece un control granular sobre la memoria, el almacenamiento y el costo de gas mediante el uso de *Opcodes* y *precompiles*.

{% stepper %}
{% step %}

### Assembly

<https://docs.soliditylang.org/en/latest/assembly.html>
{% endstep %}

{% step %}

### Opcodes

<https://www.evm.codes/>
{% endstep %}

{% step %}

### Precompiles

<https://www.evm.codes/precompiled>
{% endstep %}

{% step %}

### Dynamic Gas Costs and Memory Expansion

<https://github.com/wolflo/evm-opcodes/blob/main/gas.md>
{% endstep %}
{% endstepper %}


---

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

```
GET https://agrawain.gitbook.io/roadmap-hacking-smart-contract/yul.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
