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

# cast tx

## 트랙잭션 정보 조회

특정 트랜잭션의 상세 정보를 조회하는 명령어이다.\
트랜잭션 해시를 입력하면 누가 누구에게 어떤 데이터를 보냈는지 등을 확인할 수 있다.

***

### 명령어 형식

```bash
$ cast tx <트랜잭션 해시> --rpc-url <rpc-url>
```

***

### 출력 정보

다음과 같은 주요 정보가 출력된다:

* **From**: 보내는 주소
* **To**: 받는 주소
* **Value**: 전송된 이더의 양 (wei 단위)
* **Gas Price**: 가스 가격
* **Gas Limit**: 가스 한도
* **Block Number**: 포함된 블록 번호
* **Input Data**: 트랜잭션에 입력된 ABI 인코딩된 함수 호출 정보

***

### 예시

이전에 `cast send`를 사용해 실행한 트랜잭션의 정보를 조회해보자.

```bash
$ cast tx 0xb0a13fc098cdd971e9442aa5880afc59faec57d9ea281471c6fd2956becb1022 \
  --rpc-url <rpc url>
```

#### 결과 예시

* 트랜잭션의 메타데이터와 입력 데이터가 상세하게 출력된다.

<figure><img src="https://2462457462-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLf9vwRuaws92ULgGvzTi%2Fuploads%2FaARbjGgB9tIybXpO2oYX%2Fimage%20(11).png?alt=media&amp;token=8ed4e505-301e-4d05-bde0-54bd58532710" alt=""><figcaption></figcaption></figure>
