Skip to content

Commit

Permalink
lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeNervoXS committed May 10, 2024
1 parent a7a6d84 commit f708d9a
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions contracts/transmuter/facets/Swapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,9 @@ contract Swapper is ISwapper, AccessControlModifiers {
}
{
// In the mint case, when `!v.isExact`: = `b_{i+1} * (1+(g_i(0)+f_{i+1})/2)`
uint256 amountToNextBreakPointNormalizer = v.isExact
? v.amountToNextBreakPoint
: v.isMint
? _invertFeeMint(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2)
: _applyFeeBurn(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2);
uint256 amountToNextBreakPointNormalizer = v.isExact ? v.amountToNextBreakPoint : v.isMint
? _invertFeeMint(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2)
: _applyFeeBurn(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2);

if (amountToNextBreakPointNormalizer >= amountStable) {
int64 midFee;
Expand Down Expand Up @@ -435,11 +433,9 @@ contract Swapper is ISwapper, AccessControlModifiers {
return amount + _computeFee(quoteType, amountStable, midFee);
} else {
amountStable -= amountToNextBreakPointNormalizer;
amount += !v.isExact
? v.amountToNextBreakPoint
: v.isMint
? _invertFeeMint(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2)
: _applyFeeBurn(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2);
amount += !v.isExact ? v.amountToNextBreakPoint : v.isMint
? _invertFeeMint(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2)
: _applyFeeBurn(v.amountToNextBreakPoint, int64(v.upperFees + currentFees) / 2);
currentExposure = v.upperExposure * BASE_9;
++i;
// Update for the rest of the swaps the stablecoins issued from the asset
Expand Down Expand Up @@ -538,13 +534,11 @@ contract Swapper is ISwapper, AccessControlModifiers {
/// @notice Applies or inverts `fees` to an `amount` based on the type of operation
function _computeFee(QuoteType quoteType, uint256 amount, int64 fees) internal pure returns (uint256) {
return
quoteType == QuoteType.MintExactInput
? _applyFeeMint(amount, fees)
: quoteType == QuoteType.MintExactOutput
? _invertFeeMint(amount, fees)
: quoteType == QuoteType.BurnExactInput
? _applyFeeBurn(amount, fees)
: _invertFeeBurn(amount, fees);
quoteType == QuoteType.MintExactInput ? _applyFeeMint(amount, fees) : quoteType == QuoteType.MintExactOutput
? _invertFeeMint(amount, fees)
: quoteType == QuoteType.BurnExactInput
? _applyFeeBurn(amount, fees)
: _invertFeeBurn(amount, fees);
}

/// @notice Checks whether an operation is a mint operation or not
Expand Down

0 comments on commit f708d9a

Please sign in to comment.