diff --git a/pkg/core/interop/contract/call.go b/pkg/core/interop/contract/call.go index 52292f64b..f6f2f13ed 100644 --- a/pkg/core/interop/contract/call.go +++ b/pkg/core/interop/contract/call.go @@ -115,8 +115,8 @@ func callExFromNative(ic *interop.Context, caller util.Uint160, cs *state.Contra ic.VM.Invocations[cs.Hash]++ ic.VM.LoadScriptWithCallingHash(caller, cs.NEF.Script, cs.Hash, ic.VM.Context().GetCallFlags()&f, hasReturn, uint16(len(args))) ic.VM.Context().NEF = &cs.NEF - for i := len(args) - 1; i >= 0; i-- { - ic.VM.Estack().PushItem(args[i]) + for e, i := ic.VM.Estack(), len(args)-1; i >= 0; i-- { + e.PushItem(args[i]) } // use Jump not Call here because context was loaded in LoadScript above. ic.VM.Jump(ic.VM.Context(), md.Offset)