RocketVault - consider rejecting zero amount deposit/withdrawal requests
Consider disallowing zero amount token transfers unless the system requires this to work. In most cases, zero amount token transfers will emit an event (that potentially triggers off-chain components). In some cases, they allow the caller without holding any balance to call back to themselves (pot. reentrancy) or the caller provided token address.\\n`depositEther` allows to deposit zero ETH\\nemits `EtherDeposited`\\n`withdrawEther` allows to withdraw zero ETH\\ncalls back to `withdrawer` (msg.sender)!\\nemits `EtherWithdrawn`\\n(depositToken checks for amount >0)\\n`withdrawToken` allows zero amount token withdrawals\\ncalls into user provided (actually a network contract) tokenAddress)\\nemits `TokenWithdrawn`\\n`transferToken` allows zero amount token transfers\\nemits `TokenTransfer`\\n```\\nfunction depositEther() override external payable onlyLatestNetworkContract {\\n    // Get contract key\\n    bytes32 contractKey = keccak256(abi.encodePacked(getContractName(msg.sender)));\\n    // Update contract balance\\n    etherBalances[contractKey] = etherBalances[contractKey].add(msg.value);\\n    // Emit ether deposited event\\n    emit EtherDeposited(contractKey, msg.value, block.timestamp);\\n}\\n```\\n
Zero amount transfers are no-operation calls in most cases and should be avoided. However, as all vault actions are authenticated (to registered system contracts), the risk of something going wrong is rather low. Nevertheless, it is recommended to deny zero amount transfers to avoid running code unnecessarily (gas consumption), emitting unnecessary events, or potentially call back to callers/token address for ineffective transfers.
```\\nfunction depositEther() override external payable onlyLatestNetworkContract {\\n    // Get contract key\\n    bytes32 contractKey = keccak256(abi.encodePacked(getContractName(msg.sender)));\\n    // Update contract balance\\n    etherBalances[contractKey] = etherBalances[contractKey].add(msg.value);\\n    // Emit ether deposited event\\n    emit EtherDeposited(contractKey, msg.value, block.timestamp);\\n}\\n```\\n