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:
| Role | keccak256 hash | Description |
|---|---|---|
| DEFAULT_ADMIN_ROLE | 0x0000000000000000000000000000000000000000000000000000000000000000 | Full access to all admin functions |
| PAUSE_ROLE | 0x139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d | Can 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.
function setLimits(address _bridge, uint256 _mintingLimit, uint256 _burningLimit) external;| Name | Type | Description |
|---|---|---|
bridge | address | The address of the bridge to set the limits for |
mintingLimit | uint256 | The minting limit in wei per 24h. |
burningLimit | uint256 | The 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.
function setMinBridges(uint256 _minBridges) public;| Name | Type | Description |
|---|---|---|
_minBridges | uint256 | The 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.
function setMultiBridgeAdapters(address[] memory adapter, bool[] memory enabled) public;Input Params:
| Name | Type | Description |
|---|---|---|
adapter | address[] | An array of adapter addresses of the bridge adapters. |
enabled | bool[] | 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)).
function setControllerForChain(uint256[] memory chainId, address[] memory controller) publicInput params:
| Name | Type | Description |
|---|---|---|
chainId | uint256[] | An array of chain id to set controllers for |
controller | address[] | 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.
function pauseTransfersToChain(uint256 _chainId, bool _pause) publicInput params:
| Name | Type | Description |
|---|---|---|
chainId | uint256 | The chain ID to pause or unpause transfers to. |
pause | bool | True 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() .
function pause() public;unpause
Unpauses the contract, re-enabling the functions listed above.
function unpause() public;
