> 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-balance.md).

# cast balance

## 주소의 잔액 조회

특정 주소의 **ETH 잔액을 조회**할 수 있는 명령어이다.\
이더리움 네트워크의 스마트 컨트랙트 또는 지갑 주소가 보유한 잔고를 **wei 단위로 출력**한다.

***

### 명령어 형식

```bash
$ cast balance <주소> --rpc-url <rpc-url>
```

* 주소는 EOAs(외부 지갑) 또는 스마트 컨트랙트 주소 모두 가능
* 반환값은 **wei 단위** (1 ETH = 10^18 wei)

***

### 예시

Sepolia 테스트넷 지갑의 잔액을 확인해보자.

#### 예시 주소 (테스트 지갑)

```
0x6576aEC1ddB7068Bc9aE5Be17C7bC79Fe99A99b9
```

#### 명령어

```bash
$ cast balance 0x6576aEC1ddB7068Bc9aE5Be17C7bC79Fe99A99b9 \
  --rpc-url <rpc url>
```

***

#### 실행 결과 예시

<figure><img src="https://2462457462-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLf9vwRuaws92ULgGvzTi%2Fuploads%2FNs5QPRNwRkym3WHyoQIs%2Fimage%20(10).png?alt=media&amp;token=f456914a-6ae1-4dac-bfda-659b66c7db4c" alt=""><figcaption></figcaption></figure>

* `1000000000000000000` → 1 ETH (10^18 wei)
