VolumeRestrictionTM.sol

View Source: contracts/modules/TransferManager/VRTM/VolumeRestrictionTM.sol

↗ Extends: VolumeRestrictionTMStorage, TransferManager

VolumeRestrictionTM

Events

event ChangedExemptWalletList(address indexed _wallet, bool  _exempted);
event AddIndividualRestriction(address indexed _holder, uint256  _allowedTokens, uint256  _startTime, uint256  _rollingPeriodInDays, uint256  _endTime, enum VolumeRestrictionTMStorage.RestrictionType  _typeOfRestriction);
event AddIndividualDailyRestriction(address indexed _holder, uint256  _allowedTokens, uint256  _startTime, uint256  _rollingPeriodInDays, uint256  _endTime, enum VolumeRestrictionTMStorage.RestrictionType  _typeOfRestriction);
event ModifyIndividualRestriction(address indexed _holder, uint256  _allowedTokens, uint256  _startTime, uint256  _rollingPeriodInDays, uint256  _endTime, enum VolumeRestrictionTMStorage.RestrictionType  _typeOfRestriction);
event ModifyIndividualDailyRestriction(address indexed _holder, uint256  _allowedTokens, uint256  _startTime, uint256  _rollingPeriodInDays, uint256  _endTime, enum VolumeRestrictionTMStorage.RestrictionType  _typeOfRestriction);
event AddDefaultRestriction(uint256  _allowedTokens, uint256  _startTime, uint256  _rollingPeriodInDays, uint256  _endTime, enum VolumeRestrictionTMStorage.RestrictionType  _typeOfRestriction);
event AddDefaultDailyRestriction(uint256  _allowedTokens, uint256  _startTime, uint256  _rollingPeriodInDays, uint256  _endTime, enum VolumeRestrictionTMStorage.RestrictionType  _typeOfRestriction);
event ModifyDefaultRestriction(uint256  _allowedTokens, uint256  _startTime, uint256  _rollingPeriodInDays, uint256  _endTime, enum VolumeRestrictionTMStorage.RestrictionType  _typeOfRestriction);
event ModifyDefaultDailyRestriction(uint256  _allowedTokens, uint256  _startTime, uint256  _rollingPeriodInDays, uint256  _endTime, enum VolumeRestrictionTMStorage.RestrictionType  _typeOfRestriction);
event IndividualRestrictionRemoved(address indexed _holder);
event IndividualDailyRestrictionRemoved(address indexed _holder);
event DefaultRestrictionRemoved();
event DefaultDailyRestrictionRemoved();

Functions

Constructor

Arguments

Name

Type

Description

_securityToken

address

Address of the security token

_polyAddress

address

Address of the polytoken

executeTransfer

⤾ overrides ITransferManager.executeTransfer

Used to verify the transfer/transferFrom transaction and prevent tranaction whose volume of tokens will voilate the maximum volume transfer restriction

Arguments

Name

Type

Description

_from

address

Address of the sender

address

_from Address of the sender

_amount

uint256

The amount of tokens to transfer

bytes

_from Address of the sender

verifyTransfer

⤾ overrides ITransferManager.verifyTransfer

Used to verify the transfer/transferFrom transaction and prevent tranaction whose volume of tokens will voilate the maximum volume transfer restriction

Arguments

Name

Type

Description

_from

address

Address of the sender

address

_from Address of the sender

_amount

uint256

The amount of tokens to transfer

bytes

_from Address of the sender

_verifyTransfer

Used to verify the transfer/transferFrom transaction and prevent tranaction whose volume of tokens will voilate the maximum volume transfer restriction

Arguments

Name

Type

Description

_from

address

Address of the sender

_amount

uint256

The amount of tokens to transfer

changeExemptWalletList

Add/Remove wallet address from the exempt list

Arguments

Name

Type

Description

_wallet

address

Ethereum wallet/contract address that need to be exempted

_exempted

bool

Boolean value used to add (i.e true) or remove (i.e false) from the list

addIndividualRestriction

Use to add the new individual restriction for a given token holder

Arguments

Name

Type

Description

_holder

address

Address of the token holder, whom restriction will be implied

_allowedTokens

uint256

Amount of tokens allowed to be trade for a given address.

_startTime

uint256

Unix timestamp at which restriction get into effect

