I have the following method in my Solidity contract.
function deploy(bytes memory bytecode, uint _salt) public payable returns (address){
address addr;
assembly {
addr := create2(
callvalue(),
add(bytecode, 0x20),
mload(bytecode),
_salt
)
if iszero(extcodesize(addr)) {
revert(0, 0)
}
}
emit Deployed(addr, _salt);
}
The method works if my bytecode is 2000 characters long and the contract is deployed. But when the bytecode gets 10000 characters long the contract is not being deployed and the revert is being called. Is there a limit for bytecode size of create2?