diff --git a/core/vm/evm.go b/core/vm/evm.go index d1cd9971e043..cbccef594521 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -400,7 +400,10 @@ func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte } if p, isPrecompile := evm.precompile(addr); isPrecompile { - ret, gas, err = RunStatefulPrecompiledContract(p, evm, caller.Address(), addr, input, gas, evm.interpreter.readOnly) + // Explicitly pass readOnly as true for StaticCall OpCode. + // Precompile implementation is responsible for honoring readOnly flag. + // No state should be modified, return an error instead. + ret, gas, err = RunStatefulPrecompiledContract(p, evm, caller.Address(), addr, input, gas, true) } else { // At this point, we use a copy of address. If we don't, the go compiler will // leak the 'contract' to the outer scope, and make allocation for 'contract'