IL2ContractDeployer
Author: Matter Labs
System smart contract that is responsible for deploying other smart contracts on a ZK chain.
Functions
allowedBytecodeTypesToDeploy
Returns what types of bytecode are allowed to be deployed on this chain
function allowedBytecodeTypesToDeploy()
external
view
returns (AllowedBytecodeTypes mode);
forceDeployOnAddresses
This method is to be used only during an upgrade to set bytecodes on specific addresses.
function forceDeployOnAddresses(ForceDeployment[] calldata _deployParams)
external;
create2
Deploys a contract with similar address derivation rules to the EVM's CREATE2
opcode.
function create2(bytes32 _salt, bytes32 _bytecodeHash, bytes calldata _input)
external;
Parameters
Name | Type | Description |
---|---|---|
_salt | bytes32 | The create2 salt. |
_bytecodeHash | bytes32 | The correctly formatted hash of the bytecode. |
_input | bytes | The constructor calldata. |
setAllowedBytecodeTypesToDeploy
Changes what types of bytecodes are allowed to be deployed on the chain.
function setAllowedBytecodeTypesToDeploy(
AllowedBytecodeTypes newAllowedBytecodeTypes
) external;
Parameters
Name | Type | Description |
---|---|---|
newAllowedBytecodeTypes | AllowedBytecodeTypes | The new allowed bytecode types mode. |
Structs
ForceDeployment
A struct that describes a forced deployment on an address.
struct ForceDeployment {
bytes32 bytecodeHash;
address newAddress;
bool callConstructor;
uint256 value;
bytes input;
}
Properties
Name | Type | Description |
---|---|---|
bytecodeHash | bytes32 | The bytecode hash to put on an address. |
newAddress | address | The address on which to deploy the bytecodehash to. |
callConstructor | bool | Whether to run the constructor on the force deployment. |
value | uint256 | The msg.value with which to initialize a contract. |
input | bytes | The constructor calldata. |