_rollingPeriodInDays

uint256

Rolling period in days (Minimum value should be 1 day)

_endTime

uint256

Unix timestamp at which restriction effects will gets end.

_restrictionType

enum VolumeRestrictionTMStorage.RestrictionType

Whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

addIndividualDailyRestriction

Use to add the new individual daily restriction for all token holder

Arguments

Name

Type

Description

_holder

address

Address of the token holder, whom restriction will be implied

_allowedTokens

uint256

Amount of tokens allowed to be traded for all token holder.

_startTime

uint256

Unix timestamp at which restriction get into effect

_endTime

uint256

Unix timestamp at which restriction effects will gets end.

_restrictionType

enum VolumeRestrictionTMStorage.RestrictionType

Whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

addIndividualDailyRestrictionMulti

Use to add the new individual daily restriction for multiple token holders

Arguments

Name

Type

Description

_holders

address[]

Array of address of the token holders, whom restriction will be implied

_allowedTokens

uint256[]

Array of amount of tokens allowed to be trade for a given address.

_startTimes

uint256[]

Array of unix timestamps at which restrictions get into effect

_endTimes

uint256[]

Array of unix timestamps at which restriction effects will gets end.

_restrictionTypes

enum VolumeRestrictionTMStorage.RestrictionType[]

Array of restriction types value whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

addIndividualRestrictionMulti

Use to add the new individual restriction for multiple token holders

Arguments

Name

Type

Description

_holders

address[]

Array of address of the token holders, whom restriction will be implied

_allowedTokens

uint256[]

Array of amount of tokens allowed to be trade for a given address.

_startTimes

uint256[]

Array of unix timestamps at which restrictions get into effect

_rollingPeriodInDays

uint256[]

Array of rolling period in days (Minimum value should be 1 day)

_endTimes

uint256[]

Array of unix timestamps at which restriction effects will gets end.

_restrictionTypes

enum VolumeRestrictionTMStorage.RestrictionType[]

Array of restriction types value whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

addDefaultRestriction

Use to add the new default restriction for all token holder

Arguments

Name

Type

Description

_allowedTokens

uint256

Amount of tokens allowed to be traded for all token holder.

_startTime

uint256

Unix timestamp at which restriction get into effect

_rollingPeriodInDays

uint256

Rolling period in days (Minimum value should be 1 day)

_endTime

uint256

Unix timestamp at which restriction effects will gets end.

_restrictionType

enum VolumeRestrictionTMStorage.RestrictionType

Whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

addDefaultDailyRestriction

Use to add the new default daily restriction for all token holder

Arguments

Name

Type

Description

_allowedTokens

uint256

Amount of tokens allowed to be traded for all token holder.

_startTime

uint256

Unix timestamp at which restriction get into effect

_endTime

uint256

Unix timestamp at which restriction effects will gets end.

_restrictionType

enum VolumeRestrictionTMStorage.RestrictionType

Whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

removeIndividualRestriction

use to remove the individual restriction for a given address

Arguments

Name

Type

Description

_holder

address

Address of the user

_removeIndividualRestriction

Arguments

Name

Type

Description

_holder

address

removeIndividualRestrictionMulti

use to remove the individual restriction for a given address

Arguments

Name

Type

Description

_holders

address[]

Array of address of the user

removeIndividualDailyRestriction

use to remove the individual daily restriction for a given address

Arguments

Name

Type

Description

_holder

address

Address of the user

_removeIndividualDailyRestriction

Arguments

Name

Type

Description

_holder

address

removeIndividualDailyRestrictionMulti

use to remove the individual daily restriction for a given address

Arguments

Name

Type

Description

_holders

address[]

Array of address of the user

removeDefaultRestriction

Use to remove the default restriction

Arguments

Name

Type

Description

removeDefaultDailyRestriction

Use to remove the daily default restriction

Arguments

Name

Type

Description

modifyIndividualRestriction

Use to modify the existing individual restriction for a given token holder

Arguments

Name

Type

Description

_holder

address

Address of the token holder, whom restriction will be implied

_allowedTokens

uint256

Amount of tokens allowed to be trade for a given address.

_startTime

uint256

Unix timestamp at which restriction get into effect

_rollingPeriodInDays

uint256

Rolling period in days (Minimum value should be 1 day)

