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.
Errors
TokenNotSupported
error TokenNotSupported(address token);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The unsupported token address |
FeeTokenNotSupported
error FeeTokenNotSupported(address token);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The unsupported fee token address |
StaleGasPrice
error StaleGasPrice(uint64 destChainSelector, uint256 threshold, uint256 timePassed);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | The destination chain selector |
threshold | uint256 | The staleness threshold in seconds |
timePassed | uint256 | The time passed since last update in seconds |
MessageGasLimitTooHigh
error MessageGasLimitTooHigh();
MessageComputeUnitLimitTooHigh
error MessageComputeUnitLimitTooHigh();
DestinationChainNotEnabled
error DestinationChainNotEnabled(uint64 destChainSelector);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | The disabled destination chain selector |
ExtraArgOutOfOrderExecutionMustBeTrue
error ExtraArgOutOfOrderExecutionMustBeTrue();
InvalidExtraArgsTag
error InvalidExtraArgsTag();
InvalidExtraArgsData
error InvalidExtraArgsData();
MessageTooLarge
error MessageTooLarge(uint256 maxSize, uint256 actualSize);
Parameters
| Name | Type | Description |
|---|---|---|
maxSize | uint256 | Maximum allowed message size |
actualSize | uint256 | Actual message size that was too large |
UnsupportedNumberOfTokens
error UnsupportedNumberOfTokens(uint256 numberOfTokens, uint256 maxNumberOfTokensPerMsg);
Parameters
| Name | Type | Description |
|---|---|---|
numberOfTokens | uint256 | Number of tokens in the message |
maxNumberOfTokensPerMsg | uint256 | Maximum allowed number of tokens per message |
MessageFeeTooHigh
error MessageFeeTooHigh(uint256 msgFeeJuels, uint256 maxFeeJuelsPerMsg);
Parameters
| Name | Type | Description |
|---|---|---|
msgFeeJuels | uint256 | Calculated message fee in Juels |
maxFeeJuelsPerMsg | uint256 | Maximum allowed fee in Juels per message |
InvalidTokenReceiver
error InvalidTokenReceiver();
TooManySVMExtraArgsAccounts
error TooManySVMExtraArgsAccounts(uint256 numAccounts, uint256 maxAccounts);
Parameters
| Name | Type | Description |
|---|---|---|
numAccounts | uint256 | Number of accounts provided |
maxAccounts | uint256 | Maximum allowed number of accounts |
InvalidSVMExtraArgsWritableBitmap
error InvalidSVMExtraArgsWritableBitmap(uint64 accountIsWritableBitmap, uint256 numAccounts);
Parameters
| Name | Type | Description |
|---|---|---|
accountIsWritableBitmap | uint64 | The provided writable bitmap |
numAccounts | uint256 | Number of accounts in the extra args |
TooManySuiExtraArgsReceiverObjectIds
error TooManySuiExtraArgsReceiverObjectIds(uint256 numReceiverObjectIds, uint256 maxReceiverObjectIds);
Parameters
| Name | Type | Description |
|---|---|---|
numReceiverObjectIds | uint256 | Number of receiver object IDs provided |
maxReceiverObjectIds | uint256 | Maximum allowed number of receiver object IDs |
InvalidChainFamilySelector
error InvalidChainFamilySelector(bytes4 chainFamilySelector);
Parameters
| Name | Type | Description |
|---|---|---|
chainFamilySelector | bytes4 | The 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
| Name | Type | Description |
|---|---|---|
minFeeUSDCents | uint32 | Minimum fee per token transfer in USD cents (multiples of 0.01 USD) |
maxFeeUSDCents | uint32 | Maximum fee per token transfer in USD cents (multiples of 0.01 USD) |
deciBps | uint16 | Basis points charged on token transfers (multiples of 0.1bps, or 1e-5) |
destGasOverhead | uint32 | Gas charged to execute the token transfer on destination chain |
destBytesOverhead | uint32 | Data availability bytes overhead, must be ā„ CCIP_LOCK_OR_BURN_V1_RET_BYTES |
isEnabled | bool | Whether 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
| Name | Type | Description |
|---|---|---|
isEnabled | bool | Whether this destination chain is enabled |
maxNumberOfTokensPerMsg | uint16 | Maximum number of distinct ERC20 tokens per message |
maxDataBytes | uint32 | Maximum data payload size in bytes |
maxPerMsgGasLimit | uint32 | Maximum gas limit for messages targeting EVMs |
destGasOverhead | uint32 | Gas charged on top of gasLimit to cover destination chain costs |
destGasPerPayloadByteBase | uint8 | Default gas charged per byte of data payload |
destGasPerPayloadByteHigh | uint8 | High gas charged per byte of data payload (for EIP-7623 compliance) |
destGasPerPayloadByteThreshold | uint16 | Threshold at which billing switches from base to high rate |
destDataAvailabilityOverheadGas | uint32 | Data availability gas charged for overhead costs (e.g., OCR) |
destGasPerDataAvailabilityByte | uint16 | Gas units charged per byte needing data availability |
destDataAvailabilityMultiplierBps | uint16 | Multiplier for data availability gas (multiples of bps, or 0.0001) |
chainFamilySelector | bytes4 | Selector identifying the destination chain's family (see Internal) |
enforceOutOfOrder | bool | Whether to enforce allowOutOfOrderExecution extraArg to be true |
defaultTokenFeeUSDCents | uint16 | Default token fee per transfer in USD cents (multiples of 0.01 USD) |
defaultTokenDestGasOverhead | uint32 | Default gas charged for token transfers on destination chain |
defaultTxGasLimit | uint32 | Default gas limit for transactions |
gasMultiplierWeiPerEth | uint64 | Multiplier for gas costs (1e18 based, e.g., 11e17 = 10% extra cost) |
gasPriceStalenessThreshold | uint32 | Time in seconds before gas price is considered stale (0 = disabled) |
networkFeeUSDCents | uint32 | Flat 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
| Name | Type | Description |
|---|---|---|
maxFeeJuelsPerMsg | uint96 | Maximum fee that can be charged for a message in Juels |
linkToken | address | Address of the LINK token contract |
tokenPriceStalenessThreshold | uint32 | Time 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
| Name | Type | Description |
|---|---|---|
fromToken | address | Source token address |
fromTokenAmount | uint256 | Amount in source token |
toToken | address | Target token address |
Returns
| Type | Description |
|---|---|
uint256 | Equivalent amount in target token |
getFeeTokens
Gets the list of supported fee tokens.
function getFeeTokens() external view returns (address[] memory);
Returns
| Type | Description |
|---|---|
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
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | Destination chain selector |
message | Client.EVM2AnyMessage | Message to calculate fee for |
Returns
| Type | Description |
|---|---|
uint256 | Fee 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
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | Destination chain selector |
token | address | Token address |
Returns
| Type | Description |
|---|---|
TokenTransferFeeConfig | Token transfer fee configuration for the token |
getDestChainConfig
Gets the configuration for a destination chain.
function getDestChainConfig(uint64 destChainSelector) external view returns (DestChainConfig memory);
Parameters
| Name | Type | Description |
|---|---|---|
destChainSelector | uint64 | Destination chain selector |
Returns
| Type | Description |
|---|---|
DestChainConfig | Destination chain configuration |
getStaticConfig
Gets the static configuration of the FeeQuoter.
function getStaticConfig() external view returns (StaticConfig memory);
Returns
| Type | Description |
|---|---|
StaticConfig | Static configuration including max fee and LINK token address |