// Parse "result" tags and create assembly for dynamically getting results from elements, that are then input args to smart contract function
        void InitializeScript(Hashtable elements, IPlugin element)
        {
            lock (_syncCsScript)
            {
                if (_scripts == null)
                {
                    string sFunctions = string.Empty;
                    foreach (string args in Regex.Split(element.GetElementProperty("CONTRACT_PARAMS"), "#100#"))
                    {
                        sFunctions += ZenCsScriptCore.GetFunction("return " + elements + ";");
                    }

                    _scripts = ZenCsScriptCore.Initialize(sFunctions, elements, element,
                                                          Path.Combine("tmp", "NeoSmartContractFunction", element.ID + ".zen"), null, element.GetElementProperty("PRINT_CODE") == "1");
                }
            }
        }
Beispiel #2
0
 // Parse "result" tags and create assembly for dynamically getting results from elements, that are then input args to smart contract function
 void InitializeScript(Hashtable elements, IPlugin element)
 {
     lock (_syncCsScript)
     {
         if (_scripts == null)
         {
             string sFunctions = string.Empty;
             foreach (string args in Regex.Split(ZenCsScriptCore.Decode(element.GetElementProperty("SCTRANSACTION_PARAMETERS")), "¨"))
             {
                 if (!string.IsNullOrEmpty(args))
                 {
                     sFunctions += ZenCsScriptCore.GetFunction("return " + args + ";");
                 }
             }
             _scripts = ZenCsScriptCore.Initialize(sFunctions, elements, element,
                                                   Path.Combine("tmp", "SmartContractTransaction", element.ID + ".zen"),
                                                   ParentBoard, element.GetElementProperty("PRINT_CODE") == "1");
         }
     }
 }