Omniscia Mean Finance Audit

RunSwap Manual Review Findings

RunSwap Manual Review Findings

RSP-01M: Potential Mismatch of Contract Functionality

Description:

The runSwap documentation @notice indicates that the "...input tokens are expected to be on the contract before this function is executed.", however, the function is set as payable permitting native funds to be transferred along with the call.

Example:

solidity/contracts/extensions/RunSwap.sol
21/**
22 * @notice Executes a swap with the given swapper. The input tokens are expected to be on the contract before
23 * this function is executed. If the swap doesn't include a transfer, then the swapped tokens will be left
24 * on the contract
25 * @dev This function can only be executed with swappers that are allowlisted
26 * @param _parameters The parameters for the swap
27 */
28function runSwap(RunSwapParams calldata _parameters) public payable virtual onlyAllowlisted(_parameters.swapper) {

Recommendation:

We advise the payable modifier to be omitted from the codebase or the documentation to be updated depending on the intended behaviour of the RunSwap contract.

Alleviation:

The Mean Finance team considered this exhibit but opted to retain the payable modifier to ensure that the function calls can be bundled with other payable calls via a multi-caller. As a result, we consider this exhibit nullified as it is desirable behaviour.