> For the complete documentation index, see [llms.txt](https://whs3-doge5k.gitbook.io/smartcontract-security-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whs3-doge5k.gitbook.io/smartcontract-security-docs/basics/3.-evm/evm-2/undefined/uint256-int256-bytes32.md).

# uint256, int256, bytes32

### **특징**

| 항목        | 내용               |
| --------- | ---------------- |
| **타입명**   | uint256          |
| **크기**    | 32바이트 (256비트)    |
| **패킹 가능** | X (슬롯 하나 전부 사용함) |
| **기본 저장** | 항상 단독 슬롯 사용      |

***

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Example1 {
    uint256 public a;
    int256 public b;
    bytes32 public c;

    constructor() {
      a = 1;
      b = 2;
      c = bytes32(uint256(0x32));
    }
}
```

<figure><img src="https://2462457462-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLf9vwRuaws92ULgGvzTi%2Fuploads%2FMS4usUzeJ6lEVk34mTUw%2Fimage.png?alt=media&amp;token=fcf597c2-f209-4fd8-9f79-ebd70bdaadab" alt=""><figcaption></figcaption></figure>

```
// 스토리지

address: 0x0000000000000000000000000000000000000000000000000000000000000000
0x0000000000000000000000000000000000000000000000000000000000000001

address: 0x0000000000000000000000000000000000000000000000000000000000000001
0x0000000000000000000000000000000000000000000000000000000000000002

address: 0x0000000000000000000000000000000000000000000000000000000000000002
0x0000000000000000000000000000000000000000000000000000000000000032
```

슬롯 0, 1, 2에 각각 uint256, int256, bytes32 값이 선언 순서에 따라 하위 바이트부터 저장되었다. 기본 32바이트 변수는 32바이트 슬롯 전체를 할당받기 때문에 각각의 슬롯이 독립적으로 나타난다.
