Skip to main content
Git Source

Functions

setPoolByteCode

the setByteCode function is expected to receive only bytes as its only parameter the makeByteCodeImmutable function is expected to receive no parameters helper function to send the byte code in chunks to the factory and then make it immutable
function setPoolByteCode(
    address factoryAddress,
    bytes memory bytecode,
    uint256 chunks,
    bytes4 setByteCodeSelector,
    bytes4 makeImmutableSelector
) internal;
Parameters
NameTypeDescription
factoryAddressaddressaddress of the factory where to set the byte code
bytecodebytesthe full byte code to set
chunksuint256number of chunks to split the byte code into
setByteCodeSelectorbytes4selector of the setByteCode function
makeImmutableSelectorbytes4selector of the makeByteCodeImmutable function

slice

this function was taken from https://stackoverflow.com/questions/74443594/how-to-slice-bytes-memory-in-solidity helper function to slice bytes arrays
function slice(bytes memory _bytes, uint256 _start, uint256 _length) private pure returns (bytes memory);
Parameters
NameTypeDescription
_bytesbytesthe bytes array to slice
_startuint256the starting index
_lengthuint256the length of the slice
Returns
NameTypeDescription
<none>bytestempBytes the sliced bytes array