Skip to content

INestorPermissionsManager

Git Source

Author: Originally developed by DEFYCA Labs S.a.r.l., maintained by Nestor Exchange OÜ

MIT Licence. Originally Copyright © 2023 DEFYCA Labs S.a.r.l.

The INestorPermissionsManager is responsible for the management of permission of the various participants in the Nestor Protocol.

Functions

isPermissioned

Validates if a wallet address is permissioned in the Nestor Protocol

function isPermissioned(address userAddress) external view returns (bool);

registerIdentity

Registers a user's wallet address as an OnChainId (Identity) to the Nestor Protocol.

function registerIdentity(address userAddress, uint16 userISOCountry) external returns (address);

getIdentity

function getIdentity(address userAddress) external returns (address);

getClaimMsgHash

Get the signed claimData message to be used in the addUser function. Must be signed using the PK of the ClaimIssuer (PROTOCOL_ADMIN).

function getClaimMsgHash(address userIdentity, INestorPermissionsManager.NestorPermissionedUser userType) external view returns (bytes32);

hasClaim

function hasClaim(address userAddress, NestorPermissionedUser userType) external view returns (bool);

addUser

Adds a user's OnChainId (Identity) to the Nestor Protocol along with its associated claim data.

function addUser(
    address userIdentity,
    NestorPermissionedUser userType,
    bytes memory claimSignature,
    string memory claimURI
) external returns (address);

removeUser

function removeUser(address userAddress) external returns (bool);

Events

NestorPermissionedUserAdded

event NestorPermissionedUserAdded(address userIdentity, uint256 userType, string claimURI);

NestorPermissionedUserRegistered

event NestorPermissionedUserRegistered(address userAddress, uint16 userISOCountry);

NestorPermissionedUserRemoved

event NestorPermissionedUserRemoved(address userAddress);

Errors

NestorIsZeroAddress

error NestorIsZeroAddress(string);

NestorInvalidPermissionForTreasury

error NestorInvalidPermissionForTreasury();

NestorUserIsNotPermissionedInvestor

error NestorUserIsNotPermissionedInvestor();

Structs

Claim

struct Claim {
    address issuer;
    uint256 topic;
    uint8 scheme;
    address identity;
    bytes signature;
    bytes data;
}

Enums

NestorPermissionedUser

enum NestorPermissionedUser {
    PROTOCOL_TREASURY,
    PERMISSIONED_CUSTODIAN,
    PERMISSIONED_INVESTOR,
    PERMISSIONED_MANAGER,
    PERMISSIONED_CALCULATING_AGENT,
    PERMISSIONED_TRANSFER_AGENT,
    PERMISSIONED_FUND_ACCOUNTANT
}