Skip to content

Commit 972bf33

Browse files
committed
fix: vesting start time
1 parent c996e89 commit 972bf33

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/tokenDistribution/vesting/Vesting.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ contract Vesting is IVesting, Initializable {
124124
* @param schedule The structure that defines the vesting schedule
125125
*/
126126
function _initializeSchedule(Schedule calldata schedule) private {
127-
if (schedule.startTime < block.timestamp) {
127+
if (schedule.startTime == 0) {
128128
revert InvalidStartTime();
129129
}
130130

test/tokenDistribution/vesting/Vesting.t.sol

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,17 @@ contract VestingTest is Test {
120120
vesting.initialize(META, schedule, beneficiaries);
121121
}
122122

123-
function test_deploy_revertIfInvalidStartTime(uint64 blockTimestamp, uint64 invalidBlockTimestamp) external {
123+
function test_deploy_revertIfInvalidStartTime() external {
124124
(Beneficiary[] memory beneficiaries, Schedule memory schedule) = _getBeneficiariesAndSchedule();
125125

126-
blockTimestamp = uint64(bound(blockTimestamp, 1, type(uint64).max));
127-
invalidBlockTimestamp = uint64(bound(invalidBlockTimestamp, 0, blockTimestamp - 1));
128-
schedule.startTime = invalidBlockTimestamp;
126+
schedule.startTime = 0;
129127

130128
Vesting vestingImpl = new Vesting();
131129
address vestingAddress = Clones.clone(address(vestingImpl));
132130

133131
vm.prank(distributor);
134132
META.transfer(vestingAddress, VESTING_TOTAL_AMOUNT);
135133

136-
vm.warp(blockTimestamp);
137134
vm.expectRevert(IVesting.InvalidStartTime.selector);
138135

139136
Vesting(vestingAddress).initialize(META, schedule, beneficiaries);

0 commit comments

Comments
 (0)