From fcb2e2bf28d43cc1039bd926b22b31a9ac23304e Mon Sep 17 00:00:00 2001 From: Vladislav Volosnikov Date: Wed, 27 Nov 2024 17:37:22 +0100 Subject: [PATCH] fix(EVM): Fix SSTORE warmth check (#1089) --- system-contracts/contracts/EvmEmulator.yul | 2 ++ system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul | 1 + 2 files changed, 3 insertions(+) diff --git a/system-contracts/contracts/EvmEmulator.yul b/system-contracts/contracts/EvmEmulator.yul index 86169cfbb..6de4661d6 100644 --- a/system-contracts/contracts/EvmEmulator.yul +++ b/system-contracts/contracts/EvmEmulator.yul @@ -593,6 +593,7 @@ object "EvmEmulator" { performSystemCall(EVM_GAS_MANAGER_CONTRACT(), 65) + originalValue := currentValue if returndatasize() { isWarm := true returndatacopy(0, 0, 32) @@ -3619,6 +3620,7 @@ object "EvmEmulator" { performSystemCall(EVM_GAS_MANAGER_CONTRACT(), 65) + originalValue := currentValue if returndatasize() { isWarm := true returndatacopy(0, 0, 32) diff --git a/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul b/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul index bf71a04e7..2fffe58c1 100644 --- a/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul +++ b/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul @@ -531,6 +531,7 @@ function warmSlot(key, currentValue) -> isWarm, originalValue { performSystemCall(EVM_GAS_MANAGER_CONTRACT(), 65) + originalValue := currentValue if returndatasize() { isWarm := true returndatacopy(0, 0, 32)