The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Misdirection of ERC20 Native Swap fees to `protocol` Address Instead of `liquidator` Causes Loss of Rewards for Stakers

Description:
When users swap EUROs, a small fee is intended to be sent to the SmartVaultManagerV5::liquidator address (i.e., LiquidatorPoolManager) to distribute to stakers. However, the vault erroneously sends these fees to the SmartVaultManagerV5::protocol address, which is the treasury. Instances of fees being directed to the SmartVaultManagerV5::protocol instead of the SmartVaultManagerV5::liquidator are evident in the following code segments:

To clarify any doubts or confusion about the difference between the protocol and liquidator addresses, consider the following points:


Impact:

When fees are sent to the protocol instead of the liquidator, the stakers receive no rewards, which disincentives them from staking. Although the funds aren't permanently lost, as they can always be sent back to the liquidator, the advantage gained from staking early is lost for early stakers.


Proof of Concept:

For a visual representation of the value flow in the network, see here.


Tools Used:

  • Manual review

  • Foundry


Recommended Mitigation Steps:

Transfer fees to liquidator instead of protocol.

function executeERC20SwapAndFee(ISwapRouter.ExactInputSingleParams memory _params, uint256 _swapFee) private {
- IERC20(_params.tokenIn).safeTransfer(ISmartVaultManagerV3(manager).protocol(), _swapFee);
+ IERC20(_params.tokenIn).safeTransfer(ISmartVaultManagerV3(manager).liquidator(), _swapFee);
IERC20(_params.tokenIn).safeApprove(ISmartVaultManagerV3(manager).swapRouter2(), _params.amountIn);
ISwapRouter(ISmartVaultManagerV3(manager).swapRouter2()).exactInputSingle(_params);
IWETH weth = IWETH(ISmartVaultManagerV3(manager).weth());
// convert potentially received weth to eth
uint256 wethBalance = weth.balanceOf(address(this));
if (wethBalance > 0) weth.withdraw(wethBalance);
}
Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

mint-fee

informational/invalid

krisrenzo Submitter
over 1 year ago
hrishibhat Lead Judge
over 1 year ago
hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

informational/invalid

Support

FAQs

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