diff --git a/system-contracts/contracts/EvmInterpreter.sol b/system-contracts/contracts/EvmInterpreter.sol index 5a89c966e..b7064d899 100644 --- a/system-contracts/contracts/EvmInterpreter.sol +++ b/system-contracts/contracts/EvmInterpreter.sol @@ -387,7 +387,7 @@ contract EvmInterpreter { uint32 dataStart = 0; uint32 dataLength = 36; - bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 36, true); + bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 36, 0, 32); assembly { if iszero(success) { // This error should never happen @@ -433,7 +433,7 @@ contract EvmInterpreter { mstore(4, key) mstore(36, currentValue) } - bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 68, true); + bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 68, 0, 64); assembly { if iszero(success) { // This error should never happen @@ -2313,7 +2313,7 @@ contract EvmInterpreter { mstore(4, _passGas) mstore(36, _isStatic) } - bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 68, true); + bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 68, 0, 0); assembly { if iszero(success) { // This error should never happen @@ -2328,7 +2328,7 @@ contract EvmInterpreter { assembly { mstore(0, selector) } - bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 4, true); + bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 4, 0, 0); assembly { if iszero(success) { // This error should never happen @@ -2343,14 +2343,15 @@ contract EvmInterpreter { assembly { mstore(0, selector) } - bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 4, true); + bool success = SystemContractsCaller.rawSystemCall(uint32(gasleft()), addr, 0, 0, 4, 0, 64); assembly { - _passGas := mload(0) - isStatic := mload(32) if iszero(success) { // This error should never happen revert(0, 0) } + + _passGas := mload(0) + isStatic := mload(32) } if (_passGas != INF_PASS_GAS) { diff --git a/system-contracts/contracts/libraries/SystemContractsCaller.sol b/system-contracts/contracts/libraries/SystemContractsCaller.sol index 2eb679640..c9fb98390 100644 --- a/system-contracts/contracts/libraries/SystemContractsCaller.sol +++ b/system-contracts/contracts/libraries/SystemContractsCaller.sol @@ -83,7 +83,8 @@ library SystemContractsCaller { uint256 value, uint32 dataStart, uint32 dataLength, - bool returnDataCopy + uint32 returnDataStart, + uint32 returndataLength ) internal returns (bool success) { address callAddr = SYSTEM_CALL_CALL_ADDRESS; uint256 farCallAbi = SystemContractsCaller.getFarCallABI( @@ -113,10 +114,10 @@ library SystemContractsCaller { success := call(msgValueSimulator, callAddr, value, to, farCallAbi, forwardMask, 0) } } - if (success && returnDataCopy) { + if (success) { assembly { let returndataSize := returndatasize() - returndatacopy(0, 0, returndataSize) + returndatacopy(0, returnDataStart, returndataLength) } } } @@ -134,7 +135,7 @@ library SystemContractsCaller { dataStart := add(data, 0x20) } uint32 dataLength = uint32(Utils.safeCastToU32(data.length)); - success = rawSystemCall(gasLimit, to, value, dataStart, dataLength, false); + success = rawSystemCall(gasLimit, to, value, dataStart, dataLength, 0, 0); } /// @notice Makes a call with the `isSystem` flag.