_decimalMultiplier doesn’t account for tokens with decimals higher than 18
The decimal multiplier calculation in StrategySwapper assumes token decimals are at most 18, so swapping tokens with more than 18 decimals always reverts. This prevents strategies from harvesting rewards when such tokens are involved.
Submitted by shenwilly, also found by pauliax, StyxRave, and WatchPug
StrategySwapper.sol#L287-L289 StrategySwapper.sol#L318-L320 StrategySwapper.sol#L335-L337
In StrategySwapper, swapping from or to tokens with decimals higher than 18 will always revert. This will cause inabilities for strategies to harvest rewards.
Proof of Concept
L288 will revert when token_ has higher than 18 decimals.
return 10**(18 - IERC20Full(token_).decimals());
Recommended Mitigation Steps
Consider modifying how _decimalMultiplier works so it could handle tokens with higher than 18 decimals.
Update the calculation of _minTokenAmountOut and _minWethAmountOut to account when decimals are higher/lower than 18.
chase-manning (Backd) confirmed and resolved
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code assumes token decimals are never greater than 18, so the subtraction 18 minus decimals underflows or produces an invalid exponent when decimals exceed 18.
Impact
Swaps involving tokens with more than 18 decimals always revert, so strategies cannot harvest rewards for those tokens.
What the attacker needed
Token with more than 18 decimals
The fix
The decimal multiplier calculation and the minimum output amount calculations should be updated to handle tokens with more or fewer than 18 decimals; the report states the issue was confirmed and resolved.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Tokens can have different numbers of decimal places. The code calculates a scaling factor by subtracting the token's decimals from 18, which becomes negative if the token has more than 18 decimals. That negative exponent causes the transaction to fail, so the strategy cannot swap or harvest rewards.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.