> For the complete documentation index, see [llms.txt](https://docs.seismic.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seismic.systems/seismic-solidity/shielded-literals.md).

# Shielded Literals

The `s` suffix lets you write shielded integer constants directly, without explicit casting. The compiler infers the concrete shielded type (`suint8`, `suint256`, `sint128`, etc.) from context.

```solidity
suint256 x = 42s;            // inferred as suint256
suint8 small = 7s;           // inferred as suint8
sint256 neg = -1s;           // inferred as sint256
```

This is equivalent to:

```solidity
suint256 x = suint256(42);
suint8 small = suint8(7);
sint256 neg = sint256(-1);
```

Both forms are valid. The `s` suffix is syntactic sugar — it produces the same bytecode.

## Supported formats

The `s` suffix works with all numeric literal forms:

```solidity
suint256 a = 1_000s;         // underscores
suint256 b = 0xDEADs;        // hex
suint256 c = 1e5s;           // scientific notation
sint256  d = -42s;           // unary minus
```

## Type inference

The shielded type is inferred from the assignment target or surrounding expression:

```solidity
suint8  a = 255s;            // suint8
suint32 b = 1_000s;          // suint32
sint128 c = -1s;             // sint128

suint256 x = 10s;
suint256 y = x + 5s;         // 5s inferred as suint256 from context
```

## Rules

**No mixed arithmetic.** You cannot mix shielded and non-shielded literals in the same expression:

```solidity
suint256 x = 1s + 1;         // Error — mixed shielded/non-shielded
suint256 x = 1s + 1s;        // OK
```

**No implicit conversion to non-shielded types.** A shielded literal cannot be assigned to a regular type:

```solidity
uint256 x = 42s;             // Error — cannot assign shielded to uint256
```

**No `immutable` or `constant`.** Shielded literals follow the same restriction as all shielded types — they cannot be used in `immutable` or `constant` declarations. See [Footguns](https://docs.seismic.systems/seismic-solidity/footguns.md#immutable-and-constant-shielded-variables).

## Compiler warning

All shielded literals emit **warning 9660**. This is intentional — literal values are embedded in the contract bytecode, which is publicly visible. The warning reminds you that the value is leaked at deployment time.

If the literal value is sensitive, do not hardcode it. Introduce it via encrypted calldata instead. See [Footguns](https://docs.seismic.systems/seismic-solidity/footguns.md#literals) for more detail.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.seismic.systems/seismic-solidity/shielded-literals.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
