> 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/6.-foundry/cast/cast-storage.md).

# cast storage

## 스마트 컨트랙트 상태 변수 값 확인

cast storage는 **스마트 컨트랙트의 상태 변수 값을 직접 확인**할 때 사용하는 명령어입니다.\
이 명령은 특정 슬롯 번호(storage slot)에 어떤 값이 저장되어 있는지를 보여줍니다.

* 상태를 **변경하지 않고 조회만 하므로  send call 과 마찬가지로 트랜잭션이 발생하지 않음**
* 따라서 **가스비도 소모되지 않고** **개인키도 필요 없음**
* 컨트랙트의 **내부 저장 상태를 디버깅하거나 분석할 때** 유용함

***

### 명령어 형식

```bash
$ cast storage <컨트랙트 주소> <슬롯 번호> \
  --rpc-url <rpc-url>
```
