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
uint256 amountOut18Decimals = amountOut * to18ConversionFactor;
uint256 fee =_processFee(amountOut, _feeRate);
uint256 amountInWithFee = amountOut18Decimals + fee;
require(amountInWithFee <= amountInMax, "Amount in with fee exceeds max");
emitSwapExactOut(msg.sender, amountOut, amountInWithFee, fee, to, deadline);
mintedToken.burnFrom(msg.sender, amountInWithFee);
inputToken.transferFrom(address(vault), to, amountOut);
mintedToken.transfer(feeRecipient, fee);
Should be:
uint256 amountOut18Decimals = amountOut * to18ConversionFactor;
uint256 fee =_processFee(amountOut18Decimals, _feeRate); /// @audit Fee should be in 18 decimals since it' in minted Token!uint256 amountInWithFee = amountOut18Decimals + fee;
require(amountInWithFee <= amountInMax, "Amount in with fee exceeds max");
emitSwapExactOut(msg.sender, amountOut, amountInWithFee, fee, to, deadline);
mintedToken.transferFrom(msg.sender, amountInWithFee); /// @audit Transfer 100%
mintedToken.burn(amountOut18Decimals); /// @audit Burn non-fee
mintedToken.transfer(feeRecipient, fee); /// @audit Fee is sent
inputToken.transferFrom(address(vault), to, amountOut); /// @audit User receives the amountOut
/// @notice Sets the fee rate for swaps./// @param _feeRate The new fee rate, as a percentage in basis points.function setFeeRate(uint256_feeRate) external requiresAuth {
feeRate = _feeRate.safeCastTo96();
}