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

CCIP v1.5.1 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

StaleKeystoneUpdate

error StaleKeystoneUpdate(address token, uint256 feedTimestamp, uint256 storedTimeStamp);

Parameters

NameTypeDescription
tokenaddressThe token address
feedTimestampuint256The timestamp from the feed update
storedTimeStampuint256The currently stored timestamp

DataFeedValueOutOfUint224Range

error DataFeedValueOutOfUint224Range();

InvalidDestBytesOverhead

error InvalidDestBytesOverhead(address token, uint32 destBytesOverhead);

Parameters

NameTypeDescription
tokenaddressThe token address
destBytesOverheaduint32The invalid destination bytes overhead

MessageGasLimitTooHigh

error MessageGasLimitTooHigh();

DestinationChainNotEnabled

error DestinationChainNotEnabled(uint64 destChainSelector);

Parameters

NameTypeDescription
destChainSelectoruint64The disabled destination chain selector

ExtraArgOutOfOrderExecutionMustBeTrue

error ExtraArgOutOfOrderExecutionMustBeTrue();

InvalidExtraArgsTag

error InvalidExtraArgsTag();

SourceTokenDataTooLarge

error SourceTokenDataTooLarge(address token);

Parameters

NameTypeDescription
tokenaddressThe token with oversized source data

InvalidDestChainConfig

error InvalidDestChainConfig(uint64 destChainSelector);

Parameters

NameTypeDescription
destChainSelectoruint64The destination chain selector with invalid config

MessageFeeTooHigh

error MessageFeeTooHigh(uint256 msgFeeJuels, uint256 maxFeeJuelsPerMsg);

Parameters

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

InvalidStaticConfig

error InvalidStaticConfig();

MessageTooLarge

error MessageTooLarge(uint256 maxSize, uint256 actualSize);

Parameters

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

UnsupportedNumberOfTokens

error UnsupportedNumberOfTokens();

Events

FeeTokenAdded

event FeeTokenAdded(address indexed feeToken);

Parameters

NameTypeDescription
feeTokenaddressThe fee token that was added

FeeTokenRemoved

event FeeTokenRemoved(address indexed feeToken);

Parameters

NameTypeDescription
feeTokenaddressThe fee token that was removed

UsdPerUnitGasUpdated

event UsdPerUnitGasUpdated(uint64 indexed destChain, uint256 value, uint256 timestamp);

Parameters

NameTypeDescription
destChainuint64The destination chain selector
valueuint256The new gas price in USD (18 decimals)
timestampuint256The timestamp of the update

UsdPerTokenUpdated

event UsdPerTokenUpdated(address indexed token, uint256 value, uint256 timestamp);

Parameters

NameTypeDescription
tokenaddressThe token address
valueuint256The new token price in USD (18 decimals)
timestampuint256The timestamp of the update

PriceFeedPerTokenUpdated

event PriceFeedPerTokenUpdated(address indexed token, TokenPriceFeedConfig priceFeedConfig);

Parameters

NameTypeDescription
tokenaddressThe token address
priceFeedConfigTokenPriceFeedConfigThe new price feed configuration

TokenTransferFeeConfigUpdated

event TokenTransferFeeConfigUpdated(
  uint64 indexed destChainSelector,
  address indexed token,
  TokenTransferFeeConfig tokenTransferFeeConfig
);

Parameters

NameTypeDescription
destChainSelectoruint64The destination chain selector
tokenaddressThe token address
tokenTransferFeeConfigTokenTransferFeeConfigThe new token transfer fee configuration

TokenTransferFeeConfigDeleted

event TokenTransferFeeConfigDeleted(uint64 indexed destChainSelector, address indexed token);

Parameters

NameTypeDescription
destChainSelectoruint64The destination chain selector
tokenaddressThe token address

PremiumMultiplierWeiPerEthUpdated

event PremiumMultiplierWeiPerEthUpdated(address indexed token, uint64 premiumMultiplierWeiPerEth);

Parameters

NameTypeDescription
tokenaddressThe token address
premiumMultiplierWeiPerEthuint64The new premium multiplier (wei per ETH)

DestChainConfigUpdated

event DestChainConfigUpdated(uint64 indexed destChainSelector, DestChainConfig destChainConfig);

Parameters

NameTypeDescription
destChainSelectoruint64The destination chain selector
destChainConfigDestChainConfigThe new destination chain configuration

DestChainAdded

event DestChainAdded(uint64 indexed destChainSelector, DestChainConfig destChainConfig);

Parameters

NameTypeDescription
destChainSelectoruint64The destination chain selector
destChainConfigDestChainConfigThe destination chain configuration

Structs

TokenPriceFeedConfig

Token price data feed configuration.

struct TokenPriceFeedConfig {
  address dataFeedAddress;
  uint8 tokenDecimals;
}

Properties

NameTypeDescription
dataFeedAddressaddressAggregatorV3Interface contract address (0 if feed is unset)
tokenDecimalsuint8Decimals of the token that the feed represents

