When staking is paused in RocketPool, the function deposit in Reth should swap tokens with Uniswap in order to receive the allocated amount of tokens instead of reverting.
Audit: 2023-03-asymmetry-findings
Severity: MEDIUM

# Lines of code

https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/Reth.sol#L156-L204


# Vulnerability details

## Impact
When depositing into the rocket pool isn't possible, the Reth derivative contract is designed to get an amount of Reth tokens by swapping through Uniswap. However the contract doesn't include the scenario where depositing into the rocket pool is paused, so instead of working normally and getting the Reth tokens through Uniswap, the staking function will revert and won't be able to perform depositing for the Reth derivative.


## Proof of Concept
If we look over the deposit function in the Reth derivative, we can see that even if the msg.value can't be deposited in the rocket pool duo to the pool hitting maximum deposits or the msg.value is below the minimum deposit amount. The function still gets the msg.value converts it to WETH and calls Uniswap in order to exchange the WETH for an amount of Reth tokens.
So the contract is designed to swap tokens through Uniswap in order to get the amount of tokens, even if depositing into the rocket pool doesn't work.

```solidity
function deposit() external payable onlyOwner returns (uint256) {
        // Per RocketPool Docs query addresses each time it is used
        address rocketDepositPoolAddress = RocketStorageInterface(
            ROCKET_STORAGE_ADDRESS
        ).getAddress(
                keccak256(
                    abi.encodePacked("contract.address", "rocketDepositPool")
                )
            );

        RocketDepositPoolInterface rocketDepositPool = RocketDepositPoolInterface(
                rocketDepositPoolAddress
            );

        if (!poolCanDeposit(msg.value)) {
            uint rethPerEth = (10 ** 36) / poolPrice();

            uint256 minOut = ((((rethPerEth * msg.value) / 10 ** 18) *
                ((10 ** 18 - maxSlippage))) / 10 ** 18);

            IWETH(W_ETH_ADDRESS).deposit{value: msg.value}();
            uint256 amountSwapped = swapExactInputSingleHop(
                W_ETH_ADDRESS,
                rethAddress(),
                500,
                msg.value,
                minOut
            );

            return amountSwapped;
        } else {
            address rocketTokenRETHAddress = RocketStorageInterface(
                ROCKET_STORAGE_ADDRESS
            ).getAddress(
                    keccak256(
                        abi.encodePacked("contract.address", "rocketTokenRETH")
                    )
                );
            RocketTokenRETHInterface rocketTokenRETH = RocketTokenRETHInterface(
                rocketTokenRETHAddress
            );
            uint256 rethBalance1 = rocketTokenRETH.balanceOf(address(this));
            rocketDepositPool.deposit{value: msg.value}();
            uint256 rethBalance2 = rocketTokenRETH.balanceOf(address(this));
            require(rethBalance2 > rethBalance1, "No rETH was minted");
            uint256 rethMinted = rethBalance2 - rethBalance1;