diff --git a/system-contracts/contracts/ContractDeployer.sol b/system-contracts/contracts/ContractDeployer.sol index 7a360b926..96691da99 100644 --- a/system-contracts/contracts/ContractDeployer.sol +++ b/system-contracts/contracts/ContractDeployer.sol @@ -10,7 +10,7 @@ import {Utils} from "./libraries/Utils.sol"; import {EfficientCall} from "./libraries/EfficientCall.sol"; import {SystemContractHelper} from "./libraries/SystemContractHelper.sol"; import {SystemContractBase} from "./abstract/SystemContractBase.sol"; -import {Unauthorized, InvalidNonceOrderingChange, ValueMismatch, EmptyBytes32, EVMEmulationNotSupported, NotAllowedToDeployInKernelSpace, HashIsNonZero, NonEmptyAccount, UnknownCodeHash, NonEmptyMsgValue} from "./SystemContractErrors.sol"; +import {Unauthorized, InvalidNonceOrderingChange, ValueMismatch, EmptyBytes32, EVMBytecodeHash, EVMEmulationNotSupported, NotAllowedToDeployInKernelSpace, HashIsNonZero, NonEmptyAccount, UnknownCodeHash, NonEmptyMsgValue} from "./SystemContractErrors.sol"; /** * @author Matter Labs @@ -398,6 +398,9 @@ contract ContractDeployer is IContractDeployer, SystemContractBase { if (_bytecodeHash == bytes32(0x0)) { revert EmptyBytes32(); } + if (Utils.isCodeHashEVM(_bytecodeHash)) { + revert EVMBytecodeHash(); + } if (uint160(_newAddress) <= MAX_SYSTEM_CONTRACT_ADDRESS) { revert NotAllowedToDeployInKernelSpace(); } diff --git a/system-contracts/contracts/SystemContractErrors.sol b/system-contracts/contracts/SystemContractErrors.sol index 2ba8eed26..e6bdb473e 100644 --- a/system-contracts/contracts/SystemContractErrors.sol +++ b/system-contracts/contracts/SystemContractErrors.sol @@ -34,6 +34,8 @@ error EmptyVirtualBlocks(); error EncodedAndRealBytecodeChunkNotEqual(uint64 expected, uint64 provided); // 0x2bfbfc11 error EncodedLengthNotFourTimesSmallerThanOriginal(); +// 0x39bae0e6 +error EVMBytecodeHash(); // 0xb9e6e31f error EVMEmulationNotSupported(); // 0xe95a1fbe