SStore2Deployer ​
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
Name | Type | Description |
---|---|---|
code_ | bytes | code to deploy |
Returns
Name | Type | Description |
---|---|---|
pointer_ | address | pointer 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
Name | Type | Description |
---|---|---|
code_ | bytes | code to deploy |
Returns
Name | Type | Description |
---|---|---|
pointer1_ | address | pointer to the first part of the deployed code |
pointer2_ | address | pointer 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
Name | Type | Description |
---|---|---|
pointer_ | address | pointer to the code |
Returns
Name | Type | Description |
---|---|---|
code_ | bytes | code |
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_);