hats-finance / ether-fi-0x36c3b77853dec9c4a237a692623293223d4b9bc4

Smart Contracts for Ether Fi dapp
1 stars 1 forks source link

`EtherFiNode` can’t move rewards to manager #32

Open hats-bug-reporter[bot] opened 11 months ago

hats-bug-reporter[bot] commented 11 months ago

Github username: @0xfuje Submission hash (on-chain): 0x968c7b27073e2eef937359934daa5d0c71a63e63ca81789554b61d7664ec071a Severity: medium

Description:

Description

The moveRewardsToManager() function of EtherFiNode is restricted to only be callable from the manager contract and is expected to move rewards to EtherFiNodeManager.sol. However the problem is that the node manager can't possibly call this function because the call is currently unimplemented in the manager contract.

src/EtherFiNode.sol - moveRewardsToManager()

    /// @notice Sends funds to the rewards manager
    /// @param _amount The value calculated in the etherfi node manager to send to the rewards manager
    function moveRewardsToManager(
        uint256 _amount
    ) external onlyEtherFiNodeManagerContract {
        (bool sent, ) = payable(etherFiNodesManager).call{value: _amount}("");
        require(sent, "Failed to send Ether");
    }

src/EtherFiNode.sol - onlyEtherFiNodeManagerContract()

    modifier onlyEtherFiNodeManagerContract() {
        require(
            msg.sender == etherFiNodesManager,
            "Only EtherFiNodeManager Contract"
        );
        _;
    }

Recommendation

Consider either implementing the moveRewardsToManager() function in EtherFiNodeManager.sol or if the function serves no purpose currently: removing it from EtherFiNode.sol.

0xfuje commented 11 months ago

This is more important than I thought it would be, because when a node is malicious and it's validator is slashed, the protocol can't cover for the losses from the node's rewards

seongyun-ko commented 11 months ago

This function is not implemented since it is not being used. It will be deprecated. TY

seongyun-ko commented 11 months ago

close