_endTime

uint256

Unix timestamp at which restriction effects will gets end.

_restrictionType

enum VolumeRestrictionTMStorage.RestrictionType

Whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

modifyIndividualDailyRestriction

Use to modify the existing individual daily restriction for a given token holder

Arguments

Name

Type

Description

_holder

address

Address of the token holder, whom restriction will be implied

_allowedTokens

uint256

Amount of tokens allowed to be trade for a given address.

_startTime

uint256

Unix timestamp at which restriction get into effect

_endTime

uint256

Unix timestamp at which restriction effects will gets end.

_restrictionType

enum VolumeRestrictionTMStorage.RestrictionType

Whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

modifyIndividualDailyRestrictionMulti

Use to modify the existing individual daily restriction for multiple token holders

Arguments

Name

Type

Description

_holders

address[]

Array of address of the token holders, whom restriction will be implied

_allowedTokens

uint256[]

Array of amount of tokens allowed to be trade for a given address.

_startTimes

uint256[]

Array of unix timestamps at which restrictions get into effect

_endTimes

uint256[]

Array of unix timestamps at which restriction effects will gets end.

_restrictionTypes

enum VolumeRestrictionTMStorage.RestrictionType[]

Array of restriction types value whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

modifyIndividualRestrictionMulti

Use to modify the existing individual restriction for multiple token holders

Arguments

Name

Type

Description

_holders

address[]

Array of address of the token holders, whom restriction will be implied

_allowedTokens

uint256[]

Array of amount of tokens allowed to be trade for a given address.

_startTimes

uint256[]

Array of unix timestamps at which restrictions get into effect

_rollingPeriodInDays

uint256[]

Array of rolling period in days (Minimum value should be 1 day)

_endTimes

uint256[]

Array of unix timestamps at which restriction effects will gets end.

_restrictionTypes

enum VolumeRestrictionTMStorage.RestrictionType[]

Array of restriction types value whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

modifyDefaultRestriction

Use to modify the global restriction for all token holder

Arguments

Name

Type

Description

_allowedTokens

uint256

Amount of tokens allowed to be traded for all token holder.

_startTime

uint256

Unix timestamp at which restriction get into effect

_rollingPeriodInDays

uint256

Rolling period in days (Minimum value should be 1 day)

_endTime

uint256

Unix timestamp at which restriction effects will gets end.

_restrictionType

enum VolumeRestrictionTMStorage.RestrictionType

Whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

modifyDefaultDailyRestriction

Use to modify the daily default restriction for all token holder

Arguments

Name

Type

Description

_allowedTokens

uint256

Amount of tokens allowed to be traded for all token holder.

_startTime

uint256

Unix timestamp at which restriction get into effect

_endTime

uint256

Unix timestamp at which restriction effects will gets end.

_restrictionType

enum VolumeRestrictionTMStorage.RestrictionType

Whether it will be Fixed (fixed no. of tokens allowed to transact)

or Percentage (tokens are calculated as per the totalSupply in the fly). |

_restrictionCheck

Internal function used to validate the transaction for a given address If it validates then it also update the storage corressponds to the default restriction

Arguments

Name

Type

Description

_amount

uint256

_from

address

_isDefault

bool

_restriction

struct VolumeRestrictionTMStorage.VolumeRestriction

_validAllowedAmount

Arguments

Name

Type

Description

dailyRestriction

struct VolumeRestrictionTMStorage.VolumeRestriction

restriction

struct VolumeRestrictionTMStorage.VolumeRestriction

allowedAmount

uint256

allowedDailyAmount

uint256

_isValidAmountAfterRestrictionChanges

The function is used to check specific edge case where the user restriction type change from default to individual or vice versa. It will return true when last transaction traded by the user and the current txn timestamp lies in the same day. NB - Instead of comparing the current day transaction amount, we are comparing the total amount traded on the lastTradedDayTime that makes the restriction strict. The reason is not availability of amount that transacted on the current day (because of bucket desgin).

Arguments

Name

Type

Description

_isDefault

bool

_from

address

_amount

uint256

_sumOfLastPeriod

uint256

_allowedAmount

uint256

_dailyTxCheck

Arguments

Name

Type

Description

_amount

uint256

_from

address

_isDefault

bool

_dailyLastTradedDayTime

uint256

