CCIPTokenPoolConfigKeyLib
Title: CCIPTokenPoolConfigKeyLib
Derives the configuration domains and keys of CCIPTokenPoolConfigTimelock: the four
domain constants, the destination-local key of each domain, and the destination-scoped
key that the timelock reserves and that pendingActionId takes, scoped to the config
policy the timelock is bound to.
A route contributes three domains, keyed per chain selector; the allowlist is one pool-wide domain whose local key is the domain constant itself. Shared by the timelock and the tooling that reads its reservations, so that both compute a key with one formula.
Constants
RATE_LIMITS_DOMAIN
The domain of the rate limits of a route: isEnabled, capacity and rate of
both buckets.
bytes32 internal constant RATE_LIMITS_DOMAIN = keccak256("CCIP_TOKEN_POOL_CONFIG_RATE_LIMITS");
REMOTE_POOLS_DOMAIN
The domain of the accepted remote pools of a route.
bytes32 internal constant REMOTE_POOLS_DOMAIN =
keccak256("CCIP_TOKEN_POOL_CONFIG_REMOTE_POOLS");
ROUTE_IDENTITY_DOMAIN
The domain of the identity of a route: whether the route exists and its remote token.
bytes32 internal constant ROUTE_IDENTITY_DOMAIN =
keccak256("CCIP_TOKEN_POOL_CONFIG_ROUTE_IDENTITY");
ALLOWLIST_DOMAIN
The domain of the pool-wide sender allowlist.
bytes32 internal constant ALLOWLIST_DOMAIN = keccak256("CCIP_TOKEN_POOL_CONFIG_ALLOWLIST");
Functions
routeLocalKey
Returns the destination-local key of a route domain.
function routeLocalKey(
bytes32 domain_,
uint64 chainSelector_
) internal pure returns (bytes32 localKey);
Parameters
| Name | Type | Description |
|---|---|---|
| domain_ | bytes32 | The domain constant. |
| chainSelector_ | uint64 | The chain selector of the route. |
Returns
| Name | Type | Description |
|---|---|---|
| localKey | bytes32 | The key keccak256(abi.encode(domain_, chainSelector_)). |
rateLimitsLocalKey
Returns the destination-local key of the rate limits domain of a route.
function rateLimitsLocalKey(uint64 chainSelector_) internal pure returns (bytes32 localKey);
Parameters
| Name | Type | Description |
|---|---|---|
| chainSelector_ | uint64 | The chain selector of the route. |
Returns
| Name | Type | Description |
|---|---|---|
| localKey | bytes32 | The local key. |
remotePoolsLocalKey
Returns the destination-local key of the remote pools domain of a route.
function remotePoolsLocalKey(uint64 chainSelector_) internal pure returns (bytes32 localKey);
Parameters
| Name | Type | Description |
|---|---|---|
| chainSelector_ | uint64 | The chain selector of the route. |
Returns
| Name | Type | Description |
|---|---|---|
| localKey | bytes32 | The local key. |
routeIdentityLocalKey
Returns the destination-local key of the identity domain of a route.
function routeIdentityLocalKey(uint64 chainSelector_) internal pure returns (bytes32 localKey);
Parameters
| Name | Type | Description |
|---|---|---|
| chainSelector_ | uint64 | The chain selector of the route. |
Returns
| Name | Type | Description |
|---|---|---|
| localKey | bytes32 | The local key. |
allowListLocalKey
Returns the destination-local key of the allowlist domain: the domain constant itself, since the domain has no chain selector.
function allowListLocalKey() internal pure returns (bytes32 localKey);
Returns
| Name | Type | Description |
|---|---|---|
| localKey | bytes32 | The local key. |
rateLimitsKey
Returns the reserved key of the rate limits domain of a route.
function rateLimitsKey(
address config_,
uint64 chainSelector_
) internal pure returns (bytes32 key);
Parameters
| Name | Type | Description |
|---|---|---|
| config_ | address | The config policy the timelock is bound to. |
| chainSelector_ | uint64 | The chain selector of the route. |
Returns
| Name | Type | Description |
|---|---|---|
| key | bytes32 | The destination-scoped key. |
remotePoolsKey
Returns the reserved key of the remote pools domain of a route.
function remotePoolsKey(
address config_,
uint64 chainSelector_
) internal pure returns (bytes32 key);
Parameters
| Name | Type | Description |
|---|---|---|
| config_ | address | The config policy the timelock is bound to. |
| chainSelector_ | uint64 | The chain selector of the route. |
Returns
| Name | Type | Description |
|---|---|---|
| key | bytes32 | The destination-scoped key. |
routeIdentityKey
Returns the reserved key of the identity domain of a route.
function routeIdentityKey(
address config_,
uint64 chainSelector_
) internal pure returns (bytes32 key);
Parameters
| Name | Type | Description |
|---|---|---|
| config_ | address | The config policy the timelock is bound to. |
| chainSelector_ | uint64 | The chain selector of the route. |
Returns
| Name | Type | Description |
|---|---|---|
| key | bytes32 | The destination-scoped key. |
allowListKey
Returns the reserved key of the allowlist domain.
function allowListKey(address config_) internal pure returns (bytes32 key);
Parameters
| Name | Type | Description |
|---|---|---|
| config_ | address | The config policy the timelock is bound to. |
Returns
| Name | Type | Description |
|---|---|---|
| key | bytes32 | The destination-scoped key. |