Skip to main content

LZBridgeSecurityUpgradeProposal

Git Source

Inherits: GovernorBravoProposal

OCG proposal for the LayerZero Bridge Security Upgrade. Replaces the old CrossChainBridge with a hardened LZBridgeGateway policy that separates infrastructure from user-facing concerns, tracks bridged supply, and migrates to LayerZero V2 with explicit endpoint configuration, eliminating drag-along vulnerability. The periphery LZCrossChainBridge is configured separately by the DAO MS.

The LZBridgeActivator performs all endpoint configuration, peer setup, enforced options, rate limits and enablement in a single proposal action. It is used to work around the governor's 15-action limit,

Assumes:

  • LZBridgeGateway, LZEndpointDelegate, LZCrossChainBridge, LZBridgeActivator have been deployed on Ethereum mainnet.
  • Remote instances have been deployed on Arbitrum, Optimism, Base, and Berachain.
  • DAO MS has already activated LZBridgeGateway and LZEndpointDelegate in the Kernel.
  • OCG timelock already has the admin and bridge_admin roles.

Constants​

_REMOTE_CHAIN_COUNT​

Number of remote chains (Arbitrum, Optimism, Base, Berachain).

uint256 internal constant _REMOTE_CHAIN_COUNT = 4;

State Variables​

_kernel​

Kernel internal _kernel;

Functions​

id​

function id() public pure override returns (uint256);

Returns

NameTypeDescription
<none>uint256

name​

function name() public pure override returns (string memory);

Returns

NameTypeDescription
<none>string

description​

function description() public pure override returns (string memory);

Returns

NameTypeDescription
<none>string

_descriptionPreamble​

function _descriptionPreamble() private pure returns (string memory);

Returns

NameTypeDescription
<none>string

_descriptionSteps​

function _descriptionSteps() private pure returns (string memory);

Returns

NameTypeDescription
<none>string

_deploy​

function _deploy(Addresses addresses, address) internal override;

Parameters

NameTypeDescription
addressesAddresses
_address

_afterDeploy​

function _afterDeploy(Addresses addresses, address) internal override;

Parameters

NameTypeDescription
addressesAddresses
_address

_build​

function _build(Addresses addresses) internal override;

Parameters

NameTypeDescription
addressesAddresses

_run​

function _run(Addresses addresses, address) internal override;

Parameters

NameTypeDescription
addressesAddresses
_address

_validate​

function _validate(Addresses addresses, address) internal view override;

Parameters

NameTypeDescription
addressesAddresses
_address

_validateLZConfig​

function _validateLZConfig(LZBridgeGateway gw, ILayerZeroEndpointV2 ep) internal view;

Parameters

NameTypeDescription
gwLZBridgeGateway
epILayerZeroEndpointV2

_validateLibraries​

function _validateLibraries(
LZBridgeGateway gw,
ILayerZeroEndpointV2 ep,
uint32 eid
) internal view;

Parameters

NameTypeDescription
gwLZBridgeGateway
epILayerZeroEndpointV2
eiduint32

_validateSendConfig​

function _validateSendConfig(
LZBridgeGateway gw,
ILayerZeroEndpointV2 ep,
uint32 eid
) internal view;

Parameters

NameTypeDescription
gwLZBridgeGateway
epILayerZeroEndpointV2
eiduint32

_validateRecvConfig​

function _validateRecvConfig(
LZBridgeGateway gw,
ILayerZeroEndpointV2 ep,
uint32 eid,
uint64 expectedConf
) internal view;

Parameters

NameTypeDescription
gwLZBridgeGateway
epILayerZeroEndpointV2
eiduint32
expectedConfuint64

_validatePeers​

function _validatePeers(LZBridgeGateway gw, LZBridgeActivator activator) internal view;

Parameters

NameTypeDescription
gwLZBridgeGateway
activatorLZBridgeActivator

_validateEnforcedOptions​

function _validateEnforcedOptions(LZBridgeGateway gw) internal view;

Parameters

NameTypeDescription
gwLZBridgeGateway

_validateRateLimits​

function _validateRateLimits(LZBridgeGateway gw) internal view;

Parameters

NameTypeDescription
gwLZBridgeGateway

_requireNonZeroAddress​

Reverts if the address is zero, including the registry key in the message.

function _requireNonZeroAddress(address addr_, string memory key_) internal pure;

Parameters

NameTypeDescription
addr_address
key_string