Skip to content

Admin Functions

The following functions are available to projects that hold ownership rights over an Asset Controller.

Access Control

The Asset 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
PAUSE_ROLE0x139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46dCan pause the message sending, resending and execution functions

Admin functions

The following functions can only be called by an account with the DEFAULT_ADMIN_ROLE role.

setLimits

Sets the local bridge adapters on the same chain that can be used to relay messages to the Controller contract and assigns a 24h mint&burn limit.

solidity
function setLimits(address _bridge, uint256 _mintingLimit, uint256 _burningLimit) external;
NameTypeDescription
bridgeaddressThe address of the bridge to set the limits for
mintingLimituint256The minting limit in wei per 24h.
burningLimituint256The burning limit in wei per 24h.

setMinBridges

Sets the minimum number of bridges required to relay an asset when performing multi-bridge transfers without mint/burn limits. Setting this value to 0 will disable multi-bridge transfers entirely.

solidity
function setMinBridges(uint256 _minBridges) public;
NameTypeDescription
_minBridgesuint256The minimum number of bridges required.

setMultiBridgeAdapters

Adds a bridge adapter to the whitelist of adapters that can be used for multi-bridge transfers without applying mint/burn limits.

solidity
function setMultiBridgeAdapters(address[] memory adapter, bool[] memory enabled) public;

Input Params:

NameTypeDescription
adapteraddress[]An array of adapter addresses of the bridge adapters.
enabledbool[]An array of the status of the adapters. True to enable, false to disable. Adapterand enabled must have the same length.

setControllerForChain

Sets the foreign controller contract addresses for the specified chain IDs. To disable a controller on a given chain, its address should be set to the zero address (address(0)).

solidity
function setControllerForChain(uint256[] memory chainId, address[] memory controller) 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.

pauseTransfersToChain

Pauses or unpauses the initiation of new transfers to a specific chain.

solidity
function pauseTransfersToChain(uint256 _chainId, bool _pause) public

Input params:

NameTypeDescription
chainIduint256The chain ID to pause or unpause transfers to.
pauseboolTrue to pause transfers, false to unpause.

Pause functions

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

pause

Pauses the contract. This disables the following functions: transferTo(), resendTransfer()and execute() .

solidity
 function pause() public;

unpause

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

solidity
 function unpause() public;