InvestorVesting

Git Source

Inherits:IVESTING, Context, Ownable2Step, ReentrancyGuard

Investor Vesting contract

Offers flexible withdrawal schedule (gas efficient)

Implements linear vesting schedule for investors

Note: security-contact: security@nebula-labs.xyz

State Variables

_start

start timestamp

uint64 private immutable _start;

_duration

duration seconds

uint64 private immutable _duration;

_token

token address

_erc20Released

amount of tokens released

Functions

constructor

Sets the owner to beneficiary address, the start timestamp and the vesting duration of the vesting contract.

release

Release the tokens that have already vested. Emits a {ERC20Released} event.

start

Getter for the start timestamp.

Returns

Name
Type
Description

<none>

uint256

start timestamp

duration

Getter for the vesting duration.

Returns

Name
Type
Description

<none>

uint256

duration seconds

end

Getter for the end timestamp.

Returns

Name
Type
Description

<none>

uint256

end timnestamp

released

Getter for the amount of token already released

Returns

Name
Type
Description

<none>

uint256

amount of tokens released so far

releasable

Getter for the amount of vested ERC20 tokens.

Returns

Name
Type
Description

<none>

uint256

amount of vested tokens

vestedAmount

Calculates the amount of tokens that has already vested. Default implementation is a linear vesting curve.

Parameters

Name
Type
Description

timestamp

uint64

current timestamp

Returns

Name
Type
Description

<none>

uint256

amount vested

_vestingSchedule

Virtual implementation of the vesting formula. This returns the amount vested, as a function of time, for an asset given its total historical allocation.

Parameters

Name
Type
Description

totalAllocation

uint256

initial amount

timestamp

uint64

current timestamp

Returns

Name
Type
Description

<none>

uint256

amount vested

Last updated