# Careful Vetting of Unchecked Blocks

In Solidity 0.8.x, unchecked math operations are permitted within `unchecked` blocks, offering an opportunity for gas optimization in smart contracts. However, this feature also introduces risks of potential overflows and underflows, which can lead to significant vulnerabilities and unintended consequences. Consequently, the best practice is to prioritize safe math operations by default, resorting to `unchecked` blocks only when clear optimizations can be achieved.

It is essential to meticulously vet and review these `unchecked` sections to ensure they do not compromise the safety and reliability of the contract. By adhering to this philosophy, developers can strike a balance between gas efficiency and robust security.


---

# Agent Instructions: 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://docs.optimumsec.xyz/coding/careful-vetting-of-unchecked-blocks.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.
