sherlock-audit / 2023-01-derby-judging

4 stars 1 forks source link

Avci - this implementation have high risk of funds loss for protocol if kust value calculated wrong or manipulated #416

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

Avci

medium

this implementation have high risk of funds loss for protocol if kust value calculated wrong or manipulated

Summary

this implementation have high risk of funds loss for protocol if just value calculated wrong or manipulated

Vulnerability Detail

    reservedFunds -= value;

Impact

will cause funds lost

Code Snippet

    reservedFunds -= value;

https://github.com/sherlock-audit/2023-01-derby/blob/main/derby-yield-optimiser/contracts/MainVault.sol#L216

Tool used

Manual Review

Recommendation

consider checking the value before sub logic from reservedFunds