TokenVesting
contract TokenVesting
is Ownable
A token holder contract that can release its token balance gradually like a typical vesting scheme, with a cliff and vesting period. Optionally revocable by the owner.
Source: token/ERC20/TokenVesting.sol
Reference
Events
Released
event Released(uint256 amount)
- Parameters:
amount
- uint256
Revoked
event Revoked()
Functions
fallback
function (address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, bool _revocable) public
Creates a vesting contract that vests its balance of any ERC20 token to the _beneficiary, gradually in a linear fashion until _start + _duration. By then all of the balance will have vested.
- Parameters:
_beneficiary
- address of the beneficiary to whom vested tokens are transferred_start
- the time (as Unix time) at which point vesting starts_cliff
- duration in seconds of the cliff in which tokens will begin to vest_duration
- duration in seconds of the period in which the tokens will vest_revocable
- whether the vesting is revocable or not
releasableAmount
function releasableAmount(ERC20Basic token) public view returns (uint256)
Calculates the amount that has already vested but hasn't been released yet.
- Parameters:
token
- ERC20 token which is being vested- Returns:
- uint256
release
function release(ERC20Basic token) public
Transfers vested tokens to beneficiary.
- Parameters:
token
- ERC20 token which is being vested
revoke
function revoke(ERC20Basic token) public
Allows the owner to revoke the vesting. Tokens already vested remain in the contract, the rest are returned to the owner.
- Modifiers:
- onlyOwner
- Parameters:
token
- ERC20 token which is being vested
vestedAmount
function vestedAmount(ERC20Basic token) public view returns (uint256)
Calculates the amount that has already vested.
- Parameters:
token
- ERC20 token which is being vested- Returns:
- uint256