From e9b01684144a6bbe10eec345238b05363bc4272e Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Fri, 20 Mar 2026 14:57:46 +0100 Subject: [PATCH] Fix readonly flag handling in STATICCALL precompile execution --- core/vm/evm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/vm/evm.go b/core/vm/evm.go index e53134ffd3..e3f39730a9 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -210,9 +210,9 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas } evm.Context.Transfer(evm.StateDB, caller.Address(), addr, value) - // It is allowed to call precompiles, even via call -- as opposed to callcode, staticcall and delegatecall it can also modify state + // Precompiles must use the current call-frame read-only context. if isPrecompile { - ret, gas, err = evm.RunPrecompiledContract(p, caller, input, gas, value, false) + ret, gas, err = evm.RunPrecompiledContract(p, caller, input, gas, value, evm.interpreter.readOnly) } else { // Initialise a new contract and set the code that is to be used by the EVM. // The contract is a scoped environment for this execution context only.