CCIP v2.0.0 TokenPoolFactory API Reference

Summary

TokenPoolFactory deploys new [TokenPool](/ccip/evm/api-reference/v2.0.0/token-pool) contracts and registers them with [TokenAdminRegistry](/ccip/evm/api-reference/v2.0.0/token-admin-registry).

It standardizes pool provisioning and ensures that deployed pools are correctly registered for their corresponding tokens.


Contract

chains/evm/contracts/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.sol


Import

import {TokenPoolFactory} from "chainlink-ccip/chains/evm/contracts/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.sol";

Inheritance

  • Ownable2StepMsgSender
  • ITypeAndVersion

typeAndVersion

string public constant override typeAndVersion =
  "TokenPoolFactory 1.5.0";

Constructor

constructor(ITokenAdminRegistry tokenAdminRegistry)

Reverts:

error ZeroAddress();

If:

address(tokenAdminRegistry) == address(0)

Initializes:

i_tokenAdminRegistry = tokenAdminRegistry;

Deployment API

createTokenPool

function createTokenPool(
  address token,
  address administrator,
  bytes calldata constructorArgs
) external onlyOwner returns (address pool)

Behavior:

  1. Validates token != address(0).
  2. Deploys a new pool contract using the provided constructorArgs.
  3. Registers the deployed pool with:
i_tokenAdminRegistry.setPool(token, pool);
  1. Emits:
event TokenPoolDeployed(
  address indexed token,
  address indexed pool,
  address indexed administrator
);

Returns the deployed pool address.

Note: The factory delegates constructor argument encoding responsibility to the caller via constructorArgs.


getRegistry

function getRegistry() external view returns (address)

Returns:

address(i_tokenAdminRegistry);

Events

event TokenPoolDeployed(
  address indexed token,
  address indexed pool,
  address indexed administrator
);

Errors

error ZeroAddress();

No additional custom errors are declared in this contract.


Security model

  • Only the contract owner may deploy pools.
  • The registry address is immutable.
  • Registration occurs immediately after deployment.
  • If deployment fails, the transaction reverts atomically.
  • The factory itself does not enforce pool-type validation — constructor argument correctness is the caller’s responsibility.

Get the latest Chainlink content straight to your inbox.