Dealer Registry

Registry for Dealers.

Overview

The Dealer Registry (DealerRegistry.sol) is used to store dealer information. It's also extended to include some basic functionality, like creating dealers and adding them to instruments. Like most registries, it makes use of the eternal storage pattern to store information, and since it is a user registry, inherits the base user registry. In this case the Dealer Registry uses the dealer's Ids to store their associated data.

Dealer

Dealers have the main purpose of managing investors, granting them access to instruments, and keeping their information up to date. They can be onboarded by registering them in the KAIO system.

Dealer Creation

  • Function: addDealer(bytes32 _senderRole, bytes32 _dealerId, address _wallet)

  • Purpose: Creates a new Dealer in the KAIO system.

  • Parameters:

    • bytes32 _senderRole: Role of the sender.

    • bytes32 _dealerId: Id of the dealer to create.

    • address _wallet: Wallet associated to be associated with the dealer.

  • Validation Checks:

    • Checks the dealer Id is not 0.

    • Ensures the caller has the proper role.

    • Makes sure the dealer does not already exist.

  • Behavior:

    • Creates the new dealer, with the associated wallet.

    • Emits a NewDealerAdded event, signaling the dealer has been created.

  • Example:

    addDealer(0xAdminRole, 0xDealerId, 0xDealerAddress);

Instrument Access

Fund admins have the ability to decide which dealers can access their instrument. When a dealer is allowed into an instrument, it also allows all the dealer's investors in the instrument, with the condition they pass all required rules for it.

Allowing Dealer

  • Function: allowDealer(bytes32 _senderRole, bytes32 _dealerId, bytes32 _instrumentId, bool _allowed)

  • Purpose: Allows or un-allows the dealer from accessing an instrument.

  • Parameters:

    • bytes32 _senderRole: Role of the sender.

    • bytes32 _dealerId: Id of the dealer.

    • bytes32 _instrumentId: Id of instrument.

    • bool _allowed: Indicates if the dealer should be allowed or not.

  • Validation Checks:

    • Ensures the caller has the proper role.

  • Behavior:

    • Allows or un-allows the dealer for the instrument.

    • Emits a dealerAllowedUpdated event, signaling access to the instrument for the dealer has changed.

  • Example:

Allowing Dealer (Batch)

  • Function: allowDealerBatch( bytes32 _senderRole, bytes32[] _dealerIds, bytes32[] _instrumentIds, bool[] _allowed )

  • Purpose: Batch function for allowing or un-allowing dealers to access instruments. Can be used with one dealer for multiple instruments, with multiple dealers for a single instrument, or with multiple dealers for multiple instruments.

  • Parameters:

    • bytes32 _senderRole: Role of the sender.

    • bytes32[] _dealerIds: Ids of the dealers.

    • bytes32[] _instrumentIds: Ids of instruments.

    • bool[] _allowed: Indicates if the dealers should be allowed or not.

  • Validation Checks:

    • Ensures the caller has the proper role.

    • Verifies the arrays all have the same length.

  • Behavior:

    • Allows or un-allows the dealers for the instruments.

    • Emits dealerAllowedUpdated events, signaling access to the instruments for the dealers has changed.

  • Example:

Getting Dealer Access

  • Function: isDealerAllowed(bytes32 _dealerId, bytes32 _instrumentId)

  • Purpose: Returns if a dealer is allowed access into an instrument.

  • Parameters:

    • bytes32 _dealerId: Id of the dealer.

    • bytes32 _instrumentId: Id of the instrument.

  • Return Values:

    • bool: Signals if the dealer is allowed.

  • Example:

Last updated