You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
The create fee discount feature is found to be broken within the protocol.
Vulnerability Detail
The 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.
File: BondFixedTermTeller.sol
118: // If fee is greater than the create discount, then calculate the fee and store it119: // Otherwise, fee is zero.120: if (protocolFee > createFeeDiscount) {
121: // Calculate fee amount122: uint256 feeAmount = amount_.mulDiv(protocolFee - createFeeDiscount, FEE_DECIMALS);
123: rewards[_protocol][underlying_] += feeAmount;
124:
125: // Mint new bond tokens126: _mintToken(msg.sender, tokenId, amount_ - feeAmount);
127:
128: return (tokenId, amount_ - feeAmount);
129: } else {
130: // Mint new bond tokens131: _mintToken(msg.sender, tokenId, amount_);
132:
133: return (tokenId, amount_);
134: }
Impact
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.
xiaoming90
medium
Create Fee Discount Feature Is Broken
Summary
The create fee discount feature is found to be broken within the protocol.
Vulnerability Detail
The 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 thecreateFeeDiscount
state variable. As a result, thecreateFeeDiscount
state variable will always be zero.https://github.com/sherlock-audit/2022-11-bond/blob/main/src/BondFixedExpiryTeller.sol#L118
https://github.com/sherlock-audit/2022-11-bond/blob/main/src/BondFixedTermTeller.sol#L118
Impact
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
andBondFixedTermTeller.create
functions. As such, the users will not obtain any discount from the protocol when using the create function.Code Snippet
https://github.com/sherlock-audit/2022-11-bond/blob/main/src/BondFixedExpiryTeller.sol#L118
https://github.com/sherlock-audit/2022-11-bond/blob/main/src/BondFixedTermTeller.sol#L118
Tool used
Manual Review
Recommendation
Implement a setter method for the
createFeeDiscount
state variable and the necessary verification checks.The text was updated successfully, but these errors were encountered: