/// <summary>
        /// allow the contract administrator to update the admin address
        /// </summary>
        /// <param name="newAdminAddress"></param>
        /// <returns></returns>
        public static bool UpdateAdminAddress(byte[] newAdminAddress)
        {
            if (newAdminAddress.Length != 20)
            {
                return(false);
            }

            Storage.Put(Storage.CurrentContext, StorageKeys.ContractAdmin(), newAdminAddress);
            return(true);
        }
예제 #2
0
 /// <summary>
 /// verify the contract invoker is the defined administrator
 /// </summary>
 /// <returns></returns>
 public static bool VerifyIsAdminAccount()
 {
     if (ContractInitialised())
     {
         return(VerifyWitness(Storage.Get(Storage.CurrentContext, StorageKeys.ContractAdmin())));
     }
     else
     {
         return(VerifyWitness(ICOTemplate.InitialAdminAccount));
     }
 }
예제 #3
0
 /// <summary>
 /// allow the contract administrator to update the admin address
 /// </summary>
 /// <param name="newAdminAddress"></param>
 /// <returns></returns>
 public static bool UpdateAdminAddress(byte[] newAdminAddress)
 {
     Storage.Put(Storage.CurrentContext, StorageKeys.ContractAdmin(), newAdminAddress);
     return(true);
 }