code-423n4 / 2021-10-slingshot-findings

0 stars 0 forks source link

`Slingshot.sol` Unused code #75

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

https://github.com/code-423n4/2021-10-slingshot/blob/9c0432cca2e43731d5a0ae9c151dacf7835b8719/contracts/Slingshot.sol#L165-L178

/// @notice Sends token funds. For native token, it unwraps wrappedNativeToken
/// @param token The address of the token to send
/// @param to The address of recipient
/// @param amount The amount of the token to send
function _sendFunds(address token, address to, uint256 amount) internal {
    executioner.sendFunds(token, to, amount);
    if (token == nativeToken) {
        wrappedNativeToken.withdraw(amount);
        (bool success, ) = to.call{value: amount}("");
        require(success, "Slingshot: ETH Transfer failed.");
    } else {
        IERC20(token).safeTransfer(to, amount);
    }
}

The internal function _sendFunds is unused.

tommyz7 commented 2 years ago

Duplicate of #28