Skip to content

SStore2Deployer ​

Git Source

This contract is open and can be called by any address. It provides functionality to deploy and read code using SSTORE2.

Functions ​

deployCode ​

deploys code and emits an event with the pointer and code hash

solidity
function deployCode(bytes memory code_) external returns (address pointer_);

Parameters

NameTypeDescription
code_bytescode to deploy

Returns

NameTypeDescription
pointer_addresspointer to the deployed code

deployCodeSplit ​

deploys code and emits an event with the pointer and code hash

solidity
function deployCodeSplit(bytes memory code_) external returns (address pointer1_, address pointer2_);

Parameters

NameTypeDescription
code_bytescode to deploy

Returns

NameTypeDescription
pointer1_addresspointer to the first part of the deployed code
pointer2_addresspointer to the second part of the deployed code

readCode ​

reads code from a pointer

solidity
function readCode(address pointer_) external view returns (bytes memory code_);

Parameters

NameTypeDescription
pointer_addresspointer to the code

Returns

NameTypeDescription
code_bytescode

readCodeSplit ​

solidity
function readCodeSplit(address pointer1_, address pointer2_) external view returns (bytes memory code_);

Events ​

LogCodeDeployed ​

solidity
event LogCodeDeployed(address pointer_, bytes32 codeHash_);

LogCodeDeployedSplit ​

solidity
event LogCodeDeployedSplit(address pointer1_, address pointer2_, bytes32 codeHash_);