@@ -7,8 +7,6 @@ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.s
77import {IVesting} from "./interfaces/IVesting.sol " ;
88import {Schedule, Period, Beneficiary} from "../utils/Common.sol " ;
99
10- // TODO: Проверить отчет на предмет замечаний
11-
1210/**
1311 * @title Vesting contract of the base token
1412 * @dev Each new vesting instance is created through a factory using the Minimal Clones pattern.
@@ -64,13 +62,8 @@ contract Vesting is IVesting, Initializable {
6462 * @dev The claimed amount will be store in _released mapping
6563 */
6664 function claim () external {
67- Schedule memory schedule = _schedule;
68-
69- if (block .timestamp < schedule.startTime) {
70- revert VestingHasNotStarted ();
71- }
72-
7365 uint256 unlockedAmount = availableToClaim (msg .sender );
66+
7467 if (unlockedAmount > 0 ) {
7568 _released[msg .sender ] += unlockedAmount;
7669 _baseToken.safeTransfer (msg .sender , unlockedAmount);
@@ -98,6 +91,9 @@ contract Vesting is IVesting, Initializable {
9891
9992 /// @notice Returns the total amount of locked tokens
10093 function totalLocked () external view returns (uint256 ) {
94+ // TODO: заменить на
95+ // uint256 initialTotalLocked = _initialTotalLocked;
96+ // return initialTotalLocked - _computeUnlocked(initialTotalLocked);
10197 return _initialTotalLocked - totalUnlocked ();
10298 }
10399
@@ -108,6 +104,9 @@ contract Vesting is IVesting, Initializable {
108104
109105 /// @notice Returns the amount of locked tokens for a specific account
110106 function lockedOf (address account ) external view returns (uint256 ) {
107+ // TODO: заменить на
108+ // uint256 initialLocked = _initialLocked[account];
109+ // return initialLocked - _computeUnlocked(initialLocked);
111110 return _initialLocked[account] - unlockedOf (account);
112111 }
113112
@@ -191,6 +190,7 @@ contract Vesting is IVesting, Initializable {
191190 }
192191
193192 _initialLocked[beneficiary.account] = beneficiary.amount;
193+ // TODO: переделать на чтение из memory и последующая запись в storage
194194 _initialTotalLocked += beneficiary.amount;
195195 }
196196
@@ -207,6 +207,7 @@ contract Vesting is IVesting, Initializable {
207207 * @return unlockedAmount The total amount of unlocked tokens
208208 */
209209 function _computeUnlocked (uint256 initialLockedAmount ) private view returns (uint256 unlockedAmount ) {
210+ // TODO: добавить _schedule в memory
210211 if (block .timestamp < _schedule.startTime) {
211212 return 0 ;
212213 }
0 commit comments