-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Q-19QA (Quality Assurance)Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntaxAssets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntaxbugSomething isn't workingSomething isn't workingdowngraded by judgeJudge downgraded the risk level of this issueJudge downgraded the risk level of this issuegrade-b
Description
Lines of code
Vulnerability details
Impact
Minting will break if mintFee is set to zero
Proof of Concept
uint256 feesInCollateral = _getMintFees(collateralAmountIn);
uint256 depositValueAfterFees = collateralAmountIn - feesInCollateral;
_checkAndUpdateMintLimit(depositValueAfterFees);
collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);
CashManager#requestMint attempts to transfer fee to feeRecipient even if there is no fee to transfer (i.e. mintFee == 0). This will break minting for tokens that do not support zero value transfers if mintFee == 0.
Tools Used
Manual Review
Recommended Mitigation Steps
Only transfer fees if there are fees to transfer:
uint256 feesInCollateral = _getMintFees(collateralAmountIn);
uint256 depositValueAfterFees = collateralAmountIn - feesInCollateral;
_checkAndUpdateMintLimit(depositValueAfterFees);
- collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);
+ if(feesInCollateral != 0) {
+ collateral.safeTransferFrom(msg.sender, feeRecipient, feesInCollateral);
+ }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Q-19QA (Quality Assurance)Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntaxAssets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntaxbugSomething isn't workingSomething isn't workingdowngraded by judgeJudge downgraded the risk level of this issueJudge downgraded the risk level of this issuegrade-b