diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 96231efc0..25c2ad6d7 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -854,7 +854,7 @@ func (bc *Blockchain) IsExtensibleAllowed(u util.Uint160) bool { func (bc *Blockchain) runPersist(script []byte, block *block.Block, cache *dao.Cached, trig trigger.Type) (*state.AppExecResult, error) { systemInterop := bc.newInteropContext(trig, cache, block, nil) v := systemInterop.SpawnVM() - v.LoadScriptWithFlags(script, callflag.WriteStates|callflag.AllowCall) + v.LoadScriptWithFlags(script, callflag.All) v.SetPriceGetter(systemInterop.GetPrice) if err := v.Run(); err != nil { return nil, fmt.Errorf("VM has failed: %w", err) diff --git a/pkg/core/interop/contract/call.go b/pkg/core/interop/contract/call.go index 2bb689138..45963931b 100644 --- a/pkg/core/interop/contract/call.go +++ b/pkg/core/interop/contract/call.go @@ -73,7 +73,7 @@ func callInternal(ic *interop.Context, cs *state.Contract, name string, f callfl hasReturn bool, args []stackitem.Item) error { md := cs.Manifest.ABI.GetMethod(name, len(args)) if md.Safe { - f &^= callflag.WriteStates + f &^= (callflag.WriteStates | callflag.AllowNotify) } else if ctx := ic.VM.Context(); ctx != nil && ctx.IsDeployed() { curr, err := ic.GetContract(ic.VM.GetCurrentScriptHash()) if err == nil { diff --git a/pkg/core/interops.go b/pkg/core/interops.go index 9cc2aa553..f680a70b3 100644 --- a/pkg/core/interops.go +++ b/pkg/core/interops.go @@ -36,8 +36,8 @@ var systemInterops = []interop.Function{ {Name: interopnames.SystemContractCreateMultisigAccount, Func: contractCreateMultisigAccount, Price: 1 << 8, ParamCount: 2}, {Name: interopnames.SystemContractCreateStandardAccount, Func: contractCreateStandardAccount, Price: 1 << 8, ParamCount: 1}, {Name: interopnames.SystemContractGetCallFlags, Func: contractGetCallFlags, Price: 1 << 10}, - {Name: interopnames.SystemContractNativeOnPersist, Func: native.OnPersist, Price: 0, RequiredFlags: callflag.WriteStates}, - {Name: interopnames.SystemContractNativePostPersist, Func: native.PostPersist, Price: 0, RequiredFlags: callflag.WriteStates}, + {Name: interopnames.SystemContractNativeOnPersist, Func: native.OnPersist, Price: 0, RequiredFlags: callflag.States}, + {Name: interopnames.SystemContractNativePostPersist, Func: native.PostPersist, Price: 0, RequiredFlags: callflag.States}, {Name: interopnames.SystemIteratorCreate, Func: iterator.Create, Price: 1 << 4, ParamCount: 1}, {Name: interopnames.SystemIteratorNext, Func: iterator.Next, Price: 1 << 15, ParamCount: 1}, {Name: interopnames.SystemIteratorValue, Func: iterator.Value, Price: 1 << 4, ParamCount: 1},