When tokenType != Ether, need to check msg.value == 0
Summary
When tokenType != Ether, need to check msg.value == 0
Vulnerability Detail
In the depositForRollPosition function of the VaultAccountLib library and the transferUnderlyingToVaultDirect and _redeem functions of the VaultConfiguration library, there is no check for msg.value == 0 when tokenType != Ether. If the user mistakenly sends ETH to the contract when tokenType != Ether, the ETH will be locked in the contract.
Impact
If the user mistakenly sends ETH to the contract when tokenType != Ether, the ETH will be locked in the contract.
cccz
medium
When tokenType != Ether, need to check msg.value == 0
Summary
When tokenType != Ether, need to check msg.value == 0
Vulnerability Detail
In the depositForRollPosition function of the VaultAccountLib library and the transferUnderlyingToVaultDirect and _redeem functions of the VaultConfiguration library, there is no check for msg.value == 0 when tokenType != Ether. If the user mistakenly sends ETH to the contract when tokenType != Ether, the ETH will be locked in the contract.
Impact
If the user mistakenly sends ETH to the contract when tokenType != Ether, the ETH will be locked in the contract.
Code Snippet
https://github.com/sherlock-audit/2022-09-notional/blob/main/contracts-v2/contracts/internal/vaults/VaultAccount.sol#L268-L275 https://github.com/sherlock-audit/2022-09-notional/blob/main/contracts-v2/contracts/internal/vaults/VaultConfiguration.sol#L451-L460 https://github.com/sherlock-audit/2022-09-notional/blob/main/contracts-v2/contracts/internal/vaults/VaultConfiguration.sol#L634-L647
Tool used
Manual Review
Recommendation