TokenPriceFeedUpdate

Token price data feed update.

struct TokenPriceFeedUpdate {
  address sourceToken;
  TokenPriceFeedConfig feedConfig;
}

Properties

NameTypeDescription
sourceTokenaddressSource token to update feed for
feedConfigTokenPriceFeedConfigFeed config update data

StaticConfig

Struct that contains the static configuration.

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

Properties

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

ReceivedCCIPFeedReport

The struct representing the received CCIP feed report from Keystone IReceiver.onReport().

struct ReceivedCCIPFeedReport {
  address token;
  uint224 price;
  uint32 timestamp;
}

Properties

NameTypeDescription
tokenaddressToken address
priceuint224Price of the token in USD with 18 decimals
timestampuint32Timestamp of the price update

DestChainConfig

Struct to hold the fee & validation configs for a destination chain.

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

Properties

NameTypeDescription
isEnabledboolWhether this destination chain is enabled
maxNumberOfTokensPerMsguint16Maximum number of distinct ERC20 tokens transferred per message
maxDataBytesuint32Maximum payload data size in bytes
maxPerMsgGasLimituint32Maximum gas limit for messages targeting EVMs
destGasOverheaduint32Gas charged on top of gasLimit to cover destination chain costs
destGasPerPayloadByteuint16Destination chain gas charged for passing each byte of data payload to receiver
destDataAvailabilityOverheadGasuint32Extra data availability gas charged on top of the message, e.g. for OCR
destGasPerDataAvailabilityByteuint16Amount of gas to charge per byte of message data that needs availability
destDataAvailabilityMultiplierBpsuint16Multiplier for data availability gas, multiples of bps, or 0.0001
defaultTokenFeeUSDCentsuint16Default token fee charged per token transfer (overridable per token)
defaultTokenDestGasOverheaduint32Default gas charged to execute token transfer on destination chain (overridable)
defaultTxGasLimituint32Default gas limit for a transaction
gasMultiplierWeiPerEthuint64Multiplier for gas costs, 1e18 based (e.g., 11e17 = 10% extra cost)
networkFeeUSDCentsuint32Flat network fee to charge for messages, multiples of 0.01 USD
gasPriceStalenessThresholduint32Time (seconds) a gas price can be stale before invalid (0 means disabled)
enforceOutOfOrderboolWhether to enforce the allowOutOfOrderExecution extraArg value to be true
chainFamilySelectorbytes4Selector identifying the destination chain's family (determines validations)

DestChainConfigArgs

Struct to hold the configs and its destination chain selector.

struct DestChainConfigArgs {
  uint64 destChainSelector;
  DestChainConfig destChainConfig;
}

Properties

NameTypeDescription
destChainSelectoruint64Destination chain selector
destChainConfigDestChainConfigConfig to update for the chain selector

TokenTransferFeeConfig

Struct to hold the transfer 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
destBytesOverheaduint32Extra data availability bytes from source pool sent to destination pool. Must be >= Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES
isEnabledboolWhether this token has custom transfer fees

TokenTransferFeeConfigSingleTokenArgs

Struct to hold the token transfer fee configurations for a token.

struct TokenTransferFeeConfigSingleTokenArgs {
  address token;
  TokenTransferFeeConfig tokenTransferFeeConfig;
}

Properties

NameTypeDescription
tokenaddressToken address
tokenTransferFeeConfigTokenTransferFeeConfigTransfer fee configuration for token

TokenTransferFeeConfigArgs

Struct to hold the token transfer fee configurations for a destination chain and a set of tokens.

struct TokenTransferFeeConfigArgs {
  uint64 destChainSelector;
  TokenTransferFeeConfigSingleTokenArgs[] tokenTransferFeeConfigs;
}

Properties

NameTypeDescription
destChainSelectoruint64Destination chain selector
tokenTransferFeeConfigsTokenTransferFeeConfigSingleTokenArgs[]Array of token transfer fee configurations

TokenTransferFeeConfigRemoveArgs

Struct to hold a pair of destination chain selector and token address.

struct TokenTransferFeeConfigRemoveArgs {
  uint64 destChainSelector;
  address token;
}

Properties

NameTypeDescription
destChainSelectoruint64Destination chain selector
tokenaddressToken address

PremiumMultiplierWeiPerEthArgs

Struct to hold the fee token configuration for a token.

struct PremiumMultiplierWeiPerEthArgs {
  address token;
  uint64 premiumMultiplierWeiPerEth;
}

Properties

NameTypeDescription
tokenaddressToken address
premiumMultiplierWeiPerEthuint64Multiplier for destination chain specific premiums

State Variables

FEE_BASE_DECIMALS

uint256 public constant FEE_BASE_DECIMALS = 36;

KEYSTONE_PRICE_DECIMALS

uint256 public constant KEYSTONE_PRICE_DECIMALS = 18;

typeAndVersion

string public constant override typeAndVersion = "FeeQuoter 1.6.0-dev";

Get the latest Chainlink content straight to your inbox.