IAdmin

Git Source

Inherits: IZKChainBase

Author: Matter Labs

Note: security-contact: security@matterlabs.dev

Functions

setPendingAdmin

Starts the transfer of admin rights. Only the current admin can propose a new pending one.

New admin can accept admin rights by calling acceptAdmin function.

function setPendingAdmin(address _newPendingAdmin) external;

Parameters

NameTypeDescription
_newPendingAdminaddressAddress of the new admin

acceptAdmin

Accepts transfer of admin rights. Only pending admin can accept the role.

function acceptAdmin() external;

setValidator

Change validator status (active or not active)

function setValidator(address _validator, bool _active) external;

Parameters

NameTypeDescription
_validatoraddressValidator address
_activeboolActive flag

setPorterAvailability

Change zk porter availability

function setPorterAvailability(bool _zkPorterIsAvailable) external;

Parameters

NameTypeDescription
_zkPorterIsAvailableboolThe availability of zk porter shard

setPriorityTxMaxGasLimit

Change the max L2 gas limit for L1 -> L2 transactions

function setPriorityTxMaxGasLimit(uint256 _newPriorityTxMaxGasLimit) external;

Parameters

NameTypeDescription
_newPriorityTxMaxGasLimituint256The maximum number of L2 gas that a user can request for L1 -> L2 transactions

changeFeeParams

Change the fee params for L1->L2 transactions

function changeFeeParams(FeeParams calldata _newFeeParams) external;

Parameters

NameTypeDescription
_newFeeParamsFeeParamsThe new fee params

setTokenMultiplier

Change the token multiplier for L1->L2 transactions

function setTokenMultiplier(uint128 _nominator, uint128 _denominator) external;

setPubdataPricingMode

Change the pubdata pricing mode before the first batch is processed

function setPubdataPricingMode(PubdataPricingMode _pricingMode) external;

Parameters

NameTypeDescription
_pricingModePubdataPricingModeThe new pubdata pricing mode

setTransactionFilterer

Set the transaction filterer

function setTransactionFilterer(address _transactionFilterer) external;

allowEvmEmulation

Allow EVM emulation on chain

function allowEvmEmulation() external returns (bytes32 canonicalTxHash);

upgradeChainFromVersion

Perform the upgrade from the current protocol version with the corresponding upgrade data

function upgradeChainFromVersion(
  uint256 _protocolVersion,
  Diamond.DiamondCutData calldata _cutData
) external;

Parameters

NameTypeDescription
_protocolVersionuint256The current protocol version from which upgrade is executed
_cutDataDiamond.DiamondCutDataThe diamond cut parameters that is executed in the upgrade

executeUpgrade

Executes a proposed governor upgrade

Only the ChainTypeManager contract can execute the upgrade

function executeUpgrade(Diamond.DiamondCutData calldata _diamondCut) external;

Parameters

NameTypeDescription
_diamondCutDiamond.DiamondCutDataThe diamond cut parameters to be executed

freezeDiamond

Instantly pause the functionality of all freezable facets & their selectors

Only the governance mechanism may freeze Diamond Proxy

function freezeDiamond() external;

unfreezeDiamond

Unpause the functionality of all freezable facets & their selectors

Only the CTM can unfreeze Diamond Proxy

function unfreezeDiamond() external;

genesisUpgrade

function genesisUpgrade(
  address _l1GenesisUpgrade,
  address _ctmDeployer,
  bytes calldata _forceDeploymentData,
  bytes[] calldata _factoryDeps
) external;

setDAValidatorPair

Set the L1 DA validator address as well as the L2 DA validator address.

While in principle it is possible that updating only one of the addresses is needed, usually these should work in pair and L1 validator typically expects a specific input from the L2 Validator. That's why we change those together to prevent admins of chains from shooting themselves in the foot.

function setDAValidatorPair(address _l1DAValidator, address _l2DAValidator)
  external;

Parameters

NameTypeDescription
_l1DAValidatoraddressThe address of the L1 DA validator
_l2DAValidatoraddressThe address of the L2 DA validator

makePermanentRollup

Makes the chain as permanent rollup.

This is a security feature needed for chains that should be trusted to keep their data available even if the chain admin becomes malicious and tries to set the DA validator pair to something which does not publish DA to Ethereum.

DANGEROUS: once activated, there is no way back!

function makePermanentRollup() external;

forwardedBridgeBurn

Similar to IL1AssetHandler interface, used to send chains.

function forwardedBridgeBurn(
  address _settlementLayer,
  address _originalCaller,
  bytes calldata _data
) external payable returns (bytes memory _bridgeMintData);

forwardedBridgeRecoverFailedTransfer

Similar to IL1AssetHandler interface, used to claim failed chain transfers.

function forwardedBridgeRecoverFailedTransfer(
  uint256 _chainId,
  bytes32 _assetInfo,
  address _originalCaller,
  bytes calldata _chainData
) external payable;

forwardedBridgeMint

Similar to IL1AssetHandler interface, used to receive chains.

function forwardedBridgeMint(
  bytes calldata _data,
  bool _contractAlreadyDeployed
) external payable;

prepareChainCommitment

function prepareChainCommitment()
  external
  view
  returns (ZKChainCommitment memory commitment);

Events

IsPorterAvailableStatusUpdate

Porter availability status changes

event IsPorterAvailableStatusUpdate(bool isPorterAvailable);

ValidatorStatusUpdate

Validator's status changed

event ValidatorStatusUpdate(address indexed validatorAddress, bool isActive);

NewPendingAdmin

pendingAdmin is changed

Also emitted when new admin is accepted and in this case, newPendingAdmin would be zero address

event NewPendingAdmin(
  address indexed oldPendingAdmin, address indexed newPendingAdmin
);

NewAdmin

Admin changed

event NewAdmin(address indexed oldAdmin, address indexed newAdmin);

NewPriorityTxMaxGasLimit

Priority transaction max L2 gas limit changed

event NewPriorityTxMaxGasLimit(
  uint256 oldPriorityTxMaxGasLimit, uint256 newPriorityTxMaxGasLimit
);

NewFeeParams

Fee params for L1->L2 transactions changed

event NewFeeParams(FeeParams oldFeeParams, FeeParams newFeeParams);

PubdataPricingModeUpdate

Validium mode status changed

event PubdataPricingModeUpdate(PubdataPricingMode validiumMode);

NewTransactionFilterer

The transaction filterer has been updated

event NewTransactionFilterer(
  address oldTransactionFilterer, address newTransactionFilterer
);

NewBaseTokenMultiplier

BaseToken multiplier for L1->L2 transactions changed

event NewBaseTokenMultiplier(
  uint128 oldNominator,
  uint128 oldDenominator,
  uint128 newNominator,
  uint128 newDenominator
);

ExecuteUpgrade

Emitted when an upgrade is executed.

event ExecuteUpgrade(Diamond.DiamondCutData diamondCut);

MigrationComplete

Emitted when the migration to the new settlement layer is complete.

event MigrationComplete();

Freeze

Emitted when the contract is frozen.

event Freeze();

Unfreeze

Emitted when the contract is unfrozen.

event Unfreeze();

EnableEvmEmulator

The EVM emulator has been enabled

event EnableEvmEmulator();

NewL2DAValidator

New pair of DA validators set

event NewL2DAValidator(
  address indexed oldL2DAValidator, address indexed newL2DAValidator
);

NewL1DAValidator

event NewL1DAValidator(
  address indexed oldL1DAValidator, address indexed newL1DAValidator
);

BridgeMint

event BridgeMint(address indexed _account, uint256 _amount);