Skip to content
Lattice

IVestingWallet

Git Source

Title: IVestingWallet

Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/finance/VestingWallet.sol)

External interface of VestingWallet for ERC-165 detection and consumer ABI.

Functions

start

Returns the start timestamp of the vesting schedule.

function start() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The Unix timestamp at which vesting begins.

duration

Returns the duration of the vesting schedule in seconds.

function duration() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The total duration of the vesting period.

end

Returns the end timestamp of the vesting schedule.

function end() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The Unix timestamp at which vesting completes (start + duration).

released

Returns the total amount of ETH already released.

function released() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The cumulative ETH released to the beneficiary.

released

Returns the total amount of a specific ERC20 token already released.

function released(address token) external view returns (uint256);

Parameters

NameTypeDescription
tokenaddressThe ERC20 token contract address.

Returns

NameTypeDescription
<none>uint256The cumulative token amount released to the beneficiary.

releasable

Returns the amount of ETH that can currently be released.

function releasable() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The releasable ETH amount (vested minus already released).

releasable

Returns the amount of a specific ERC20 token that can currently be released.

function releasable(address token) external view returns (uint256);

Parameters

NameTypeDescription
tokenaddressThe ERC20 token contract address.

Returns

NameTypeDescription
<none>uint256The releasable token amount (vested minus already released).

vestedAmount

Calculates the vested ETH amount at a given timestamp.

function vestedAmount(uint64 timestamp) external view returns (uint256);

Parameters

NameTypeDescription
timestampuint64The Unix timestamp to evaluate the vesting schedule at.

Returns

NameTypeDescription
<none>uint256The total ETH that would be vested at the given timestamp.

vestedAmount

Calculates the vested ERC20 token amount at a given timestamp.

function vestedAmount(address token, uint64 timestamp) external view returns (uint256);

Parameters

NameTypeDescription
tokenaddressThe ERC20 token contract address.
timestampuint64The Unix timestamp to evaluate the vesting schedule at.

Returns

NameTypeDescription
<none>uint256The total token amount that would be vested at the given timestamp.

release

Releases all currently releasable ETH to the beneficiary.

Anyone may call this; funds always go to the beneficiary (owner). Emits an EtherReleased event.

function release() external;

release

Releases all currently releasable tokens of a specific ERC20 to the beneficiary.

Anyone may call this; funds always go to the beneficiary (owner). Emits an ERC20Released event.

function release(address token) external;

Parameters

NameTypeDescription
tokenaddressThe ERC20 token contract address to release.

Events

EtherReleased

Emitted when ETH is released to the beneficiary.

event EtherReleased(uint256 amount);

Parameters

NameTypeDescription
amountuint256The amount of ETH released (in wei).

ERC20Released

Emitted when an ERC20 token is released to the beneficiary.

event ERC20Released(address indexed token, uint256 amount);

Parameters

NameTypeDescription
tokenaddressThe address of the ERC20 token contract.
amountuint256The amount of tokens released.

Errors

VestingWalletTransferFailed

ERC20 transfer to the beneficiary failed.

error VestingWalletTransferFailed(address token);

Parameters

NameTypeDescription
tokenaddressThe token whose transfer failed.

VestingWalletEtherTransferFailed

ETH transfer to the beneficiary failed.

error VestingWalletEtherTransferFailed();