API Version: v1.6.0 Not using latest version (v1.6.3)

CCIP v1.6.0 FeeQuoter API Reference

FeeQuoter

The FeeQuoter contract stores gas and token prices in USD, manages chain-specific fee calculations, and provides fee estimation for cross-chain messages.

Git Source

Errors

TokenNotSupported

error TokenNotSupported(address token);

Parameters

NameTypeDescription
tokenaddressThe unsupported token address

FeeTokenNotSupported

error FeeTokenNotSupported(address token);

Parameters

NameTypeDescription
tokenaddressThe unsupported fee token address

StaleGasPrice

error StaleGasPrice(uint64 destChainSelector, uint256 threshold, uint256 timePassed);

Parameters

NameTypeDescription
destChainSelectoruint64The destination chain selector
thresholduint256The staleness threshold in seconds
timePasseduint256The time passed since last update in seconds

MessageGasLimitTooHigh

error MessageGasLimitTooHigh();

MessageComputeUnitLimitTooHigh

error MessageComputeUnitLimitTooHigh();

DestinationChainNotEnabled

error DestinationChainNotEnabled(uint64 destChainSelector);

Parameters

NameTypeDescription
destChainSelectoruint64The disabled destination chain selector

ExtraArgOutOfOrderExecutionMustBeTrue

error ExtraArgOutOfOrderExecutionMustBeTrue();

InvalidExtraArgsTag

error InvalidExtraArgsTag();

InvalidExtraArgsData

error InvalidExtraArgsData();

MessageTooLarge

error MessageTooLarge(uint256 maxSize, uint256 actualSize);

Parameters

NameTypeDescription
maxSizeuint256Maximum allowed message size
actualSizeuint256Actual message size that was too large

UnsupportedNumberOfTokens

error UnsupportedNumberOfTokens(uint256 numberOfTokens, uint256 maxNumberOfTokensPerMsg);

Parameters

NameTypeDescription
numberOfTokensuint256Number of tokens in the message
maxNumberOfTokensPerMsguint256Maximum allowed number of tokens per message

MessageFeeTooHigh

error MessageFeeTooHigh(uint256 msgFeeJuels, uint256 maxFeeJuelsPerMsg);

Parameters

NameTypeDescription
msgFeeJuelsuint256Calculated message fee in Juels
maxFeeJuelsPerMsguint256Maximum allowed fee in Juels per message

InvalidTokenReceiver

error InvalidTokenReceiver();

TooManySVMExtraArgsAccounts

error TooManySVMExtraArgsAccounts(uint256 numAccounts, uint256 maxAccounts);

Parameters

NameTypeDescription
numAccountsuint256Number of accounts provided
maxAccountsuint256Maximum allowed number of accounts

InvalidSVMExtraArgsWritableBitmap

error InvalidSVMExtraArgsWritableBitmap(uint64 accountIsWritableBitmap, uint256 numAccounts);

Parameters

NameTypeDescription
accountIsWritableBitmapuint64The provided writable bitmap
numAccountsuint256Number of accounts in the extra args

TooManySuiExtraArgsReceiverObjectIds

error TooManySuiExtraArgsReceiverObjectIds(uint256 numReceiverObjectIds, uint256 maxReceiverObjectIds);

Parameters

NameTypeDescription
numReceiverObjectIdsuint256Number of receiver object IDs provided
maxReceiverObjectIdsuint256Maximum allowed number of receiver object IDs

InvalidChainFamilySelector

error InvalidChainFamilySelector(bytes4 chainFamilySelector);

Parameters

NameTypeDescription
chainFamilySelectorbytes4The invalid chain family selector

Structs

TokenTransferFeeConfig

Structure defining the fee configuration for token transfers.

struct TokenTransferFeeConfig {
  uint32 minFeeUSDCents;
  uint32 maxFeeUSDCents;
  uint16 deciBps;
  uint32 destGasOverhead;
  uint32 destBytesOverhead;
  bool isEnabled;
}

Properties

NameTypeDescription
minFeeUSDCentsuint32Minimum fee to charge per token transfer, multiples of 0.01 USD
maxFeeUSDCentsuint32Maximum fee to charge per token transfer, multiples of 0.01 USD
deciBpsuint16Basis points charged on token transfers, multiples of 0.1bps, or 1e-5
destGasOverheaduint32Gas charged to execute the token transfer on the destination chain
destBytesOverheaduint32Data availability bytes returned from source pool, must be >= Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES
isEnabledboolWhether this token has custom transfer fees

DestChainConfig

Structure containing all configuration for a destination chain.

