API Version: v1.6.3

CCIP v1.6.3 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 representing the token transfer fee configuration for a specific token on a destination chain.

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

Properties

NameTypeDescription
minFeeUSDCentsuint32Minimum fee per token transfer in USD cents (multiples of 0.01 USD)
maxFeeUSDCentsuint32Maximum fee per token transfer in USD cents (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 destination chain
destBytesOverheaduint32Data availability bytes overhead, must be ≄ CCIP_LOCK_OR_BURN_V1_RET_BYTES
isEnabledboolWhether this token has custom transfer fees

DestChainConfig

Structure containing fee and validation 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 per message
maxDataBytesuint32Maximum data payload size in bytes
maxPerMsgGasLimituint32Maximum gas limit for messages targeting EVMs
destGasOverheaduint32Gas charged on top of gasLimit to cover destination chain costs
destGasPerPayloadByteBaseuint8Default gas charged per byte of data payload
destGasPerPayloadByteHighuint8High gas charged per byte of data payload (for EIP-7623 compliance)
destGasPerPayloadByteThresholduint16Threshold at which billing switches from base to high rate
destDataAvailabilityOverheadGasuint32Data availability gas charged for overhead costs (e.g., OCR)
destGasPerDataAvailabilityByteuint16Gas units charged per byte needing data availability
destDataAvailabilityMultiplierBpsuint16Multiplier for data availability gas (multiples of bps, or 0.0001)
chainFamilySelectorbytes4Selector identifying the destination chain's family (see Internal)
enforceOutOfOrderboolWhether to enforce allowOutOfOrderExecution extraArg to be true
defaultTokenFeeUSDCentsuint16Default token fee per transfer in USD cents (multiples of 0.01 USD)
defaultTokenDestGasOverheaduint32Default gas charged for token transfers on destination chain
defaultTxGasLimituint32Default gas limit for transactions
gasMultiplierWeiPerEthuint64Multiplier for gas costs (1e18 based, e.g., 11e17 = 10% extra cost)
gasPriceStalenessThresholduint32Time in seconds before gas price is considered stale (0 = disabled)
networkFeeUSDCentsuint32Flat network fee for messages in USD cents (multiples of 0.01 USD)

StaticConfig

Structure containing immutable FeeQuoter configuration set at deployment.

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

Properties

NameTypeDescription
maxFeeJuelsPerMsguint96Maximum fee that can be charged for a message in Juels
linkTokenaddressAddress of the LINK token contract
tokenPriceStalenessThresholduint32Time in seconds before a token price is considered stale

State Variables

FEE_BASE_DECIMALS

uint256 public constant FEE_BASE_DECIMALS = 36;

typeAndVersion

string public constant typeAndVersion = "FeeQuoter 1.6.3";

Functions

convertTokenAmount

Converts a token amount from one token to another using current prices.

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

Parameters

NameTypeDescription
fromTokenaddressSource token address
fromTokenAmountuint256Amount in source token
toTokenaddressTarget token address

Returns

TypeDescription
uint256Equivalent amount in target token

getFeeTokens

Gets the list of supported fee tokens.

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

Returns

TypeDescription
address[]Array of supported fee token addresses

getValidatedFee

Calculates the validated fee for sending a cross-chain message.

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

Parameters

NameTypeDescription
destChainSelectoruint64Destination chain selector
messageClient.EVM2AnyMessageMessage to calculate fee for

Returns

TypeDescription
uint256Fee amount in the message's fee token denomination

getTokenTransferFeeConfig

Gets 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
destChainSelectoruint64Destination chain selector
tokenaddressToken address

Returns

TypeDescription
TokenTransferFeeConfigToken transfer fee configuration for the token

getDestChainConfig

Gets the configuration for a destination chain.

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

Parameters

NameTypeDescription
destChainSelectoruint64Destination chain selector

Returns

TypeDescription
DestChainConfigDestination chain configuration

getStaticConfig

Gets the static configuration of the FeeQuoter.

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

Returns

TypeDescription
StaticConfigStatic configuration including max fee and LINK token address

Get the latest Chainlink content straight to your inbox.