@@ -4,6 +4,13 @@ pragma solidity 0.8.28;
44import {IVestingParams} from "./interfaces/IVestingParams.sol " ;
55import {VestingType, Beneficiary, Schedule, Period} from "../utils/Common.sol " ;
66
7+ /**
8+ * @title Vesting params
9+ * @author Pavel Naydanov
10+ * @notice The contract describes the parameters of the launched vestings.
11+ * Includes: total amount of the vestings, the addresses of the beneficiaries, allocations, the unlocking schedule
12+ * The start time is common for all types of vesting. Start time and addresses of the beneficiaries are set during contract deployment.
13+ */
714contract VestingParams is IVestingParams {
815 uint256 public constant MONTH = 30 days ;
916
@@ -21,7 +28,10 @@ contract VestingParams is IVestingParams {
2128 uint256 public constant LIQUIDITY_CLIFF_PERIOD = 4 * MONTH; // 4 month
2229 uint256 public constant LIQUIDITY_VESTING_PORTION = 400 ; // 4%
2330
31+ /// @notice Start time of vestings
2432 uint64 private _startTime;
33+
34+ /// @notice List of beneficiaries for vesting type
2535 mapping (VestingType vestingType => Beneficiary[] beneficiaries ) private _beneficiaries;
2636
2737 constructor (
@@ -39,7 +49,12 @@ contract VestingParams is IVestingParams {
3949 _validateAndStoreBeneficiaries (VestingType.LIQUIDITY, liquidityBeneficiaries, LIQUIDITY_TOTAL_AMOUNT);
4050 }
4151
42- /// @dev Portions 100% equal 10_000. It's _BASIS_POINTS, which declared in Vesting contract
52+ /**
53+ * @notice Get schedule by vesting type
54+ * @param vestingType Type of vesting (Team, Liquidity, etc.)
55+ * @dev Portions 100% equal 10_000. It's _BASIS_POINTS, which declared in Vesting contract
56+ * @return schedule Schedule structure
57+ */
4358 function getSchedule (VestingType vestingType ) public view returns (Schedule memory schedule ) {
4459 (
4560 ,
@@ -69,14 +84,28 @@ contract VestingParams is IVestingParams {
6984 });
7085 }
7186
87+ /**
88+ * @notice Get beneficiaries by vesting type
89+ * @param vestingType Type of vesting (Team, Liquidity, etc.)
90+ * @return List of the beneficiaries
91+ */
7292 function getBeneficiaries (VestingType vestingType ) public view returns (Beneficiary[] memory ) {
7393 return _beneficiaries[vestingType];
7494 }
7595
96+ /**
97+ * @notice Get vesting constant by vesting type
98+ * @param vestingType Type of vesting (Team, Liquidity, etc.)
99+ * @return totalAmount Total amount of the vesting type
100+ * @return numberOfPeriods Number of vesting periods (includes tge and cliff periods)
101+ * @return tgePortions Unlocked tge portion based on BASIS_POINTS from vesting contract
102+ * @return cliffPeriod Duration time of the cliff period when unlocked amount is zero
103+ * @return vestingPortion Unlocked vesting period portion based on BASIS_POINTS from vesting contract
104+ */
76105 function getVestingConstant (VestingType vestingType )
77106 public
78107 pure
79- returns ( // TODO: описать возвращаемые значения в natspec
108+ returns (
80109 uint256 totalAmount ,
81110 uint256 numberOfPeriods ,
82111 uint256 tgePortions ,
@@ -85,26 +114,29 @@ contract VestingParams is IVestingParams {
85114 )
86115 {
87116 if (vestingType == VestingType.TEAM) {
88- return (
89- TEAM_TOTAL_AMOUNT,
90- TEAM_NUMBER_OF_PERIODS,
91- TEAM_TGE_PORTION,
92- TEAM_CLIFF_PERIOD,
93- TEAM_VESTING_PORTION
94- );
117+ totalAmount = TEAM_TOTAL_AMOUNT;
118+ numberOfPeriods = TEAM_NUMBER_OF_PERIODS;
119+ tgePortions = TEAM_TGE_PORTION;
120+ cliffPeriod = TEAM_CLIFF_PERIOD;
121+ vestingPortion = TEAM_VESTING_PORTION;
95122 }
96123
97124 if (vestingType == VestingType.LIQUIDITY) {
98- return (
99- LIQUIDITY_TOTAL_AMOUNT,
100- LIQUIDITY_NUMBER_OF_PERIODS,
101- LIQUIDITY_TGE_PORTION,
102- LIQUIDITY_CLIFF_PERIOD,
103- LIQUIDITY_VESTING_PORTION
104- );
125+ totalAmount = LIQUIDITY_TOTAL_AMOUNT;
126+ numberOfPeriods = LIQUIDITY_NUMBER_OF_PERIODS;
127+ tgePortions = LIQUIDITY_TGE_PORTION;
128+ cliffPeriod = LIQUIDITY_CLIFF_PERIOD;
129+ vestingPortion = LIQUIDITY_VESTING_PORTION;
105130 }
106131 }
107132
133+ /**
134+ * @notice Get vesting params by vesting type
135+ * @param vestingType Type of vesting (Team, Liquidity, etc.)
136+ * @return Schedule of the vesting
137+ * @return List of the beneficiaries
138+ * @return totalAmount Total amount of the vesting type
139+ */
108140 function getVestingParams (VestingType vestingType )
109141 external
110142 view
@@ -123,6 +155,7 @@ contract VestingParams is IVestingParams {
123155 );
124156 }
125157
158+ /// @notice Return start time for all vesting types
126159 function getStartTime () external view returns (uint64 ) {
127160 return _startTime;
128161 }
0 commit comments