endTime = _endTime;
numOfSteps = _numOfSteps;
stepDuration = (_endTime - _startTime) / _numOfSteps;
function claim() external {
    (uint256 claimableAmount, uint256 claimableSteps) = claimable(
        msg.sender
    );
uint256 currentStep = elapsedTime / stepDuration;
import "lib/forge-std/src/Test.sol";
import "lib/forge-std/src/console2.sol";
import {SecondSwap_Marketplace} from "../contracts/SecondSwap_Marketplace.sol";
import {SecondSwap_MarketplaceSetting} from "../contracts/SecondSwap_MarketplaceSetting.sol";
import {SecondSwap_StepVesting} from "../contracts/SecondSwap_StepVesting.sol";
import {SecondSwap_VestingDeployer} from "../contracts/SecondSwap_VestingDeployer.sol";
import {SecondSwap_VestingManager} from "../contracts/SecondSwap_VestingManager.sol";
import {TestToken1} from "../contracts/USDT.sol";

contract sl1Test is Test {
    SecondSwap_Marketplace public marketplace;
    SecondSwap_MarketplaceSetting public marketplaceSettings;
    SecondSwap_VestingDeployer public vestingDeployer;
    SecondSwap_VestingManager public vestingManager;
    TestToken1 public USDT;

    address admin = makeAddr("admin");
    address whitelist;

    function setUp() public {
        vm.startPrank(admin);
        USDT = new TestToken1();
        vestingManager = new SecondSwap_VestingManager();
        vestingManager.initialize(admin);
        marketplaceSettings = new SecondSwap_MarketplaceSetting(
            admin,
            admin,
            whitelist,
            address(vestingManager),
            address(USDT)
        );
        marketplace = new SecondSwap_Marketplace();
        marketplace.initialize(address(USDT), address(marketplaceSettings));
        vestingDeployer = new SecondSwap_VestingDeployer();
        vestingDeployer.initialize(admin, address(vestingManager));

        vestingManager.setVestingDeployer(address(vestingDeployer));
        vestingManager.setMarketplace(address(marketplace));
        vm.stopPrank();
    }

    function test_sl1VestingCompletedEarlier() public {
        address alice = makeAddr("alice");

        vm.startPrank(admin);

        vestingDeployer.setTokenOwner(address(USDT), admin);
        // step duration is 7.884, but it rounds down to 7
        vestingDeployer.deployVesting(
            address(USDT),
            block.timestamp,
            // 3 month vesting
            block.timestamp + 7884000,
            // num of steps
            1000000,
            "1"
        );
        // Got the address by console logging it in deployVesting func
        address stepVesting = 0xD478411c1478E645A6bb53209E689080aE5101A1;

        USDT.approve(stepVesting, 10000e18);
        vestingDeployer.createVesting(alice, 10000e18, stepVesting);

        vm.stopPrank();

        // vesting completed 884000 earlier, which is 10 days earlier than the schedule
        vm.warp(block.timestamp + 1000000 * 7);
        vm.prank(alice);
        SecondSwap_StepVesting(stepVesting).claim();
        assertEq(USDT.balanceOf(alice), 10000e18);
    }
