General Transfer Manager

Introduced in

1.0.0

Contract name

GeneralTransferManager

Type

Transfer Manager Module

Compatible Protocol Version

^3.0.0

How it works

The General Transfer Manager module is for core transfer validation functionality. This module manages the transfer restrictions for the Security Token. By default, the GTM only allows whitelisted addresses to buy or sell the tokens.

Key functionalities (as defined in the Smart Contract)

Initialization

The contract doesn’t need any type of initialization.

Transfer Restriction

The executeTransfer() function try to understand the behavior of the transaction whether it is an issuance txn, redemption or general transaction (normal transfer of tokens) and accordingly it will use TransferRequirement set to validate the transaction.

  • If _from address is the issuance address then transaction type is issuance.

    • TransferRequirement set looks like (fromValidKYC = false, toValidKYC = true, fromRestricted = false, toRestricted = false).

  • If _to address is the zero address then transaction type is redemption.

    • TransferRequirement set looks like (fromValidKYC =true, toValidKYC =false, fromRestricted = false, toRestricted = false).

  • Otherwise, it is general transfer transaction.

    • TransferRequirement set looks like (fromValidKYC =true, toValidKYC =true, fromRestricted =true, toRestricted =true).

TransferRequirement is the set of flags that need to be valid according to the transaction type. This set of flags can be manipulated that leads to change in transaction validation rules (ex- allowing the transfer without verifying whether the sender or receiver is in whitelist or not).

fromValidKYC → Defines if KYC is required for the sender. toValidKYC → Defines if KYC is required for the receiver. fromRestricted → Defines if transfer time restriction is checked for the sender. toRestricted → Defines if transfer time restriction is checked for the receiver.

Note: When the contract is paused, it will not check any of the above conditions. executeTransfer() also facilitates the dynamic whitelisting of the addresses.

VerifyTransfer

It is a stateless function which is used to verify the transaction without changing the storage value.

Below functionality will be released after 3.1.0 release - verifyTransfer() will allow dynamic whitelisting by providing the valid _data parameter. It has the special check which will skip the valid treasury wallet & modules having type 8 can be skipped dynamically.

Change issuance address

This function is used to change the issuance addresses of your STO.

Modify KYC data

To add or remove addresses from a whitelist. Every piece of data related to whitelist is stored in the data store of the securityToken.

Modify KYC data of multiple addresses

Add or remove multiple addresses from the whitelist.

Modify KYC data using signed transaction

This function can be called by anyone who has a valid signature and allows that person to add or remove an address from the whitelist.

Modify the KYC data using multiple signed data

This function can be called by anyone who has a valid signature and allows that person to add or remove multiple addresses from the whitelist.

Modify investor flag

Flags represent the additional information about the investor i.e whether the investor is accredited or not.

Modify investors flags

Used to modify the flag value of multiple investors

Modify transfer requirements

Used to modify the transfer validation rules of given transaction type

Modify the transfer requirements of multiple transaction types

Used to modify the transfer validation rules of multiple transaction types

Change the default times (canSendAfter / canReceiveAfter)

Getters

  • getAllInvestors() returns the list of all investors.

  • getInvestors(uint256 _fromIndex, uint256 _toIndex) Returns list of investors in a range

  • getAllInvestorFlags() returns the flags of all investors.

  • getInvestorFlag(address _investor, uint8 _flag) returns the given flag value.

  • getInvestorFlags(address _investor) returns all flags of the given investor.

  • getAllKYCData() returns all KYC data.

  • getKYCData(address[] calldata _investors) returns the KYC data of given investors.

  • getTokensByPartition() returns the amount of tokens for a given user as per the partition.

Last updated

Was this helpful?