An if statement that is true won't stop the execution of subsequent else if statements, which can lead to contradictory outcomes if not carefully managed.
Vulnerability Detail
For the function transferTokensOutif (_tokenOut == address(_asset)) is the same address as else if (_tokenOut == address(this)) they will both execute.
Impact
Both statements will be true. The second statement will overwrite the second statement.
newt
medium
Avoiding Contradictions in Conditional Logic
Summary
An if statement that is true won't stop the execution of subsequent else if statements, which can lead to contradictory outcomes if not carefully managed.
Vulnerability Detail
For the function
transferTokensOut
if (_tokenOut == address(_asset))
is the same address aselse if (_tokenOut == address(this))
they will both execute.Impact
Both statements will be true. The second statement will overwrite the second statement.
Code Snippet
https://github.com/sherlock-audit/2024-05-pooltogether/blob/main/pt-v5-vault/src/PrizeVault.sol#L744-L753
Tool used
Manual Review
Recommendation
Use if statements prior to the else condition