g8keepVester
g8keepVester
Inherits: IG8keepDeployerVesting
A vesting contract for tokens deployed on the g8keep platform.
State Variables
nextVestingId
The next ID to assign to a token vesting.
deploymentVestings
Mapping of vesting IDs to their vesting parameters.
Functions
deploymentVest
Creates a vesting at the time of token deployment for the deployer to be able to claim their tokens linearly over a period of time.
The caller of this function must be the token contract.
Parameters
Name | Type | Description |
---|---|---|
|
| Address that owns the vesting and will receive tokens when claiming. |
|
| Amount of tokens that are being vested. |
|
| Amount of times in seconds for the tokens to vest over. |
claim
Calculates the claimable tokens for a vesting ID and transfers them to the recipient.
Must be called by the owner of the vesting ID.
Parameters
Name | Type | Description |
---|---|---|
|
| ID of the vesting to be claimed. |
vested
Calculates the amount of tokens available to claim for a vesting ID.
Parameters
Name | Type | Description |
---|---|---|
|
| ID of the vesting to check. |
Returns
Name | Type | Description |
---|---|---|
|
| Amount of tokens available to claim. |
getVesting
Returns all of the vesting parameters for a vesting ID.
Parameters
Name | Type | Description |
---|---|---|
|
| ID of the vesting to return parameters of. |
_vested
Internal function to calculate the amount of tokens that are available to claim for the vesting ID and returns a storage pointer for the vesting to update in storage in the claim
function.
Parameters
Name | Type | Description |
---|---|---|
|
| ID of the vesting to be claimed. |
Returns
Name | Type | Description |
---|---|---|
|
| Storage pointer to the vesting parameters for updates. |
|
| Amount of tokens available to claim. |
Events
DeploymentVestCreated
Emitted when a deployment vest is created.
DeploymentVestClaimed
Emitted when a claim is made for vested tokens.
Errors
InvalidAddress
Thrown when a deployment vest is being created and the deployer address is zero.
InvalidAmount
Thrown when a deployment vest is being created and the amount of tokens is zero.
InvalidCaller
Thrown when claiming vested tokens and the caller is not the vesting recipient.
InvalidDuration
Thrown when a deployment vest is being created and the vesting time is zero or
the end time would overflow a uint40.
InvalidVestingId
Thrown when claiming vested tokens and the vesting ID is greater than or equal to the next ID.
NoTokensVested
Thrown when claiming vested tokens and there are no tokens available to claim.
Structs
DeploymentVesting
Struct of the vesting parameters for an ID.
Last updated