Closed code423n4 closed 1 year ago
0xRobocop marked the issue as low quality report
Invalid
result
returned by _swap
in swapGivenInputAmount
should be negative.
0xRobocop marked the issue as primary issue
JustDravee marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-08-shell/blob/c61cf0e01bada04c3d6055acb81f61955ed600aa/src/proteus/EvolvingProteus.sol#L296
Vulnerability details
Impact
swapGivenInputAmount(...)
will always revert leading to a Denial of service.Proof of Concept
A call to
swapGivenInputAmount(...)
will always revert owing to the logic implementation in the function.The
_swap(...)
function returns a positive signed integer value cached inresult
. However, the function requires thatresult
must be negative for this reason the check will not pass and this will lead to the function reverting.Tools Used
Manual review.
Recommended Mitigation Steps
Change the less than sign to greater than as shown below
Assessed type
DoS