Skip to content

Blurry Mocha Fox - Rounding down can cause loss to protocol #147

@sherlock-admin4

Description

@sherlock-admin4

Blurry Mocha Fox

High

Rounding down can cause loss to protocol

Summary

Rounding issue can lead to protocol facing losses

Root Cause

In SwapperEngine.sol
https://github.com/sherlock-audit/2025-02-usual-labs/blob/main/pegasus/packages/solidity/src/swapperEngine/SwapperEngine.sol#L165

It calculates equivalent USD0 for collateral token.
It can lead to user paying 0 USD0 to get non zero collateral token, as we are rounding down, and this can lead to 0 USD0, while having non zero collateral token like USDC

Internal Pre-conditions

No pre conditions

External Pre-conditions

NA

Attack Path

NA

Impact

Protocol will be taking in 0 USD0 and given out non zero USDC/or other underlying assets

PoC

No response

Mitigation

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions