> For the complete documentation index, see [llms.txt](https://docs.rh.fun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rh.fun/for-developers/utils.md).

# Utils

This guide covers commonly used read methods for integration.

## Factory-Level Lookups

### Get Coin Bonding Curve Contract

```solidity
function tokenToBondingCurve(address token) external view returns (address);
```

### Get Coin Collateral Token

```solidity
function tokenToCollateralToken(address token) external view returns (address);
```

* `address(0)` means native collateral.
* Non-zero means ERC20 collateral.

### Check Migration Readiness

```solidity
function readyForMigration(address token) external view returns (bool);
```

For stage boundaries in indexers and backend systems, use `V2Migrated` as the authoritative migration event.

## Bonding Curve Reads

Use the token's bonding curve contract for curve-state reads.

### Estimate Output with Fixed Input

```solidity
function getAmountOutAndFee(
    uint256 _amountIn,
    uint256 _reserveIn,
    uint256 _reserveOut,
    bool _paymentTokenIsIn
) external view returns (uint256 amountOut, uint256 fee);
```

### Estimate Input with Fixed Output

```solidity
function getAmountInAndFee(
    uint256 _amountOut,
    uint256 _reserveIn,
    uint256 _reserveOut,
    bool _paymentTokenIsOut
) external view returns (uint256 amountIn, uint256 fee);
```

### Curve Progress

```solidity
function getCurveProgressBps() external view returns (uint256);
```

### Curve Market Cap

```solidity
function getMarketCap() external view returns (uint256);
```
