Exemplo n.º 1
0
        public static string EmailVerifyResponseUrl()
        {
            UInt160           scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash);
            ApplicationEngine engine     = SmartContractHelper.LocalExec(scriptHash, "emailVerifyRespUrl");

            return(System.Text.Encoding.UTF8.GetString(engine.EvaluationStack.Peek().GetByteArray()));
        }
Exemplo n.º 2
0
        public static byte[] ContractOwnerPublicKey()
        {
            UInt160           scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash);
            ApplicationEngine engine     = SmartContractHelper.LocalExec(scriptHash, "contractOwner");

            return(engine.EvaluationStack.Peek().GetByteArray());
        }
Exemplo n.º 3
0
        public static JObject Query(string email)
        {
            UInt160           scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash);
            ApplicationEngine engine     = SmartContractHelper.LocalExec(scriptHash, "query", email);
            string            result     = System.Text.Encoding.UTF8.GetString(engine.EvaluationStack.Peek().GetByteArray());

            return(ParseProfile(result));
        }
Exemplo n.º 4
0
        public static JObject QueryByAccount(string owner)
        {
            UInt160 scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash);

            byte[]            ownerScriptHash = Wallet.ToScriptHash(owner).ToArray();
            ApplicationEngine engine          = SmartContractHelper.LocalExec(scriptHash, "queryByAccount", ownerScriptHash);
            string            result          = System.Text.Encoding.UTF8.GetString(engine.EvaluationStack.Peek().GetByteArray());

            return(ParseProfile(result));
        }
Exemplo n.º 5
0
        public static string QueryOwner(string email)
        {
            UInt160           scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash);
            ApplicationEngine engine     = SmartContractHelper.LocalExec(scriptHash, "queryOwner", email);

            byte[] owner = engine.EvaluationStack.Peek().GetByteArray();
            try
            {
                UInt160 ownerScriptHash = new UInt160(owner);
                return(Wallet.ToAddress(ownerScriptHash));
            }
            catch (Exception)
            {
                return("");
            }
        }