# CCIP v1.5.0 Pool Library API Reference
Source: https://docs.chain.link/ccip/api-reference/evm/v1.5.0/pool

> For the complete documentation index, see [llms.txt](/llms.txt).

<Aside type="note" title="Integrate Chainlink CCIP v1.5.0 into your project">
  <Tabs sharedStore="ccip-v1-5-0-package" client:visible>
    <Fragment slot="tab.1">npm</Fragment>
    <Fragment slot="tab.2">yarn</Fragment>
    <Fragment slot="tab.3">foundry</Fragment>

    <Fragment slot="panel.1">
      If you use [NPM](https://www.npmjs.com/), install the [@chainlink/contracts-ccip NPM package](https://www.npmjs.com/package/@chainlink/contracts-ccip):

      ```shell
      npm install @chainlink/contracts-ccip@1.5.0
      ```
    </Fragment>

    <Fragment slot="panel.2">
      If you use [Yarn](https://yarnpkg.com/), install the [@chainlink/contracts-ccip NPM package](https://www.npmjs.com/package/@chainlink/contracts-ccip):

      ```shell
      yarn add @chainlink/contracts-ccip@1.5.0
      ```
    </Fragment>

    <Fragment slot="panel.3">
      If you use [Foundry](https://book.getfoundry.sh/), install the package:

      ```shell
      forge install smartcontractkit/ccip@5c711214167b7e6f05cf6de74bdab9f6e26763b2
      ```
    </Fragment>
  </Tabs>
</Aside>

The [`Pool`](https://github.com/smartcontractkit/ccip/tree/release/contracts-ccip-1.5.0/contracts/src/v0.8/ccip/libraries/Pool.sol) library provides various token pool functions to construct return data for cross-chain operations in Chainlink's CCIP.

```solidity
import { Pool } from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Pool.sol";
```

## Types and Constants

### CCIP\_POOL\_V1

The tag used to signal support for the Pool v1 standard.

```solidity
bytes4 CCIP_POOL_V1
```

### CCIP\_POOL\_V1\_RET\_BYTES

The number of bytes in the return data for a pool v1 `releaseOrMint` call.

```solidity
uint16 CCIP_POOL_V1_RET_BYTES
```

### CCIP\_LOCK\_OR\_BURN\_V1\_RET\_BYTES

The default maximum number of bytes in the return data for a pool v1 `lockOrBurn` call.

```solidity
uint32 CCIP_LOCK_OR_BURN_V1_RET_BYTES
```

## Structs

### LockOrBurnInV1

This struct is used when locking or burning tokens for cross-chain operations.

```solidity
struct LockOrBurnInV1 {
  bytes receiver;
  uint64 remoteChainSelector;
  address originalSender;
  uint256 amount;
  address localToken;
}
```

| Name                | Type    | Description                                                                       |
| ------------------- | ------- | --------------------------------------------------------------------------------- |
| receiver            | bytes   | The recipient of the tokens on the destination chain, ABI encoded.                |
| remoteChainSelector | uint64  | The chain ID of the destination chain.                                            |
| originalSender      | address | The original sender of the transaction on the source chain.                       |
| amount              | uint256 | The amount of tokens to lock or burn, denominated in the source token's decimals. |
| localToken          | address | The address of the token on this chain to lock or burn.                           |

### LockOrBurnOutV1

This struct represents the output data from a lockOrBurn call.

```solidity
struct LockOrBurnOutV1 {
  bytes destTokenAddress;
  bytes destPoolData;
}
```

| Name             | Type  | Description                                                                                                           |
| ---------------- | ----- | --------------------------------------------------------------------------------------------------------------------- |
| destTokenAddress | bytes | The address of the destination token, ABI encoded. This value is untrusted as any pool owner can modify it.           |
| destPoolData     | bytes | Optional pool data to be transferred to the destination chain, capped by default at `CCIP_LOCK_OR_BURN_V1_RET_BYTES`. |

### ReleaseOrMintInV1

This struct is used to release or mint tokens on the destination chain.

```solidity
struct ReleaseOrMintInV1 {
  bytes originalSender;
  uint64 remoteChainSelector;
  address receiver;
  uint256 amount;
  address localToken;
  bytes sourcePoolAddress;
  bytes sourcePoolData;
  bytes offchainTokenData;
}
```

| Name                | Type    | Description                                                                                       |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------- |
| originalSender      | bytes   | The original sender of the transaction on the source chain.                                       |
| remoteChainSelector | uint64  | The chain ID of the source chain.                                                                 |
| receiver            | address | The recipient of the tokens on the destination chain.                                             |
| amount              | uint256 | The amount of tokens to release or mint, denominated in the source token's decimals.              |
| localToken          | address | The address of the token on this chain to release or mint.                                        |
| sourcePoolAddress   | bytes   | The address of the source pool, ABI encoded. This value must be verified before processing funds. |
| sourcePoolData      | bytes   | Data received from the source pool to process the release or mint.                                |
| offchainTokenData   | bytes   | Untrusted offchain data to process the release or mint.                                           |

> **NOTE**
>
> - The `sourcePoolAddress` field in `ReleaseOrMintInV1` should be verified before any processing occurs to ensure that it matches the expected pool address for the given `remoteChainSelector`. <br />

- The `offchainTokenData` field is considered untrusted data and should be handled accordingly. <br />

- Fields like `destTokenAddress` and `sourcePoolAddress` may contain ABI encoded data for EVM chains.

### ReleaseOrMintOutV1

This struct represents the output data from a `releaseOrMint` call.

```solidity
struct ReleaseOrMintOutV1 {
  uint256 destinationAmount;
}
```

| Name              | Type    | Description                                                                                                                                      |
| ----------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| destinationAmount | uint256 | The number of tokens released or minted on the destination chain, denominated in the local token's decimals. Expected to match the input amount. |