protected bool Storage_Get(ExecutionEngine engine)
        {
            CustomStorageContext context = engine.EvaluationStack.Pop().GetInterface <CustomStorageContext>();
            var         key  = engine.EvaluationStack.Pop().GetByteArray().ToHexString();
            StorageItem item = new StorageItem
            {
                Value = (byte[])context.data[key]
            };

            engine.EvaluationStack.Push(item?.Value ?? new byte[0]);
            return(true);
        }
        protected bool Storage_Put(ExecutionEngine engine)
        {
            CustomStorageContext context = engine.EvaluationStack.Pop().GetInterface <CustomStorageContext>();
            var top = engine.EvaluationStack.Pop();
            var key = top.GetByteArray().ToHexString();

            if (key.Length > 1024)
            {
                return(false);
            }
            byte[] value = engine.EvaluationStack.Pop().GetByteArray();

            context.data[key] = value;
            return(true);
        }
        public CustomInteropService()
        {
            Register("Neo.Storage.GetContext", Storage_GetContext);
            Register("Neo.Storage.Get", Storage_Get);
            Register("Neo.Storage.Put", Storage_Put);
            Register("Neo.Runtime.CheckWitness", Runtime_CheckWitness);
            Register("Neo.Transaction.GetInputs", Transaction_GetInputs);
            Register("Neo.Transaction.GetOutputs", Transaction_GetOutputs);
            Register("Neo.Blockchain.GetTransaction", Blockchain_GetTransaction);
            Register("Neo.Transaction.GetReferences", Transaction_GetReferences);
            Register("Neo.Input.GetHash", Input_GetHash);
            Register("Neo.Input.GetIndex", Input_GetIndex);
            Register("Neo.Output.GetScriptHash", Output_GetScriptHash);
            Register("Neo.Output.GetValue", Output_GetValue);
            Register("Neo.Output.GetAssetId", Output_GetAssetId);
            Register("Neo.Runtime.Notify", Runtime_Notify);
            Register("System.ExecutionEngine.GetExecutingScriptHash", ExecutionEngine_GetExecutingScriptHash);

            storageContext = new CustomStorageContext();
            transactions   = new Hashtable();
        }