Update whitelisted address

This commit is contained in:
2024-05-14 18:50:57 +07:00
parent ef0655c882
commit 6f02b88942

View File

@@ -11,6 +11,8 @@ public class UserService : IUserService
private readonly IUserRepository _userRepository;
private readonly IAccountService _accountService;
private string[] authorizedAddresses = new string[] { "0x6781920674dA695aa5120d95D80c4B1788046806" };
public UserService(
IEvmManager evmManager,
IUserRepository userRepository,
@@ -25,6 +27,9 @@ public class UserService : IUserService
{
var recoveredAddress = _evmManager.VerifySignature(signature, message);
if (!authorizedAddresses.Contains(recoveredAddress))
throw new Exception("Address not authorized");
if (recoveredAddress == null || !recoveredAddress.Equals(address))
throw new Exception("Address not corresponding");