```\nFile: Tranche.sol\n    function issue(\n        address to,\n        uint256 underlyingAmount\n    ) external nonReentrant whenNotPaused notExpired returns (uint256 issued) {\n..SNIP..\n        // Transfer underlying from user to adapter and deposit it into adapter to get target token\n        _underlying.safeTransferFrom(msg.sender, address(adapter), underlyingAmount);\n        (, uint256 sharesMinted) = adapter.prefundedDeposit();\n\n        // Deduct the issuance fee from the amount of target token minted + reinvested yield\n        // Fee should be rounded up towards the protocol (against the user) so that issued principal is rounded down\n        // Hackmd: F0\n        // ptIssued\n        // = (u/s + y - fee) * S\n        // = (sharesUsed - fee) * S\n        // where u = underlyingAmount, s = current scale, y = reinvested yield, S = maxscale\n        uint256 sharesUsed = sharesMinted + accruedInTarget;\n        uint256 fee = sharesUsed.mulDivUp(issuanceFeeBps, MAX_BPS);\n        issued = (sharesUsed - fee).mulWadDown(_maxscale);\n\n        // Accumulate issueance fee in units of target token\n        issuanceFees += fee;\n        // Mint PT and YT to user\n        _mint(to, issued);\n        _yt.mint(to, issued);\n\n        emit Issue(msg.sender, to, issued, sharesUsed);\n    }\n\n```\n