@@ -6,14 +6,16 @@ import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
66/// @title Vesting Manager with Vesting Schedules
77contract VestingManager {
88 IERC20 public immutable token;
9- uint64 public immutable tgeTimestamp;
9+ uint256 public immutable tgeTimestamp;
1010
1111 uint32 public constant PPM = 1_000_000 ; // 100%
1212 uint64 public constant MONTH = 30 days ;
13+ uint64 public constant SEASON = 3 * MONTH;
14+ uint64 public constant YEAR = 12 * MONTH;
1315
1416 struct Term {
1517 uint32 percentage;
16- uint64 cliff;
18+ uint256 cliff;
1719 uint64 period;
1820 uint16 num;
1921 uint16 next;
@@ -32,7 +34,7 @@ contract VestingManager {
3234 event ScheduleCreated (uint256 indexed id , address indexed beneficiary , uint256 totalAmount );
3335 event Vested (uint256 indexed id , address indexed beneficiary , uint256 indexed termIndex , uint256 periodIdx , uint256 amount );
3436
35- constructor (address _token , uint64 _tgeTimestamp , address [] memory beneficiaries ) {
37+ constructor (address _token , uint256 _tgeTimestamp , address [] memory beneficiaries ) {
3638 require (_token != address (0 ), "token zero " );
3739 require (beneficiaries.length == 12 , "need 12 addresses " );
3840 token = IERC20 (_token);
@@ -53,25 +55,23 @@ contract VestingManager {
5355
5456 Term[] memory terms;
5557 {
56- terms = new Term [](2 );
57- terms[0 ] = Term ({ percentage: 50_000 , cliff: 0 , period: 0 , num: 1 , next: 0 });
58- terms[1 ] = Term ({ percentage: 950_000 , cliff: MONTH, period: MONTH, num: 60 , next: 0 });
58+ terms = new Term [](1 );
59+ terms[0 ] = Term ({ percentage: PPM, cliff: 0 , period: SEASON, num: 20 , next: 0 });
5960 _createScheduleInternal (beneficiaries[0 ], A_device, terms);
6061 }
6162 {
62- terms = new Term [](2 );
63- terms[0 ] = Term ({ percentage: 50_000 , cliff: 0 , period: 0 , num: 1 , next: 0 });
64- terms[1 ] = Term ({ percentage: 950_000 , cliff: MONTH, period: MONTH, num: 60 , next: 0 });
63+ terms = new Term [](1 );
64+ terms[0 ] = Term ({ percentage: PPM, cliff: 0 , period: SEASON, num: 20 , next: 0 });
6565 _createScheduleInternal (beneficiaries[1 ], A_node, terms);
6666 }
6767 {
6868 terms = new Term [](1 );
69- terms[0 ] = Term ({ percentage: PPM, cliff: 12 * MONTH , period: MONTH , num: 36 , next: 0 });
69+ terms[0 ] = Term ({ percentage: PPM, cliff: YEAR , period: SEASON , num: 8 , next: 0 });
7070 _createScheduleInternal (beneficiaries[2 ], A_preseed, terms);
7171 }
7272 {
7373 terms = new Term [](1 );
74- terms[0 ] = Term ({ percentage: PPM, cliff: 12 * MONTH , period: MONTH , num: 24 , next: 0 });
74+ terms[0 ] = Term ({ percentage: PPM, cliff: YEAR , period: SEASON , num: 8 , next: 0 });
7575 _createScheduleInternal (beneficiaries[3 ], A_seed, terms);
7676 }
7777 {
@@ -82,23 +82,23 @@ contract VestingManager {
8282 {
8383 terms = new Term [](2 );
8484 terms[0 ] = Term ({ percentage: 250_000 , cliff: 0 , period: 0 , num: 1 , next: 0 });
85- terms[1 ] = Term ({ percentage: 750_000 , cliff: MONTH , period: MONTH , num: 60 , next: 0 });
85+ terms[1 ] = Term ({ percentage: 750_000 , cliff: SEASON , period: SEASON , num: 20 , next: 0 });
8686 _createScheduleInternal (beneficiaries[5 ], A_pos, terms);
8787 }
8888 {
8989 terms = new Term [](2 );
9090 terms[0 ] = Term ({ percentage: 400_000 , cliff: 0 , period: 0 , num: 1 , next: 0 });
91- terms[1 ] = Term ({ percentage: 600_000 , cliff: MONTH , period: MONTH , num: 12 , next: 0 });
91+ terms[1 ] = Term ({ percentage: 600_000 , cliff: SEASON , period: SEASON , num: 4 , next: 0 });
9292 _createScheduleInternal (beneficiaries[6 ], A_found, terms);
9393 }
9494 {
9595 terms = new Term [](1 );
96- terms[0 ] = Term ({ percentage: PPM, cliff: 12 * MONTH , period: MONTH , num: 36 , next: 0 });
96+ terms[0 ] = Term ({ percentage: PPM, cliff: YEAR , period: SEASON , num: 12 , next: 0 });
9797 _createScheduleInternal (beneficiaries[7 ], A_team, terms);
9898 }
9999 {
100100 terms = new Term [](1 );
101- terms[0 ] = Term ({ percentage: PPM, cliff: 12 * MONTH , period: MONTH , num: 36 , next: 0 });
101+ terms[0 ] = Term ({ percentage: PPM, cliff: YEAR , period: SEASON , num: 12 , next: 0 });
102102 _createScheduleInternal (beneficiaries[8 ], A_adv, terms);
103103 }
104104 {
@@ -109,8 +109,8 @@ contract VestingManager {
109109 {
110110 terms = new Term [](3 );
111111 terms[0 ] = Term ({ percentage: 250_000 , cliff: 0 , period: 0 , num: 1 , next: 0 });
112- terms[1 ] = Term ({ percentage: 250_000 , cliff: 3 * MONTH , period: 0 , num: 1 , next: 0 });
113- terms[2 ] = Term ({ percentage: 500_000 , cliff: 6 * MONTH , period: 0 , num: 1 , next: 0 });
112+ terms[1 ] = Term ({ percentage: 250_000 , cliff: SEASON , period: 0 , num: 1 , next: 0 });
113+ terms[2 ] = Term ({ percentage: 500_000 , cliff: 2 * SEASON , period: 0 , num: 1 , next: 0 });
114114 _createScheduleInternal (beneficiaries[10 ], A_comm, terms);
115115 }
116116 {
0 commit comments