    function mint(
        TimeswapV2OptionMintParam calldata param
    ) external override noDelegateCall returns (uint256 token0AndLong0Amount, uint256 token1AndLong1Amount, uint256 shortAmount, bytes memory data) {
        ...

        Option storage option = options[param.strike][param.maturity];

        // does main mint logic calculation
        (token0AndLong0Amount, token1AndLong1Amount, shortAmount) = option.mint(param.strike, param.long0To, param.long1To, param.shortTo, param.transaction, param.amount0, param.amount1);

        // update token0 and token1 balance target for any previous concurrent option transactions.
        processing.updateProcess(token0AndLong0Amount, token1AndLong1Amount, true, true);

        // add a new process
        // stores the token0 and token1 balance target required from the msg.sender to achieve.
        Process storage currentProcess = (processing.push() = Process(
            param.strike,
            param.maturity,
            IERC20(token0).balanceOf(address(this)) + token0AndLong0Amount,
            IERC20(token1).balanceOf(address(this)) + token1AndLong1Amount
        ));

        // ask the msg.sender to transfer token0 and/or token1 to this contract.
        data = ITimeswapV2OptionMintCallback(msg.sender).timeswapV2OptionMintCallback(
            TimeswapV2OptionMintCallbackParam({
                strike: param.strike,
                maturity: param.maturity,
                token0AndLong0Amount: token0AndLong0Amount,
                token1AndLong1Amount: token1AndLong1Amount,
                shortAmount: shortAmount,
                data: param.data
            })
        );

        // check if the token0 balance target is achieved.
        if (token0AndLong0Amount != 0) Error.checkEnough(IERC20(token0).balanceOf(address(this)), currentProcess.balance0Target);

        // check if the token1 balance target is achieved.
        if (token1AndLong1Amount != 0) Error.checkEnough(IERC20(token1).balanceOf(address(this)), currentProcess.balance1Target);

        ...
    }
    function swap(TimeswapV2OptionSwapParam calldata param) external override noDelegateCall returns (uint256 token0AndLong0Amount, uint256 token1AndLong1Amount, bytes memory data) {
        ...

        Option storage option = options[param.strike][param.maturity];

        // does main swap logic calculation
        (token0AndLong0Amount, token1AndLong1Amount) = option.swap(param.strike, param.longTo, param.isLong0ToLong1, param.transaction, param.amount);

        // update token0 and token1 balance target for any previous concurrent option transactions.
        processing.updateProcess(token0AndLong0Amount, token1AndLong1Amount, !param.isLong0ToLong1, param.isLong0ToLong1);

        // add a new process
        // stores the token0 and token1 balance target required from the msg.sender to achieve.
        Process storage currentProcess = (processing.push() = Process(
            param.strike,
            param.maturity,
            param.isLong0ToLong1 ? IERC20(token0).balanceOf(address(this)) - token0AndLong0Amount : IERC20(token0).balanceOf(address(this)) + token0AndLong0Amount,
            param.isLong0ToLong1 ? IERC20(token1).balanceOf(address(this)) + token1AndLong1Amount : IERC20(token1).balanceOf(address(this)) - token1AndLong1Amount
        ));

        // transfer token to recipient.
        IERC20(param.isLong0ToLong1 ? token0 : token1).safeTransfer(param.tokenTo, param.isLong0ToLong1 ? token0AndLong0Amount : token1AndLong1Amount);

        // ask the msg.sender to transfer token0 or token1 to this contract.
        data = ITimeswapV2OptionSwapCallback(msg.sender).timeswapV2OptionSwapCallback(
            TimeswapV2OptionSwapCallbackParam({
                strike: param.strike,
                maturity: param.maturity,
                isLong0ToLong1: param.isLong0ToLong1,
                token0AndLong0Amount: token0AndLong0Amount,
                token1AndLong1Amount: token1AndLong1Amount,
                data: param.data
            })
        );

        // check if the token0 or token1 balance target is achieved.
        Error.checkEnough(IERC20(param.isLong0ToLong1 ? token1 : token0).balanceOf(address(this)), param.isLong0ToLong1 ? currentProcess.balance1Target : currentProcess.balance0Target);

        ...
    }
