This contract can be used to deploy a contract with a deterministic address that depends on the contract bytecode, deployer address, and deployment salt.
function _create2(bytes bytecode, bytes32 deploySalt) internal returns (address deployed)
Deploys a new contract using the CREATE2
method.
This function deploys the contract using CREATE2
opcode.
Name | Type | Description |
---|---|---|
bytecode | bytes | The bytecode of the contract to be deployed |
deploySalt | bytes32 | A salt to influence the contract address |
Name | Type | Description |
---|---|---|
deployed | address | The address of the deployed contract |
function _create2Address(bytes bytecode, bytes32 deploySalt) internal view returns (address)
Computes the deployed address that will result from the CREATE2
method.
Name | Type | Description |
---|---|---|
bytecode | bytes | The bytecode of the contract to be deployed |
deploySalt | bytes32 | A salt to influence the contract address |
Name | Type | Description |
---|---|---|
[0] | address | address The deterministic contract address if it was deployed |