/// <summary> /// retrieve the group number the whitelisted address is in /// </summary> /// <param name="address"></param> /// <returns></returns> public static BigInteger GetWhitelistGroupNumber(byte[] address) { if (address.Length != 20) { return(0); } StorageMap kycWhitelist = Storage.CurrentContext.CreateMap(StorageKeys.KYCWhitelistPrefix()); return(kycWhitelist.Get(address).AsBigInteger()); }
/// <summary> /// remove an address from the whitelist /// </summary> /// <param name="address"></param> public static bool RevokeAddress(byte[] address) { if (address.Length != 20) { return(false); } if (Helpers.VerifyWitness(ICOTemplate.KycMiddlewareKey)) { StorageMap kycWhitelist = Storage.CurrentContext.CreateMap(StorageKeys.KYCWhitelistPrefix()); kycWhitelist.Delete(address); return(true); } return(false); }
/// <summary> /// remove an address from the whitelist /// </summary> /// <param name="address"></param> public static bool RevokeAddress(byte[] address) { if (address.Length != 20) { return(false); } if (Helpers.VerifyIsAdminAccount()) { StorageMap kycWhitelist = Storage.CurrentContext.CreateMap(StorageKeys.KYCWhitelistPrefix()); kycWhitelist.Delete(address); return(true); } return(false); }
/// <summary> /// add an address to the kyc whitelist /// </summary> /// <param name="address"></param> public static bool AddAddress(byte[] address, int groupNumber) { if (address.Length != 20 || groupNumber <= 0 || groupNumber > 4) { return(false); } if (Helpers.VerifyWitness(ICOTemplate.KycMiddlewareKey)) { StorageMap kycWhitelist = Storage.CurrentContext.CreateMap(StorageKeys.KYCWhitelistPrefix()); kycWhitelist.Put(address, groupNumber); return(true); } return(false); }
/// <summary> /// add an address to the kyc whitelist /// </summary> /// <param name="address"></param> public static bool AddAddress(byte[] address, int groupNumber) { if (address.Length != 20 || groupNumber <= 0) { return(false); } if (Helpers.VerifyIsAdminAccount()) { StorageMap kycWhitelist = Storage.CurrentContext.CreateMap(StorageKeys.KYCWhitelistPrefix()); kycWhitelist.Put(address, groupNumber); return(true); } return(false); }