@@ -175,7 +175,6 @@ contract ColonyExpenditure is ColonyStorage {
175175 expenditureOnlyOwner (_id)
176176 {
177177 require (_slots.length == _skillIds.length , "colony-expenditure-bad-slots " );
178- IColonyNetwork colonyNetworkContract = IColonyNetwork (colonyNetworkAddress);
179178
180179 for (uint256 i; i < _slots.length ; i++ ) {
181180 require (isValidGlobalOrLocalSkill (_skillIds[i]), "colony-not-valid-global-or-local-skill " );
@@ -316,10 +315,11 @@ contract ColonyExpenditure is ColonyStorage {
316315
317316 // Validate payout modifier
318317 if (offset == 2 ) {
319- if (! ColonyAuthority (address (authority)).hasUserRole (msgSender (), 1 , uint8 (ColonyDataTypes.ColonyRole.Root))){
320- require (int256 (uint256 (_value)) <= 0 , "colony-expenditure-bad-payout-modifier " );
321- }
322- require (int256 (uint256 (_value)) >= MIN_PAYOUT_MODIFIER, "colony-expenditure-bad-payout-modifier " );
318+ require (
319+ (int256 (uint256 (_value)) <= 0 || IColony (address (this )).hasUserRole (msgSender (), 1 , ColonyRole.Root)) &&
320+ int256 (uint256 (_value)) >= MIN_PAYOUT_MODIFIER,
321+ "colony-expenditure-bad-payout-modifier "
322+ );
323323 }
324324
325325 } else {
@@ -361,11 +361,11 @@ contract ColonyExpenditure is ColonyStorage {
361361 internal
362362 {
363363 for (uint256 i; i < _tokens.length ; i++ ) {
364- (bool success , bytes memory returndata ) = address (this ).delegatecall (
364+ (bool success , bytes memory returndata ) = address (this ).delegatecall ( // solhint-disable-line avoid-low-level-calls
365365 abi.encodeWithSignature ("setExpenditurePayouts(uint256,uint256[],address,uint256[]) " , _id, _slots[i], _tokens[i], _values[i])
366366 );
367367 if (! success) {
368- if (returndata.length == 0 ) revert ();
368+ if (returndata.length == 0 ) revert (" colony-expenditure-null-return " );
369369 assembly {
370370 revert (add (32 , returndata), mload (returndata))
371371 }
0 commit comments