Skip to main content

CCIPTokenPoolConfigProposalChecker

Git Source

Inherits: ICCIPTokenPoolConfigProposalChecker

Title: CCIPTokenPoolConfigProposalChecker

Read-only checker of the preconditions of the CCIP bridge activation proposal (CCIPTokenPoolConfigProposal), called as the first action of that proposal. It is bound at construction to the Kernel, the config policy, the config timelock, the lock/release pool, OHM, the TokenAdminRegistry, the ROLES module, the OCG timelock and the DAO MS of one chain, and holds no state beyond those bindings.

The constructor rejects a zero address and a set of contracts that are not bound to each other the way the proposal requires. check reads the live state only; a call into it from the OCG timelock returns normally when every expectation holds and reverts with the named error of the first one that does not, which reverts the whole execution before any handover action runs and leaves the proposal queued.

Constants​

KERNEL​

The Kernel both policies are active in.

Kernel public immutable KERNEL;

CONFIG​

The config policy that owns the pool after the handover.

ICCIPTokenPoolConfig public immutable CONFIG;

CONFIG_TIMELOCK​

The config timelock that is the config operator after the handover.

ICCIPTokenPoolConfigTimelock public immutable CONFIG_TIMELOCK;

POOL​

The lock/release pool of OHM.

ICCIPTokenPoolAdmin public immutable POOL;

OHM​

The OHM token.

IERC20 public immutable OHM;

REGISTRY​

The Chainlink TokenAdminRegistry of the chain.

ICCIPTokenAdminRegistry public immutable REGISTRY;

ROLES​

The ROLES module of the Kernel.

ROLESv1 public immutable ROLES;

OCG_TIMELOCK​

The OCG timelock: the OHM administrator after the handover and the holder of admin.

address public immutable OCG_TIMELOCK;

DAO_MS​

The DAO MS: the pool owner before the handover and the holder of bridge_admin after it.

address public immutable DAO_MS;

Functions​

constructor​

Binds the checker to the contracts of one chain.

Reverts if:

  • Any argument is the zero address (CCIPTokenPoolConfigProposalChecker_ZeroAddress).
  • config_ does not report pool_ as its pool, configTimelock_ does not report config_ as its config, either policy does not report kernel_ as its Kernel, kernel_ does not report roles_ as its ROLES module, or pool_ does not report ohm_ as its token (CCIPTokenPoolConfigProposalChecker_BindingMismatch).
  • config_ reports that pool_ is not a liquidity container (CCIPTokenPoolConfigProposalChecker_NotLiquidityContainer).
constructor(
address kernel_,
address config_,
address configTimelock_,
address pool_,
address ohm_,
address registry_,
address roles_,
address ocgTimelock_,
address daoMS_
);

Parameters

NameTypeDescription
kernel_addressThe Kernel.
config_addressThe config policy.
configTimelock_addressThe config timelock.
pool_addressThe lock/release pool.
ohm_addressThe OHM token.
registry_addressThe TokenAdminRegistry.
roles_addressThe ROLES module.
ocgTimelock_addressThe OCG timelock.
daoMS_addressThe DAO MS.

check​

Asserts the expectations against the live state and returns normally when every one of them holds. Intended to be the first action of the CCIP bridge activation proposal, so that a precondition that no longer holds at execution fails the proposal with a named error before any handover action runs; callable by anyone at any time, since it reads only.

Reverts if, in this order:

  • The config policy or the config timelock is not active in the Kernel (CCIPTokenPoolConfigProposalChecker_PolicyNotActive).
  • The Kernel does not report the bound ROLES module (CCIPTokenPoolConfigProposalChecker_BindingMismatch).
  • The pool registered for OHM in the TokenAdminRegistry is not the bound pool (CCIPTokenPoolConfigProposalChecker_RegisteredPoolMismatch).
  • The OCG timelock does not hold admin (CCIPTokenPoolConfigProposalChecker_MissingRole).
  • The OCG timelock is not the pending OHM administrator while acceptAdminRole is set, or not the OHM administrator while it is not (CCIPTokenPoolConfigProposalChecker_OhmAdministratorMismatch).
  • The DAO MS holds bridge_admin while grantBridgeAdmin is set, or lacks it while it is not (CCIPTokenPoolConfigProposalChecker_BridgeAdminRoleMismatch).
  • The config policy is enabled while enableConfig is set, or disabled while it is not (CCIPTokenPoolConfigProposalChecker_ConfigEnabledMismatch).
  • The pool owner is not the DAO MS while acceptPoolOwnership is set, or not the config policy while it is not (CCIPTokenPoolConfigProposalChecker_PoolOwnerMismatch).
  • The config operator is the config timelock while setConfigOperator is set, or is not while it is not (CCIPTokenPoolConfigProposalChecker_ConfigOperatorMismatch).
  • The pool rebalancer equals rebalancer while setRebalancer is set, or differs from it while it is not (CCIPTokenPoolConfigProposalChecker_RebalancerMismatch).
  • The native rate limit admin equals rateLimitAdmin while setRateLimitAdmin is set, or differs from it while it is not (CCIPTokenPoolConfigProposalChecker_RateLimitAdminMismatch).
  • The config timelock is enabled while enableTimelock is set, or disabled while it is not (CCIPTokenPoolConfigProposalChecker_TimelockEnabledMismatch).
  • The pool supports a chain selector of routesToAdd, the first one in list order (CCIPTokenPoolConfigProposalChecker_RouteAlreadyExists).
  • The OHM balance of the pool is below minimumPoolBacking (CCIPTokenPoolConfigProposalChecker_BackingTooLow).
function check(Expectations calldata expectations_) external view override;

Parameters

NameTypeDescription
expectations_ExpectationsThe expectations of the proposal build.

_requireActive​

Reverts unless the policy is active in the Kernel.

function _requireActive(address policy_) internal view;

Parameters

NameTypeDescription
policy_address

_requireRoutesAbsent​

Reverts on the first chain selector of the list that the pool supports.

function _requireRoutesAbsent(uint64[] calldata chainSelectors_) internal view;

Parameters

NameTypeDescription
chainSelectors_uint64[]

_requireNonZero​

Reverts when the address is zero.

function _requireNonZero(address value_, string memory parameter_) internal pure;

Parameters

NameTypeDescription
value_address
parameter_string

_requireBinding​

Reverts unless the value a bound contract reports equals the argument.

function _requireBinding(
string memory binding_,
address actual_,
address expected_
) internal pure;

Parameters

NameTypeDescription
binding_string
actual_address
expected_address