Skip to content

Unused Variable in transferRevenueSplits function#

Informational

Done

Handled according to the recommendation.

In the transferRevenueSplits function thesumBps variable is not used for anything:

function transferRevenueSplits(
    LibAsset.AssetType memory matchCalculate,
    uint amount,
    address from,
    LibPart.Part[] memory revenueSplits,
    bytes4 transferDirection
) internal returns (uint) {
    uint sumBps = 0;
    uint restValue = amount;
    for (uint256 i = 0; i < revenueSplits.length && i < 5; i++) {
        uint currentAmount = amount.bp(revenueSplits[i].value);
        sumBps = sumBps.add(revenueSplits[i].value);
        if (currentAmount > 0) {
            restValue = restValue.sub(currentAmount);
            transfer(LibAsset.Asset(matchCalculate, currentAmount), from, revenueSplits[i].account, transferDirection, REVENUE_SPLIT);
        }
    }
    return amount.sub(restValue);
}

Recommendation#

Remove the thesumBps variable.