Comment on page

Vesting

This contract gives a possibility to create vesting schedules and distribute ASX tokens between users using the linear distribution during release period.

Write methods description

createVestingSchedule()

Creates new vesting schedules in a batch by an owner.
Parameters:
Name
Type
Description
_accounts
address[]
An array of addresses of users for whom new vesting schedules should be created.
_amounts
uint256[]
An array of vesting schedules distribution amounts.
_lockPeriods
uint32[]
An array of lock period durations (in seconds) that should take place before distribution will start.
_releasePeriods
uint32[]
An array of periods (in seconds) during which ASX tokens will be distributed after the lock period.

release()

Releases ASX tokens for a specified vesting schedule IDs in a batch.
Parameters:
Name
Type
Description
_vsids
uint256[]
An array of vesting schedule IDs.
_recipients
address[]
An array of recipients of unlocked ASX tokens.

renounceOwnership()

Leaves the contract without owner. It will not be possible to call the owner's functions anymore. Can only be called by the current owner. The method does not take any parameters. Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership()

Transfers ownership of the contract to the new owner. Can only be called by the current owner.
Parameters:
Name
Type
Description
_newOwner
address
An account that will become the new owner.

withdraw()

Withdraws unused ASX tokens or othe tokens (including ETH) by an owner.
Parameters:
Name
Type
Description
_token
address
A token to withdraw. If equal to zero address - withdraws ETH.
_amount
uint256
An amount of tokens for withdraw.
_recipient
address
A recipient of withdrawn tokens.

Read methods description

getReleasableAmount()

Returns releasable amount for a vesting schedule by provided ID. If no vesting schedule exists with provided ID, returns zero.
Parameters:
Name
Type
Description
_vsid
uint256
An ID of a vesting schedule.
Return:
Name
Type
Description
_amount
uint256
A releasable amount for a specified vesting schedule.

getToken()

Returns the ASX token address.
Return:
Name
Type
Description
_token
address
The ASX token address.

getTotalDistributionAmount()

Returns total distribution amount for all vesting schedules.
Return:
Name
Type
Description
_amount
uint256
Total distribution amount for all vesting schedules.

getTotalReleasedAmount()

Returns total released amount for all vesting schedules.
Return:
Name
Type
Description
_amount
uint256
Total released amount for all vesting schedules.

getVestingSchedule()

Returns a vesting schedule by its ID. If no vesting schedule exists with provided ID, returns an empty vesting schedule.
Parameters:
Name
Type
Description
_vsid
uint256
An ID of a vesting schedule.
Return:
Name
Type
Description
_vestingSchedule
VestingSchedule
A vesting schedule structure.

getVestingSchedulesCount()

Returns total vesting schedules count.
Return:
Name
Type
Description
_count
uint256
Total vesting schedules count.

getWithdrawableAmount()

Returns an amount available for withdrawal (unused ASX tokens amount) by an owner.
Return:
Name
Type
Description
_amount
uint256
A withdrawable amount.

owner()

Gets an owner address that was granted exclusive access to specific functions with the modifier onlyOwner.
Return:
Name
Type
Description
_owner
address
An owner address.