Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lone Tartan Leopard - In withdrawUser function of CDSLib.sol, the return amount is calculated incorrect. #1058

Open
sherlock-admin2 opened this issue Dec 30, 2024 · 0 comments

Comments

@sherlock-admin2
Copy link
Contributor

Lone Tartan Leopard

Medium

In withdrawUser function of CDSLib.sol, the return amount is calculated incorrect.

Summary

Incorrect calulation of returnAmount.
https://github.com/sherlock-audit/2024-11-autonomint/blob/main/Blockchain/Blockchian/contracts/lib/CDSLib.sol#L664

returnAmountWithGains -= params.cdsDepositDetails.initialLiquidationAmount;

it should be -

returnAmountWithGains = params.returnAmount + params.cdsDepositDetails.initialLiquidationAmount;

Root Cause

No response

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

Incorrect transfer of amount to withdrawer.

PoC

No response

Mitigation

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant