Skip to content

Admin Functions

Access Control

The Message Controller contract uses OpenZeppelin’s AccessControl module. To grant, revoke, or check roles for an address, use the standard functions available in the AccessControl contract.

The following roles are available:

Rolekeccak256 hashDescription
DEFAULT_ADMIN_ROLE0x0000000000000000000000000000000000000000000000000000000000000000Full access to all admin functions
MESSAGE_ORIGINATOR_ROLE0x343f885b34563a3091a1ab8d7f8c30d813397ffdf0870abda8bd119df0cc679cCan call sendMessage()
MESSAGE_RESENDER_ROLE0x7992c340206b4656f211126bf5358a5ace076bc513ca5e5dac42e3ae8628bb42Can call resendMessage()
PAUSE_ROLE0x139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46dCan pause message sending, resending and execution functions

Admin functions

The following functions can only be called by accounts with the DEFAULT_ADMIN_ROLE:

setLocalAdapter

Sets the local bridge adapters that can relay messages to the Controller contract.

INFO

Note: If a Registry is configured, the local adapters set here will be ignored.

solidity
function setLocalAdapter(address[] memory adapters, bool[] memory enabled) public;
NameTypeDescription
adaptersaddress[]An array of adapter addresses to enable/disable
enabledbool[]An array of boolean values to enable or disable the corresponding adapters in adapters. Both arrays must have the same length

setLocalRegistry

Sets the address of the local Registry contract.

INFO

This setting overrides any local adapter configuration.

solidity
function setLocalRegistry(address _localRegistry) public;
NameTypeDescription
localRegistryaddressThe address of the new local registry to set

setMessageOriginators

Defines the addresses allowed to send messages to other chains. Granting or revoking the MESSAGE_ORIGINATOR_ROLE via this function will also grant or revoke the MESSAGE_RESENDER_ROLE.

INFO

If you want to manage these roles independently, use grantRole(...) and revokeRole(...) directly.

function setMessageOriginators(address[] memory originators, bool[] memory enabled) public

Input Params:

NameTypeDescription
originatorsaddress[]An array of message originator addresses to enable/disable
enabledbool[]An array of boolean values to enable or disable the corresponding originators. Both arrays must have the same length

setControllerForChain

Sets the controller contract addresses for the specified chain IDs. To disable a controller for a specific chain, pass address(0) .

solidity
function setMessageOriginators(address[] memory originators, bool[] memory enabled) public

Input params:

NameTypeDescription
chainIduint256[]An array of chain id to set controllers for
controlleraddress[]An array of controller addresses to set for the corresponding chainIds. Both arrays must have the same length.

setVetoer

Sets the address of the Vetoer — an account that can cancel the execution of a message. Set to address(0) to disable veto functionality.

solidity
function setVetoer(address _vetoer) public;

Input params

NameTypeDescription
_vetoeraddressThe address of the vetoer

setTimelockDelay

Sets the timelock delay (in seconds) before a message can be executed. Set to 0 to disable the timelock feature entirely

function setTimelockDelay(uint256 _timelockDelay) public;

Input params:

NameTypeDescription
_timelockDelayuint256The timelock delay in seconds

Pause functions

The following functions can only be called by accounts with the PAUSE_ROLE:

pause

Pauses the contract. This disables the following functions:execute(), sendMessage()and resendMessage() .

solidity
 function pause() public;

unpause

Unpauses the contract, re-enabling the functions listed above.

solidity
 function unpause() public;