struct DestChainConfig {
  bool isEnabled;
  uint16 maxNumberOfTokensPerMsg;
  uint32 maxDataBytes;
  uint32 maxPerMsgGasLimit;
  uint32 destGasOverhead;
  uint8 destGasPerPayloadByteBase;
  uint8 destGasPerPayloadByteHigh;
  uint16 destGasPerPayloadByteThreshold;
  uint32 destDataAvailabilityOverheadGas;
  uint16 destGasPerDataAvailabilityByte;
  uint16 destDataAvailabilityMultiplierBps;
  bytes4 chainFamilySelector;
  bool enforceOutOfOrder;
  uint16 defaultTokenFeeUSDCents;
  uint32 defaultTokenDestGasOverhead;
  uint32 defaultTxGasLimit;
  uint64 gasMultiplierWeiPerEth;
  uint32 gasPriceStalenessThreshold;
  uint32 networkFeeUSDCents;
}

Properties

NameTypeDescription
isEnabledboolWhether this destination chain is enabled
maxNumberOfTokensPerMsguint16Maximum number of distinct ERC20 tokens transferred per message
maxDataBytesuint32Maximum data payload size in bytes
maxPerMsgGasLimituint32Maximum gas limit for messages targeting EVMs
destGasOverheaduint32Gas charged on top of the gasLimit to cover destination chain costs
destGasPerPayloadByteBaseuint8Default dest-chain gas charged per byte of data payload
destGasPerPayloadByteHighuint8High dest-chain gas charged per byte of data payload (for EIP-7623)
destGasPerPayloadByteThresholduint16The value at which billing switches from base to high rate
destDataAvailabilityOverheadGasuint32Data availability gas charged for overhead costs (e.g., OCR)
destGasPerDataAvailabilityByteuint16Gas units charged per byte of message data requiring availability
destDataAvailabilityMultiplierBpsuint16Multiplier for data availability gas, multiples of bps (0.0001)
chainFamilySelectorbytes4Selector identifying the destination chain's family (see Internal library)
enforceOutOfOrderboolWhether to enforce allowOutOfOrderExecution extraArg to be true
defaultTokenFeeUSDCentsuint16Default token fee charged per token transfer
defaultTokenDestGasOverheaduint32Default gas charged to execute a token transfer on the destination chain
defaultTxGasLimituint32Default gas limit for a tx
gasMultiplierWeiPerEthuint64Multiplier for gas costs, 1e18 based (e.g., 11e17 = 10% extra cost)
gasPriceStalenessThresholduint32Time in seconds a gas price can be stale before invalid (0 means disabled)
networkFeeUSDCentsuint32Flat network fee to charge for messages, multiples of 0.01 USD

StaticConfig

Structure containing the static configuration of the FeeQuoter contract.

struct StaticConfig {
  uint96 maxFeeJuelsPerMsg;
  address linkToken;
  uint32 tokenPriceStalenessThreshold;
}

Properties

NameTypeDescription
maxFeeJuelsPerMsguint96Maximum fee that can be charged for a message
linkTokenaddressLINK token address
tokenPriceStalenessThresholduint32Time in seconds a token price can be stale before invalid

State Variables

FEE_BASE_DECIMALS

uint256 public constant FEE_BASE_DECIMALS = 36;

typeAndVersion

string public constant typeAndVersion = "FeeQuoter 1.6.0";

Functions

convertTokenAmount

Converts a token amount from the token's decimals to a fee-denominated amount.

function convertTokenAmount(
  address fromToken,
  uint256 fromTokenAmount,
  address toToken
) external view returns (uint256);

Parameters

NameTypeDescription
fromTokenaddressThe token to convert from
fromTokenAmountuint256The amount of fromToken to convert
toTokenaddressThe token to convert to

Returns

TypeDescription
uint256The equivalent amount in toToken

getFeeTokens

Returns the list of tokens that can be used to pay fees.

function getFeeTokens() external view returns (address[] memory);

Returns

TypeDescription
address[]Array of fee token addresses

getValidatedFee

Calculates and validates the fee for a CCIP message.

function getValidatedFee(
  uint64 destChainSelector,
  Client.EVM2AnyMessage calldata message
) external view returns (uint256);

Parameters

NameTypeDescription
destChainSelectoruint64The destination chain selector
messageClient.EVM2AnyMessageThe CCIP message to calculate fee for

Returns

TypeDescription
uint256The total fee in the smallest unit of the fee token

getTokenTransferFeeConfig

Returns the token transfer fee configuration for a specific token and destination chain.

function getTokenTransferFeeConfig(
  uint64 destChainSelector,
  address token
) external view returns (TokenTransferFeeConfig memory);

Parameters

NameTypeDescription
destChainSelectoruint64The destination chain selector
tokenaddressThe token address

Returns

TypeDescription
TokenTransferFeeConfigThe token transfer fee configuration

getDestChainConfig

Returns the destination chain configuration for a given chain selector.

function getDestChainConfig(
  uint64 destChainSelector
) external view returns (DestChainConfig memory);

Parameters

NameTypeDescription
destChainSelectoruint64The destination chain selector

Returns

TypeDescription
DestChainConfigThe destination chain configuration

getStaticConfig

Returns the static configuration of the FeeQuoter contract.

function getStaticConfig() external view returns (StaticConfig memory);

Returns

TypeDescription
StaticConfigThe static configuration

Get the latest Chainlink content straight to your inbox.