Openzeppelin-contracts: Examples on TokenTimeLock and TokenVesting

Created on 24 Jan 2018  路  3Comments  路  Source: OpenZeppelin/openzeppelin-contracts

  • [ ] 馃悰 This is a bug report.
  • [x] 馃搱 This is a feature request.

Thanks for the awesome contributions Zeppelin team. I wonder if there're any examples or tutorials on how to use TokenTimeLock and TokenVesting specifically?

documentation good first issue

Most helpful comment

@xiaoyao1991 unit test are providing a good start

https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/test/token/TokenVesting.test.js

https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/test/token/TokenTimelock.test.js

or in solidity

uint256 public constant VESTING_CLIFF = 1 years;
uint256 public constant VESTING_DURATION = 3 years;

MintableToken token = new MintableToken();
TokenVesting newVault = new TokenVesting(beneficiary, now, VESTING_CLIFF, VESTING_DURATION, false);
token.mint(address(newVault), _tokens);

All 3 comments

Agreed @xiaoyao1991! There are no examples currently.

@xiaoyao1991 unit test are providing a good start

https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/test/token/TokenVesting.test.js

https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/test/token/TokenTimelock.test.js

or in solidity

uint256 public constant VESTING_CLIFF = 1 years;
uint256 public constant VESTING_DURATION = 3 years;

MintableToken token = new MintableToken();
TokenVesting newVault = new TokenVesting(beneficiary, now, VESTING_CLIFF, VESTING_DURATION, false);
token.mint(address(newVault), _tokens);

@cedricwalter Thanks! I'll take a look

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryana picture ryana  路  4Comments

sebastien-kr picture sebastien-kr  路  4Comments

bsadeh picture bsadeh  路  4Comments

rstormsf picture rstormsf  路  4Comments

maraoz picture maraoz  路  3Comments