Skip to content

Plain Bronze Walrus - weth token on sonic reverts on zero transfers, and doclaim is hardcoded to true in withdrawfromSP #162

@sherlock-admin4

Description

@sherlock-admin4

Plain Bronze Walrus

High

weth token on sonic reverts on zero transfers, and doclaim is hardcoded to true in withdrawfromSP

Summary

In Strategy.sol, when collateral is weth token, it revert the withdrawFromStabililtypool functionallity.

Root Cause

https://github.com/sherlock-audit/2025-05-yearn-ybold/blob/main/yv3-liquityv2-sp-strategy/src/Strategy.sol#L201C1-L205C6

https://sonicscan.org/token/0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38?a=0x324963c267c354c7660ce8ca3f5f167e05649970#code

Internal Pre-conditions

while withdrawing asset from stabilitypool, do claim is true, so that coll would also be send back from stability pool, but situation can be there , that no coll to claim, and it would revert if 0 is transferred.

External Pre-conditions

N/A

Attack Path

when withdrwaFromSP is called with do claim true , it could revert if no collaletral to send back , but there are assets which should be withdrawed , but it will also revert

Impact

Withdraw functionallity would revert , as doClaim is hardcoded to true for sonic chain, if weth is coll

PoC

No response

Mitigation

it should be checked in contract if there is there coll to claim then only doclaim should be true, otherwise doclaim should be pass as false.

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