View Source: contracts/modules/TransferManager/LTM/LockUpTransferManager.sol
↗ Extends: LockUpTransferManagerStorage, TransferManager
LockUpTransferManager
Events
event AddLockUpToUser(address indexed _userAddress, bytes32 indexed _lockupName);event RemoveLockUpFromUser(address indexed _userAddress, bytes32 indexed _lockupName);event ModifyLockUpType(uint256 _lockupAmount, uint256 _startTime, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds, bytes32 indexed _lockupName);event AddNewLockUpType(bytes32 indexed _lockupName, uint256 _lockupAmount, uint256 _startTime, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds);event RemoveLockUpType(bytes32 indexed _lockupName);
Constructor
function (address _securityToken, address _polyAddress) public nonpayable Module
Arguments
Name | Type | Description |
_securityToken | address | Address of the security token |
_polyAddress | address | Address of the polytoken |
⤾ overrides ITransferManager.executeTransfer
Used to verify the transfer transaction and prevent locked up tokens from being transferred
function executeTransfer(address _from, address , uint256 _amount, bytes ) external nonpayablereturns(enum ITransferManager.Result)
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 |
⤾ overrides ITransferManager.verifyTransfer
Used to verify the transfer transaction and prevent locked up tokens from being transferred
function verifyTransfer(address _from, address , uint256 _amount, bytes ) public viewreturns(enum ITransferManager.Result, bytes32)
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 |
Used to verify the transfer transaction and prevent locked up tokens from being transferred
function _verifyTransfer(address _from, uint256 _amount) internal viewreturns(enum ITransferManager.Result, bytes32)
Arguments
Name | Type | Description |
_from | address | Address of the sender |
_amount | uint256 | The amount of tokens to transfer |
Use to add the new lockup type
function addNewLockUpType(uint256 _lockupAmount, uint256 _startTime, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds, bytes32 _lockupName) external nonpayable withPerm
Arguments
Name | Type | Description |
_lockupAmount | uint256 | Amount of tokens that need to lock. |
_startTime | uint256 | When this lockup starts (seconds) |
_lockUpPeriodSeconds | uint256 | Total period of lockup (seconds) |
_releaseFrequencySeconds | uint256 | How often to release a tranche of tokens (seconds) |
_lockupName | bytes32 | Name of the lockup |
Use to add the new lockup type
function addNewLockUpTypeMulti(uint256[] _lockupAmounts, uint256[] _startTimes, uint256[] _lockUpPeriodsSeconds, uint256[] _releaseFrequenciesSeconds, bytes32[] _lockupNames) public nonpayable withPerm
Arguments
Name | Type | Description |
_lockupAmounts | uint256[] | Array of amount of tokens that need to lock. |
_startTimes | uint256[] | Array of startTimes when this lockup starts (seconds) |
_lockUpPeriodsSeconds | uint256[] | Array of total period of lockup (seconds) |
_releaseFrequenciesSeconds | uint256[] | Array of how often to release a tranche of tokens (seconds) |
_lockupNames | bytes32[] | Array of names of the lockup |
Add the lockup to a user
function addLockUpByName(address _userAddress, bytes32 _lockupName) external nonpayable withPerm
Arguments
Name | Type | Description |
_userAddress | address | Address of the user |
_lockupName | bytes32 | Name of the lockup |
Add lockups to users
function addLockUpByNameMulti(address[] _userAddresses, bytes32[] _lockupNames) public nonpayable withPerm
Arguments
Name | Type | Description |
_userAddresses | address[] | Array of addresses of the users |
_lockupNames | bytes32[] | Array of names of the lockups |
Lets the admin create a volume restriction lockup for a given address.
function addNewLockUpToUser(address _userAddress, uint256 _lockupAmount, uint256 _startTime, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds, bytes32 _lockupName) external nonpayable withPerm
Arguments
Name | Type | Description |
_userAddress | address | Address of the user whose tokens should be locked up |
_lockupAmount | uint256 | Amount of tokens that need to lock. |
_startTime | uint256 | When this lockup starts (seconds) |
_lockUpPeriodSeconds | uint256 | Total period of lockup (seconds) |
_releaseFrequencySeconds | uint256 | How often to release a tranche of tokens (seconds) |
_lockupName | bytes32 | Name of the lockup |
Lets the admin create multiple volume restriction lockups for multiple given addresses.
function addNewLockUpToUserMulti(address[] _userAddresses, uint256[] _lockupAmounts, uint256[] _startTimes, uint256[] _lockUpPeriodsSeconds, uint256[] _releaseFrequenciesSeconds, bytes32[] _lockupNames) public nonpayable withPerm
Arguments
Name | Type | Description |
_userAddresses | address[] | Array of address of the user whose tokens should be locked up |
_lockupAmounts | uint256[] | Array of the amounts that need to be locked for the different addresses. |
_startTimes | uint256[] | Array of When this lockup starts (seconds) |
_lockUpPeriodsSeconds | uint256[] | Array of total periods of lockup (seconds) |
_releaseFrequenciesSeconds | uint256[] | Array of how often to release a tranche of tokens (seconds) |
_lockupNames | bytes32[] | Array of names of the lockup |
Lets the admin remove a user's lock up
function removeLockUpFromUser(address _userAddress, bytes32 _lockupName) external nonpayable withPerm
Arguments
Name | Type | Description |
_userAddress | address | Address of the user whose tokens are locked up |
_lockupName | bytes32 | Name of the lockup need to be removed. |
Used to remove the lockup type
function removeLockupType(bytes32 _lockupName) external nonpayable withPerm
Arguments
Name | Type | Description |
_lockupName | bytes32 | Name of the lockup |
Used to remove the multiple lockup type
function removeLockupTypeMulti(bytes32[] _lockupNames) public nonpayable withPerm
Arguments
Name | Type | Description |
_lockupNames | bytes32[] | Array of the lockup names. |
Use to remove the lockup for multiple users
function removeLockUpFromUserMulti(address[] _userAddresses, bytes32[] _lockupNames) public nonpayable withPerm
Arguments
Name | Type | Description |
_userAddresses | address[] | Array of addresses of the user whose tokens are locked up |
_lockupNames | bytes32[] | Array of the names of the lockup that needs to be removed. |
Lets the admin modify a lockup.
function modifyLockUpType(uint256 _lockupAmount, uint256 _startTime, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds, bytes32 _lockupName) external nonpayable withPerm
Arguments
Name | Type | Description |
_lockupAmount | uint256 | Amount of tokens that needs to be locked |
_startTime | uint256 | When this lockup starts (seconds) |
_lockUpPeriodSeconds | uint256 | Total period of lockup (seconds) |
_releaseFrequencySeconds | uint256 | How often to release a tranche of tokens (seconds) |
_lockupName | bytes32 | name of the lockup that needs to be modified. |
Lets the admin modify a volume restriction lockup for a multiple address.
function modifyLockUpTypeMulti(uint256[] _lockupAmounts, uint256[] _startTimes, uint256[] _lockUpPeriodsSeconds, uint256[] _releaseFrequenciesSeconds, bytes32[] _lockupNames) public nonpayable withPerm
Arguments
Name | Type | Description |
_lockupAmounts | uint256[] | Array of the amount of tokens that needs to be locked for the respective addresses. |
_startTimes | uint256[] | Array of the start time of the lockups (seconds) |
_lockUpPeriodsSeconds | uint256[] | Array of unix timestamp for the list of lockups (seconds). |
_releaseFrequenciesSeconds | uint256[] | How often to release a tranche of tokens (seconds) |
_lockupNames | bytes32[] | Array of the lockup names that needs to be modified |
Get a specific element in a user's lockups array given the user's address and the element index
function getLockUp(bytes32 _lockupName) public viewreturns(lockupAmount uint256, startTime uint256, lockUpPeriodSeconds uint256, releaseFrequencySeconds uint256, unlockedAmount uint256)
Arguments
Name | Type | Description |
_lockupName | bytes32 | The name of the lockup |
Return the data of the lockups
function getAllLockupData() external viewreturns(lockupNames bytes32[], lockupAmounts uint256[], startTimes uint256[], lockUpPeriodSeconds uint256[], releaseFrequencySeconds uint256[], unlockedAmounts uint256[])
Arguments
Name | Type | Description |
get the list of the users of a lockup type
function getListOfAddresses(bytes32 _lockupName) external viewreturns(address[])
Returns
address List of users associated with the given lockup name
Arguments
Name | Type | Description |
_lockupName | bytes32 | Name of the lockup type |
get the list of lockups names
function getAllLockups() external viewreturns(bytes32[])
Returns
bytes32 Array of lockups names
Arguments
Name | Type | Description |
get the list of the lockups for a given user
function getLockupsNamesToUser(address _user) external viewreturns(bytes32[])
Returns
bytes32 List of lockups names associated with the given address
Arguments
Name | Type | Description |
_user | address | Address of the user |
Use to get the total locked tokens for a given user
function getLockedTokenToUser(address _userAddress) public viewreturns(uint256)
Returns
uint256 Total locked tokens amount
Arguments
Name | Type | Description |
_userAddress | address | Address of the user |
Checks whether the transfer is allowed
function _checkIfValidTransfer(address _userAddress, uint256 _amount) internal viewreturns(enum ITransferManager.Result, bytes32)
Arguments
Name | Type | Description |
_userAddress | address | Address of the user whose lock ups should be checked |
_amount | uint256 | Amount of tokens that need to transact |
Provide the unlock amount for the given lockup for a particular user
function _getUnlockedAmountForLockup(bytes32 _lockupName) internal viewreturns(uint256)
Arguments
Name | Type | Description |
_lockupName | bytes32 | |
function _removeLockupType(bytes32 _lockupName) internal nonpayable
Arguments
Name | Type | Description |
_lockupName | bytes32 | |
function _modifyLockUpType(uint256 _lockupAmount, uint256 _startTime, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds, bytes32 _lockupName) internal nonpayable
Arguments
Name | Type | Description |
_lockupAmount | uint256 | |
_startTime | uint256 | |
_lockUpPeriodSeconds | uint256 | |
_releaseFrequencySeconds | uint256 | |
_lockupName | bytes32 | |
function _removeLockUpFromUser(address _userAddress, bytes32 _lockupName) internal nonpayable
Arguments
Name | Type | Description |
_userAddress | address | |
_lockupName | bytes32 | |
function _addNewLockUpToUser(address _userAddress, uint256 _lockupAmount, uint256 _startTime, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds, bytes32 _lockupName) internal nonpayable
Arguments
Name | Type | Description |
_userAddress | address | |
_lockupAmount | uint256 | |
_startTime | uint256 | |
_lockUpPeriodSeconds | uint256 | |
_releaseFrequencySeconds | uint256 | |
_lockupName | bytes32 | |
function _addLockUpByName(address _userAddress, bytes32 _lockupName) internal nonpayable
Arguments
Name | Type | Description |
_userAddress | address | |
_lockupName | bytes32 | |
function _addNewLockUpType(uint256 _lockupAmount, uint256 _startTime, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds, bytes32 _lockupName) internal nonpayable
Arguments
Name | Type | Description |
_lockupAmount | uint256 | |
_startTime | uint256 | |
_lockUpPeriodSeconds | uint256 | |
_releaseFrequencySeconds | uint256 | |
_lockupName | bytes32 | |
Parameter checking function for creating or editing a lockup. This function will cause an exception if any of the parameters are bad.
function _checkLockUpParams(uint256 _lockupAmount, uint256 _lockUpPeriodSeconds, uint256 _releaseFrequencySeconds) internal pure
Arguments
Name | Type | Description |
_lockupAmount | uint256 | Amount that needs to be locked |
_lockUpPeriodSeconds | uint256 | Total period of lockup (seconds) |
_releaseFrequencySeconds | uint256 | How often to release a tranche of tokens (seconds) |
function _checkValidStartTime(uint256 _startTime) internal view
Arguments
Name | Type | Description |
_startTime | uint256 | |
function _checkZeroAddress(address _userAddress) internal pure
Arguments
Name | Type | Description |
_userAddress | address | |
function _validLockUpCheck(bytes32 _lockupName) internal view
Arguments
Name | Type | Description |
_lockupName | bytes32 | |
function _checkValidName(bytes32 _name) internal pure
Arguments
Name | Type | Description |
_name | bytes32 | |
function _checkLengthOfArray(uint256 _length1, uint256 _length2) internal pure
Arguments
Name | Type | Description |
_length1 | uint256 | |
_length2 | uint256 | |
⤾ overrides TransferManager.getTokensByPartition
return the amount of tokens for a given user as per the partition
function getTokensByPartition(bytes32 _partition, address _tokenHolder, uint256 _additionalBalance) external viewreturns(uint256)
Arguments
Name | Type | Description |
_partition | bytes32 | Identifier |
_tokenHolder | address | Whom token amount need to query |
_additionalBalance | uint256 | It is the |
⤾ overrides IModule.getInitFunction
This function returns the signature of configure function
function getInitFunction() public purereturns(bytes4)
Arguments
Name | Type | Description |
⤾ overrides IModule.getPermissions
Returns the permissions flag that are associated with Percentage transfer Manager
function getPermissions() public viewreturns(bytes32[])
Arguments
Name | Type | Description |