manifoldfinance / mevETH2

mevETH LST Protocol - Repo has migrated see link
https://github.com/MEV-Protocol/meveth
27 stars 2 forks source link

MevEthShareVault and WagyuStaker should inherit Auth and have fund recover functions #46

Closed sandybradley closed 1 year ago

sandybradley commented 1 year ago

Issue

MevEthShareVault and WagyuStaker can be used as vaildator withdraw addresses. They should inherit Auth for the following reasons:

0xKitsune commented 1 year ago

I created a new branch to add this functionality. Can you give an idea of what the recoverFunds() function should look like? Are you envisioning that this function would take a receiver address and simply send all funds to that address?

sandybradley commented 1 year ago

I had in mind something like ...

    function revoverFunds(address recipient, uint256 amount) external onlyAdmin {
        SafeTransferLib.safeTransferETH(recipient, amount);
    }

    function revoverToken(address token, address recipient, uint256 amount) external onlyAdmin {
        ERC20(token).safeTransfer(recipient, amount);
    }
0xKitsune commented 1 year ago

Sounds good, I will add this as well as some tests and PR today.