```\nfunction bootstrapNewTokenWithBonus(\n  address inputToken,\n  uint256 maxInputAmount,\n  address outputToken,\n  address bonusToken\n) external onlyListedToken(bonusToken) override returns (uint256 bonusAmount) {\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  // Collect parameters required to calculate bonus\n  uint256 bonusFactor = uint256(DFPconfig.delistingBonus);\n  uint64 fractionBootstrapped = bootstrapNewToken(inputToken, maxInputAmount, outputToken);\n\n  // Balance of selected bonus token\n  uint256 bonusBalance;\n  if (bonusToken == address(0)) {\n    bonusBalance = address(this).balance;\n  } else {\n    bonusBalance = IERC20(bonusToken).balanceOf(address(this));\n  }\n\n  // Calculate bonus amount\n  bonusAmount = uint256(fractionBootstrapped) * bonusFactor * bonusBalance >> 128;\n\n  // Payout bonus tokens\n  if (bonusToken == address(0)) {\n    address payable sender = payable(msg.sender);\n    sender.transfer(bonusAmount);\n  } else {\n    IERC20(bonusToken).safeTransfer(msg.sender, bonusAmount);\n  }\n\n  // Emit event to enable data driven governance\n  emit BootstrapBonus(\n    msg.sender,\n    bonusToken,\n    bonusAmount\n  );\n}\n```\n