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