DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: medium
Invalid

claimAndSwap function deposit all assets after swap

Summary

In claimAndSwap functions of StrategyArb.sol, StrategyMainnet.sol and StrategyOp.sol files

After swap, deposit all assets

require((balAfter - balBefore) >= _minOut, "Slippage too high");
transmuter.deposit(asset.balanceOf(address(this)), address(this));

The function needs to deposit only amount swapped.

Impact

The user might want to keep some assets in their pocket.

However, after claimAndSwap, the transmuter forcibly deposits all assets.

Tools Used

Manual

Recommendations

Need to deposit only amount chaned.

require((balAfter - balBefore) >= _minOut, "Slippage too high");
-- transmuter.deposit(asset.balanceOf(address(this)), address(this));
++ transmuter.deposit(balAfter - balBefore, address(this));
Updates

Appeal created

inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.