@@ -128,29 +128,21 @@ library VolumeRestrictionLib {
128128 counter = 0 ;
129129 for (i = 0 ; i < investors.length ; i++ ) {
130130 if (_isVolRestricted (IDataStore (_dataStore).getUint256 (_getKey (INVESTORFLAGS, investors[i])))) {
131- uint256 typeValue = (holderToRestrictionType[investors[i]] == uint8 (2 ) ? 2 : 1 );
132- if (typeValue == 2 ) {
133- allAddresses[counter] = investors[i];
131+ allAddresses[counter] = investors[i];
132+ if (holderToRestrictionType[investors[i]] == uint8 (VolumeRestrictionTMStorage.TypeOfPeriod.MultipleDays)) {
133+ _setValues (_individualRestrictions.individualRestriction[investors[i]], allowedTokens, startTime, rollingPeriodInDays, endTime, typeOfRestriction, counter);
134+ }
135+ else if (holderToRestrictionType[investors[i]] == uint8 (VolumeRestrictionTMStorage.TypeOfPeriod.OneDay)) {
136+ _setValues (_individualRestrictions.individualDailyRestriction[investors[i]], allowedTokens, startTime, rollingPeriodInDays, endTime, typeOfRestriction, counter);
137+ }
138+ else if (holderToRestrictionType[investors[i]] == uint8 (VolumeRestrictionTMStorage.TypeOfPeriod.Both)) {
139+ _setValues (_individualRestrictions.individualRestriction[investors[i]], allowedTokens, startTime, rollingPeriodInDays, endTime, typeOfRestriction, counter);
134140 counter++ ;
141+ allAddresses[counter] = investors[i];
142+ _setValues (_individualRestrictions.individualDailyRestriction[investors[i]], allowedTokens, startTime, rollingPeriodInDays, endTime, typeOfRestriction, counter);
135143 }
136- allAddresses[counter] = investors[i];
137- counter++ ;
138- }
139- }
140- counter = 0 ;
141- for (i = 0 ; i < allAddresses.length ; i++ ) {
142- if (holderToRestrictionType[allAddresses[i]] == uint8 (VolumeRestrictionTMStorage.TypeOfPeriod.MultipleDays)) {
143- _setValues (_individualRestrictions.individualRestriction[allAddresses[i]], allowedTokens, startTime, rollingPeriodInDays, endTime, typeOfRestriction, counter);
144- }
145- else if (holderToRestrictionType[allAddresses[i]] == uint8 (VolumeRestrictionTMStorage.TypeOfPeriod.OneDay)) {
146- _setValues (_individualRestrictions.individualDailyRestriction[allAddresses[i]], allowedTokens, startTime, rollingPeriodInDays, endTime, typeOfRestriction, counter);
147- }
148- else if (holderToRestrictionType[allAddresses[i]] == uint8 (VolumeRestrictionTMStorage.TypeOfPeriod.Both)) {
149- _setValues (_individualRestrictions.individualRestriction[allAddresses[i]], allowedTokens, startTime, rollingPeriodInDays, endTime, typeOfRestriction, counter);
150144 counter++ ;
151- _setValues (_individualRestrictions.individualDailyRestriction[allAddresses[i]], allowedTokens, startTime, rollingPeriodInDays, endTime, typeOfRestriction, counter);
152145 }
153- counter++ ;
154146 }
155147 }
156148
0 commit comments