MEDIUM severity: The vulnerability, RocketTokenNETH - Pot. discrepancy between minted tokens and deposited collateral. The vulnerability, RocketTokenNETH - Pot. discrepancy between minted tokens and deposited collateral, is a critical issue in the RocketTokenNETH contract. The issue arises from the discrepancy between the minting and deposition of collateral in the minipool lifecycle. Specifically, `nETH` tokens are...

Vulnerable code:
```\nif (calcBase.mul(submissionCount).div(rocketDAONodeTrusted.getMemberCount()) >= \n    rocketDAOProtocolSettingsNetwork.getNodeConsensusThreshold()) {\n    setMinipoolWithdrawable(_minipoolAddress, _stakingStartBalance, _stakingEndBalance);\n}\n```\n```\nuint256 nodeAmount = getMinipoolNodeRewardAmount(\n    minipool.getNodeFee(),\n    userDepositBalance,\n    minipool.getStakingStartBalance(),\n    minipool.getStakingEndBalance()\n);\n\nif (nodeAmount > 0) {\n    rocketTokenNETH.mint(nodeAmount, _minipoolAddress);\n}\n```\n```\nreceive() external payable {\n    (bool success, bytes memory data) = getContractAddress("rocketMinipoolDelegate").delegatecall(abi.encodeWithSignature("receiveValidatorBalance()"));\n    if (!success) {\n        revert(getRevertMessage(data));\n    }\n}\n```\n```\nrequire(msg.sender == rocketDAOProtocolSettingsNetworkInterface.getSystemWithdrawalContractAddress(), "The minipool's validator balance can only be sent by the eth1 system withdrawal contract");\n\nvalidatorBalanceWithdrawn = true;\n\nrocketNetworkWithdrawal.processWithdrawal{value: msg.value}();\n```\n```\nuint256 totalShare = rocketMinipoolManager.getMinipoolWithdrawalTotalBalance(msg.sender);\nuint256 nodeShare = rocketMinipoolManager.getMinipoolWithdrawalNodeBalance(msg.sender);\nuint256 userShare = totalShare.sub(nodeShare);\n\nuint256 nodeAmount = 0;\nuint256 userAmount = 0;\n\nif (totalShare > 0) {\n    nodeAmount = msg.value.mul(nodeShare).div(totalShare);\n    userAmount = msg.value.mul(userShare).div(totalShare);\n}\n\nrocketMinipoolManager.setMinipoolWithdrawalProcessed(msg.sender);\n\nif (nodeAmount > 0) {\n    rocketTokenNETH.depositRewards{value: nodeAmount}();\n}\n\nif (userAmount > 0) {\n    // Transfer user balance to rETH contract or deposit pool\n}\n```\n```\nuint256 nethBalance = rocketTokenNETH.balanceOf(address(this));\nif (nethBalance > 0) {\n    RocketNodeManagerInterface rocketNodeManager = RocketNodeManagerInterface(getContractAddress("rocketNodeManager"));\n    address nodeWithdrawalAddress = rocketNodeManager.getNodeWithdrawalAddress(nodeAddress);\n    require(rocketTokenNETH.transfer(nodeWithdrawalAddress, nethBalance), "nETH balance was not successfully transferred to node operator");\n    emit NethWithdrawn(nodeWithdrawalAddress, nethBalance, block.timestamp);\n}\n```\n```\nfunction depositRewards() override external payable onlyLatestContract("rocketNetworkWithdrawal", msg.sender) {\n    emit EtherDeposited(msg.sender, msg.value, block.timestamp);\n}\n\nfunction mint(uint256 _amount, address _to) override external onlyLatestContract("rocketMinipoolStatus", msg.sender) {\n    require(_amount > 0, "Invalid token mint amount");\n    _mint(_to, _amount);\n    emit TokensMinted(_to, _amount, block.timestamp);\n}\n```