Create Fee Discount Feature Is Broken
The create fee discount feature is found to be broken within the protocol.\\nThe create fee discount feature relies on the `createFeeDiscount` state variable to determine the fee to be discounted from the protocol fee. However, it was observed that there is no way to initialize the `createFeeDiscount` state variable. As a result, the `createFeeDiscount` state variable will always be zero.\\n```\\nFile: BondFixedExpiryTeller.sol\\n        // If fee is greater than the create discount, then calculate the fee and store it\\n        // Otherwise, fee is zero.\\n        if (protocolFee > createFeeDiscount) {\\n            // Calculate fee amount\\n            uint256 feeAmount = amount_.mulDiv(protocolFee - createFeeDiscount, FEE_DECIMALS);\\n            rewards[_protocol][underlying_] += feeAmount;\\n\\n            // Mint new bond tokens\\n            bondToken.mint(msg.sender, amount_ - feeAmount);\\n\\n            return (bondToken, amount_ - feeAmount);\\n        } else {\\n            // Mint new bond tokens\\n            bondToken.mint(msg.sender, amount_);\\n\\n            return (bondToken, amount_);\\n        }\\n```\\n\\n```\\nFile: BondFixedTermTeller.sol\\n        // If fee is greater than the create discount, then calculate the fee and store it\\n        // Otherwise, fee is zero.\\n        if (protocolFee > createFeeDiscount) {\\n            // Calculate fee amount\\n            uint256 feeAmount = amount_.mulDiv(protocolFee - createFeeDiscount, FEE_DECIMALS);\\n            rewards[_protocol][underlying_] += feeAmount;\\n\\n            // Mint new bond tokens\\n            _mintToken(msg.sender, tokenId, amount_ - feeAmount);\\n\\n            return (tokenId, amount_ - feeAmount);\\n        } else {\\n            // Mint new bond tokens\\n            _mintToken(msg.sender, tokenId, amount_);\\n\\n            return (tokenId, amount_);\\n        }\\n```\\n
Implement a setter method for the `createFeeDiscount` state variable and the necessary verification checks.\\n```\\nfunction setCreateFeeDiscount(uint48 createFeeDiscount_) external requiresAuth {\\n    if (createFeeDiscount_ > protocolFee)  revert Teller_InvalidParams();\\n    if (createFeeDiscount_ > 5e3) revert Teller_InvalidParams();\\n    createFeeDiscount = createFeeDiscount_;\\n}\\n```\\n
The create fee discount feature is broken within the protocol. There is no way for the protocol team to configure a discount for the users of the `BondFixedExpiryTeller.create` and `BondFixedTermTeller.create` functions. As such, the users will not obtain any discount from the protocol when using the create function.
```\\nFile: BondFixedExpiryTeller.sol\\n        // If fee is greater than the create discount, then calculate the fee and store it\\n        // Otherwise, fee is zero.\\n        if (protocolFee > createFeeDiscount) {\\n            // Calculate fee amount\\n            uint256 feeAmount = amount_.mulDiv(protocolFee - createFeeDiscount, FEE_DECIMALS);\\n            rewards[_protocol][underlying_] += feeAmount;\\n\\n            // Mint new bond tokens\\n            bondToken.mint(msg.sender, amount_ - feeAmount);\\n\\n            return (bondToken, amount_ - feeAmount);\\n        } else {\\n            // Mint new bond tokens\\n            bondToken.mint(msg.sender, amount_);\\n\\n            return (bondToken, amount_);\\n        }\\n```\\n