```\n    // Need to transfer before minting or ERC777s could reenter.\n    asset.safeTransferFrom(msg.sender, address(this), assets);\n\n    _mint(receiver, shares);\n\n    emit Deposit(msg.sender, receiver, assets, shares);\n\n    afterDeposit(assets, shares);\n}\n\n  function previewMint(uint256 shares) public view virtual returns (uint256) {\n    uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.\n\n    return supply == 0 ? shares : shares.mulDivUp(totalAssets(), supply);\n}\n```\n