diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 84855bf845..10ea09ed8b 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -516,6 +516,9 @@ func opSload(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) { } func opSstore(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) { + if evm.readOnly { + return nil, ErrWriteProtection + } loc := scope.Stack.pop() val := scope.Stack.pop() evm.StateDB.SetState(scope.Contract.Address(), loc.Bytes32(), val.Bytes32())