Skip to content

Commit

Permalink
Use rawMimicCall
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Sep 23, 2024
1 parent 2f6ea06 commit 515e46f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions system-contracts/contracts/ContractDeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 515e46f

Please sign in to comment.