_restriction

struct VolumeRestrictionTMStorage.VolumeRestriction

_bucketCheck

Arguments

Name

Type

Description

_from

address

isDefault

bool

_fromTime

uint256

_diffDays

uint256

_rollingPeriodInDays

uint256

_bucketDetails

struct VolumeRestrictionTMStorage.BucketDetails

_checkValidAmountToTransact

Arguments

Name

Type

Description

_amountToTransact

uint256

_from

address

_isDefault

bool

_restriction

struct VolumeRestrictionTMStorage.VolumeRestriction

_sumOfLastPeriod

uint256

_allowedAmountToTransact

Arguments

Name

Type

Description

_sumOfLastPeriod

uint256

_restriction

struct VolumeRestrictionTMStorage.VolumeRestriction

_updateStorage

Arguments

Name

Type

Description

_from

address

_amount

uint256

_lastTradedDayTime

uint256

_sumOfLastPeriod

uint256

_daysCovered

uint256

_dailyLastTradedDayTime

uint256

_endTime

uint256

isDefault

bool

_updateStorageActual

Arguments

Name

Type

Description

_from

address

_amount

uint256

_lastTradedDayTime

uint256

_sumOfLastPeriod

uint256

_daysCovered

uint256

_dailyLastTradedDayTime

uint256

_endTime

uint256

isDefault

bool

details

struct VolumeRestrictionTMStorage.BucketDetails

_checkInputParams

Arguments

Name

Type

Description

_allowedTokens

uint256

_startTime

uint256

_rollingPeriodDays

uint256

_endTime

uint256

_restrictionType

enum VolumeRestrictionTMStorage.RestrictionType

_earliestStartTime

uint256

isModifyDaily

bool

_isAllowedToModify

Arguments

Name

Type

Description

_startTime

uint256

_getValidStartTime

Arguments

Name

Type

Description

_startTime

uint256

getTokensByPartition

⤾ overrides TransferManager.getTokensByPartition

return the amount of tokens for a given user as per the partition

Arguments

Name

Type

Description

_partition

bytes32

Identifier

_tokenHolder

address

Whom token amount need to query

_additionalBalance

uint256

It is the _value that transfer during transfer/transferFrom function call

getIndividualBucketDetailsToUser

Use to get the bucket details for a given address

Returns

uint256 lastTradedDayTime

Arguments

Name

Type

Description

_user

address

Address of the token holder for whom the bucket details has queried

getDefaultBucketDetailsToUser

Use to get the bucket details for a given address

Returns

uint256 lastTradedDayTime

Arguments

Name

Type

Description

_user

address

Address of the token holder for whom the bucket details has queried

_getBucketDetails

Arguments

Name

Type

Description

_bucket

struct VolumeRestrictionTMStorage.BucketDetails

getTotalTradedByUser

Use to get the volume of token that being traded at a particular day (_at + 24 hours) for a given user

Arguments

Name

Type

Description

_user

address

Address of the token holder

_at

uint256

Timestamp

getInitFunction

⤾ overrides IModule.getInitFunction

This function returns the signature of configure function

Arguments

Name

Type

Description

getExemptAddress

Use to return the list of exempted addresses

Arguments

Name

Type

Description

getIndividualRestriction

Arguments

Name

Type

Description

_investor

address

getIndividualDailyRestriction

Arguments

Name

Type

Description

_investor

address

getDefaultRestriction

Arguments

Name

Type

Description

getDefaultDailyRestriction

Arguments

Name

Type

Description

_volumeRestrictionSplay

Arguments

Name

Type

Description

_volumeRestriction

struct VolumeRestrictionTMStorage.VolumeRestriction

getRestrictionData

Provide the restriction details of all the restricted addresses

Returns

address List of the restricted addresses

Arguments

Name

Type

Description

_checkLengthOfArray

Arguments

Name

Type

Description

_holders

address[]

_allowedTokens

uint256[]

_startTimes

uint256[]

_rollingPeriodInDays

uint256[]

_endTimes

uint256[]

_restrictionTypes

enum VolumeRestrictionTMStorage.RestrictionType[]

getPermissions

⤾ overrides IModule.getPermissions

Returns the permissions flag that are associated with Percentage transfer Manager

Arguments

Name

Type

Description

Last updated

Was this helpful?