diff --git a/src/KSXVault.sol b/src/KSXVault.sol index 638d4db..edba91d 100644 --- a/src/KSXVault.sol +++ b/src/KSXVault.sol @@ -143,7 +143,7 @@ contract KSXVault is ERC4626, Ownable, Initializable { if (!isAuctionReady()) { revert AuctionNotReady(); } - + _updateLastAuctionStartTime(); Auction auction = auctionFactory.createAuction({ diff --git a/test/KSXVault.t.sol b/test/KSXVault.t.sol index 6652b26..384a678 100644 --- a/test/KSXVault.t.sol +++ b/test/KSXVault.t.sol @@ -143,7 +143,7 @@ contract KSXVaultAuctionTest is KSXVaultTest { function test_isAuctionReady_next_week() public { vm.warp(DEFAULT_START_TIME); - vm.warp(block.timestamp + DEFAULT_EPOCH_DURATION - 1); + vm.warp(block.timestamp + DEFAULT_EPOCH_DURATION - 1); assertEq(ksxVault.isAuctionReady(), false); vm.warp(block.timestamp + 1); assertEq(ksxVault.isAuctionReady(), true); @@ -172,8 +172,9 @@ contract KSXVaultAuctionTest is KSXVaultTest { vm.prank(PDAOADDR); ksxVault.setEpochDuration(MIN_EPOCH_DURATION); /// @dev you have to wait until the end of the epoch duration - /// you just set (we were midway through the day because of (DEFAULT_EPOCH_DURATION / 2)) - vm.warp(block.timestamp + .5 days - 1); + /// you just set (we were midway through the day because of + /// (DEFAULT_EPOCH_DURATION / 2)) + vm.warp(block.timestamp + 0.5 days - 1); assertEq(ksxVault.isAuctionReady(), false); vm.warp(block.timestamp + 1); assertEq(ksxVault.isAuctionReady(), true); @@ -198,7 +199,7 @@ contract KSXVaultAuctionTest is KSXVaultTest { vm.warp(DEFAULT_START_TIME + MAX_EPOCH_DURATION - 1); assertEq(ksxVault.isAuctionReady(), false); vm.warp(block.timestamp + DEFAULT_EPOCH_DURATION + 1); - assertEq(ksxVault.isAuctionReady(), true); + assertEq(ksxVault.isAuctionReady(), true); } /// @notice test isAuctionReady reverts until the startTime @@ -313,7 +314,12 @@ contract KSXVaultAuctionTest is KSXVaultTest { } function test_setEpochDuration_onlyOwner() public { - vm.expectRevert(abi.encodeWithSelector(OwnableUnauthorizedAccount.selector, 0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496)); + vm.expectRevert( + abi.encodeWithSelector( + OwnableUnauthorizedAccount.selector, + 0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496 + ) + ); ksxVault.setEpochDuration(2 weeks); } @@ -326,7 +332,9 @@ contract KSXVaultAuctionTest is KSXVaultTest { test_createAuction(); } - function testFuzzStartTime_createAuction_AuctionNotReady(uint128 startTime) public { + function testFuzzStartTime_createAuction_AuctionNotReady(uint128 startTime) + public + { fuzzStartTime(startTime); test_createAuction_AuctionNotReady(); } @@ -336,27 +344,41 @@ contract KSXVaultAuctionTest is KSXVaultTest { test_isAuctionReady(); } - function testFuzzStartTime_isAuctionReady_before_start(uint128 startTime) public { + function testFuzzStartTime_isAuctionReady_before_start(uint128 startTime) + public + { fuzzStartTime(startTime); test_isAuctionReady_before_start(); } - function testFuzzStartTime_isAuctionReady_before_start_fuzz(uint128 startTime) public { + function testFuzzStartTime_isAuctionReady_before_start_fuzz( + uint128 startTime + ) + public + { fuzzStartTime(startTime); test_isAuctionReady_before_start_fuzz(startTime); } - function testFuzzStartTime_isAuctionReady_next_week(uint128 startTime) public { + function testFuzzStartTime_isAuctionReady_next_week(uint128 startTime) + public + { fuzzStartTime(startTime); test_isAuctionReady_next_week(); } - function testFuzzStartTime_isAuctionReady_set_one_day(uint128 startTime) public { + function testFuzzStartTime_isAuctionReady_set_one_day(uint128 startTime) + public + { fuzzStartTime(startTime); test_isAuctionReady_set_one_day(); } - function testFuzzStartTime_isAuctionReady_set_one_day_then_4_weeks(uint128 startTime) public { + function testFuzzStartTime_isAuctionReady_set_one_day_then_4_weeks( + uint128 startTime + ) + public + { fuzzStartTime(startTime); test_isAuctionReady_set_one_day_then_4_weeks(); } @@ -366,22 +388,33 @@ contract KSXVaultAuctionTest is KSXVaultTest { test_setEpochDuration(); } - function testFuzzStartTime_setEpochDuration_Invalid(uint128 startTime) public { + function testFuzzStartTime_setEpochDuration_Invalid(uint128 startTime) + public + { fuzzStartTime(startTime); test_setEpochDuration_Invalid(); } - function testFuzzStartTime_setEpochDuration_before_start(uint128 startTime) public { + function testFuzzStartTime_setEpochDuration_before_start(uint128 startTime) + public + { fuzzStartTime(startTime); test_setEpochDuration_before_start(); } - function testFuzzStartTime_setEpochDuration_fuzz(uint128 startTime, uint256 duration) public { + function testFuzzStartTime_setEpochDuration_fuzz( + uint128 startTime, + uint256 duration + ) + public + { fuzzStartTime(startTime); test_setEpochDuration_fuzz(duration); } - function testFuzzStartTime_setEpochDuration_onlyOwner(uint128 startTime) public { + function testFuzzStartTime_setEpochDuration_onlyOwner(uint128 startTime) + public + { fuzzStartTime(startTime); test_setEpochDuration_onlyOwner(); }