Vesting

Git Source

Inherits: IVesting, AbstractUtilityContract, Ownable

Manages token vesting schedules for beneficiaries

Inherits IVesting, AbstractUtilityContract, Ownable

State Variables

token

The ERC20 token that is being vested

IERC20 public token;

allocatedTokens

The total amount of tokens that have been allocated for vesting

uint256 public allocatedTokens;

vestings

A mapping of beneficiary addresses to their vesting information

mapping(address => IVesting.VestingInfo) public vestings;

Functions

constructor

Initializes the contract with deploy manager, token, and owner

constructor() payable Ownable(msg.sender);

claim

Claims all tokens currently available for the caller according to their vesting schedule

function claim() public;

startVesting

Creates a new vesting schedule for a beneficiary

function startVesting(IVesting.VestingParams calldata params) external onlyOwner;

Parameters

NameTypeDescription
paramsIVesting.VestingParamsStruct containing the parameters for the new vesting schedule

withdrawUnallocated

Withdraws all unallocated tokens from the contract to the specified address

function withdrawUnallocated(address _to) external onlyOwner;

Parameters

NameTypeDescription
_toaddressAddress to receive the withdrawn tokens

initialize

function initialize(bytes memory _initData) external override notInitialized returns (bool);

vestedAmount

Returns the total amount of tokens vested for a beneficiary at the current time

function vestedAmount(address _claimer) public view returns (uint256);

Parameters

NameTypeDescription
_claimeraddressAddress of the beneficiary

Returns

NameTypeDescription
<none>uint256Amount of tokens vested

claimableAmount

Returns the amount of tokens that can currently be claimed by a beneficiary

function claimableAmount(address _claimer) public view returns (uint256);

Parameters

NameTypeDescription
_claimeraddressAddress of the beneficiary

Returns

NameTypeDescription
<none>uint256Amount of tokens claimable

getVestingInfo

Returns the information about a vesting schedule for a beneficiary

function getVestingInfo(address _claimer) public view returns (IVesting.VestingInfo memory);

Parameters

NameTypeDescription
_claimeraddressAddress of the beneficiary

Returns

NameTypeDescription
<none>IVesting.VestingInfoVestingInfo struct containing the vesting information

getInitData

Returns the ABI-encoded initialization data for the contract

function getInitData(address _deployManager, address _token, address _owner) external pure returns (bytes memory);

Parameters

NameTypeDescription
_deployManageraddressAddress of the deploy manager
_tokenaddressAddress of the ERC20 token
_owneraddressAddress of the contract owner

Returns

NameTypeDescription
<none>bytesABI-encoded initialization data