> 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/address.md).

# address

### **특징**

| 항목        | 내용                 |
| --------- | ------------------ |
| **타입명**   | address            |
| **크기**    | 20바이트              |
| **패킹 가능** | O (32바이트 이내 여유 있음) |
| **기본 저장** | 필요시 packing 최적화됨   |

***

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

contract Example2 {
    uint8 public a;
    address public b;
    bool public c;

    constructor() {
      a = 1;
      b = msg.sender;
      c = true;
    }
}
```

<figure><img src="https://2462457462-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLf9vwRuaws92ULgGvzTi%2Fuploads%2FBoJSCPMd237mTXnz8MKb%2Fimage.png?alt=media&amp;token=b3b41234-ae9b-4997-822e-1b2a03d7030d" alt=""><figcaption></figcaption></figure>

```
// 스토리지

address: 0x0000000000000000000000000000000000000000000000000000000000000000
0x00000000000000000000015a933567a53548b7dcb37df4af2d4b6816a476e402
```

슬롯 0에 uint8, address, bool 값이 packing되었다.

* a = 0x02
* b = 0x5a933567a53548b7dcb37df4af2d4b6816a476e40
* c = 0x01

a(1 byte) + b(20 bytes) + c(1 bytes)으로 총 22바이트가 하위 바이트부터 차례대로 슬롯 하나에 저장되었다. 특히 address는 크기가 20바이트로 슬롯 하나의 크기보다 작기 때문에, 필요 시 다른 작은 변수들과 함께 하나의 슬롯에 패킹될 수 있다.
