From 515e46f698cac9645472810e0393c7325fbf356f Mon Sep 17 00:00:00 2001 From: Vladislav Volosnikov Date: Mon, 23 Sep 2024 18:07:29 +0200 Subject: [PATCH] Use rawMimicCall --- system-contracts/contracts/ContractDeployer.sol | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/system-contracts/contracts/ContractDeployer.sol b/system-contracts/contracts/ContractDeployer.sol index 2e1d50f50..15656eda8 100644 --- a/system-contracts/contracts/ContractDeployer.sol +++ b/system-contracts/contracts/ContractDeployer.sol @@ -532,8 +532,18 @@ contract ContractDeployer is IContractDeployer, SystemContractBase { SystemContractHelper.setValueForNextFarCall(uint128(value)); } - // In case of EVM contracts returnData is the new deployed code - EfficientCall.mimicCall(uint32(gasleft()), _newAddress, _input, msg.sender, true, false); + bool success = EfficientCall.rawMimicCall({ + _gas: uint32(gasleft()), + _address: _newAddress, + _data: _input, + _whoToMimic: msg.sender, + _isConstructor: true, + _isSystem: false + }); + + if (!success) { + EfficientCall.propagateRevert(); + } bytes32 codeHash = _getEvmCodeHash(_newAddress); require(codeHash != 0x0, "The code hash must be set after the constructor call");