```\nfunction bootstrapNewToken(\n  address inputToken,\n  uint256 maxInputAmount,\n  address outputToken\n) public override returns (uint64 fractionBootstrapped) {\n  // Check whether the valid token is being bootstrapped\n  TokenSettings memory tokenToList = listedTokens[inputToken];\n  require(\n    tokenToList.state == State.PreListing,\n    "DFP: Wrong token"\n  );\n\n  // Calculate how many tokens to actually take in (clamp at max available)\n  uint256 initialInputBalance = IERC20(inputToken).balanceOf(address(this));\n  uint256 availableAmount;\n\n  // Intentionally underflow (zero clamping) is the cheapest way to gracefully prevent failing when target is already met\n  unchecked { availableAmount = tokenToList.listingTarget - initialInputBalance; }\n  if (initialInputBalance >= tokenToList.listingTarget) { availableAmount = 1; }\n  uint256 actualInputAmount = maxInputAmount > availableAmount ? availableAmount : maxInputAmount;\n\n  // Actually pull the tokens in\n  IERC20(inputToken).safeTransferFrom(msg.sender, address(this), actualInputAmount);\n\n  // Check whether the output token requested is indeed being delisted\n  TokenSettings memory tokenToDelist = listedTokens[outputToken];\n  require(\n    tokenToDelist.state == State.Delisting,\n    "DFP: Wrong token"\n  );\n\n  // Check how many of the output tokens should be given out and transfer those\n  uint256 initialOutputBalance = IERC20(outputToken).balanceOf(address(this));\n  uint256 outputAmount = actualInputAmount * initialOutputBalance / availableAmount;\n  IERC20(outputToken).safeTransfer(msg.sender, outputAmount);\n  fractionBootstrapped = uint64((actualInputAmount << 64) / tokenToList.listingTarget);\n\n  // Emit event for better governance decisions\n  emit Bootstrapped(\n    msg.sender,\n    inputToken,\n    actualInputAmount,\n    outputToken,\n    outputAmount\n  );\n\n  // If the input token liquidity is now at the target we complete the (de)listing\n  if (actualInputAmount == availableAmount) {\n    tokenToList.state = State.Listed;\n    listedTokens[inputToken] = tokenToList;\n    delete listedTokens[outputToken];\n    delete listingUpdate;\n    DFPconfig.delistingBonus = 0;\n    emit BootstrapCompleted(outputToken, inputToken);\n  }\n}\n```\n