Function: setWeightStrategy(uint8 weightId, uint16 proportion, uint256[] fixedWeights)
A restricted onlyOwner function. There are not checks of fixedWeights values if weightId == 1 or 4. Also, fixedWeights can be an empty list.
Inputs
weightIdConstraints:
0 < weightId <= 4, but it should be0 < weightId < 4.Impact: defines the strategy to use for weights. If
weightId == 3,fixedWeightscontainsmarketIdsand threshold. IfweightId == 2, thenfixedWeightscontains the custom weights. IfweightId == 1, thenequalWeight, that is, all available funds will be equally distributed between the vaults.
proportionConstraints:
proportion <= 9999.Impact: Proportion of vault funds to use in each deployment to strategy.
fixedWeightsConstraints: If
weightId == 2, then the sum of weights should not be more than 10,000.Impact: Update the global
vaultWeights, which is used byPositionSizer._thresholdWeightandPositionSizer._fixedWeight.
Branches and code coverage (including function calls)
Intended branches
weightStrategy,weightProportion, andvaultWeightsare updated properly.
Negative behavior
weightId == 0.proportion > 9_999.weightId > strategyCount().weightId == 2andfixedWeights.length != vaultList.length.weightId == 3andfixedWeights.length != vaultList.length + 1.