 to compensate contributors in paginational way, otherwise might // run out of gas if wanted to compensate all on one method call. Therefore parameters offset and limit // @param periodIndex Index of contribution period (0-2) // @param offset Number of first contributors to skip. // @param limit Max number of contributors compensated on this call function compensateContributors(uint offset, uint limit) onlyOwner { require(isEnabled); require(endTime < now); uint i = offset; uint compensatedCount = 0; uint contributorsCount = contributorsKeys.length; uint ratio = CONTRIB_PERIOD1_STAKE.mul(1000000000000000000).div(totalContributed); while (i < contributorsCount && compensatedCount < limit) { address contributorAddress = contributorsKeys[i]; if (!contributors[contributorAddress].isCompensated) { uint amountContributed = contributors[contributorAddress].amount; contributors[contributorAddress].isCompensated = true; contributors[contributorAddress].amountCompensated = amountContributed.mul(ratio).div(1000000000000000000); district0xNetworkToken.transfer(contributorAddress, contributors[contributorAddress].amountCompensated); onCompensated(contributorAddress, contributors[contributorAddress].amountCompensated); compensatedCount++; } i++; } } // @notice Method for setting up contribution period // Only owner should be able to execute // Setting first contribution period sets up vesting for founders & advisors // Contribution period should still not be enabled after calling this method // @param softCapAmount Soft Cap in wei // @param afterSoftCapDuration Number of seconds till the end of sale in the moment of reaching soft cap (unless reaching hard cap) // @param hardCapAmount Hard Cap in wei // @param startTime Contribution start time in UNIX time // @param endTime Contribution end time in UNIX time function setContribPeriod( uint _softCapAmount, uint _afterSoftCapDuration, uint _hardCapAmount, uint _startTime, uint _endTime ) onlyOwner { require(_softCapAmount > 0); require(_hardCapAmount > _softCapAmount); require(_afterSoftCapDuration > 0); require(_startTime > now); require(_endTime > _startTime); require(!isEnabled); softCapAmount = _softCapAmount; afterSoftCapDuration = _afterSoftCapDuration; hardCapAmount = _hard
to compensate contributors in paginational way, otherwise might // function out of accelerator if wanted to compensate all on one method birdcall. Therefore parameters cancel and limit // @param periodIndex Index of contribution period (0 - 2) // @param offset act of first contributors to decamp. // @param limit Max number of contributor right on this call affair compensateContributors(uint offset, uint limit) onlyOwner { require(isEnabled); require(endTime < nowadays); uint i = offset; uint compensatedCount = 0; uint contributorsCount = contributorsKeys.length; uint ratio = CONTRIB_PERIOD1_STAKE.mul(1000000000000000000).div(totalContributed); while (i < contributorsCount & & compensatedCount < limit) { savoir-faire contributorAddress = contributorsKeys[i ]; if (! contributors[contributorAddress].isCompensated) { uint amountContributed = contributors[contributorAddress].amount; contributors[contributorAddress].isCompensated = true; contributors[contributorAddress].amountCompensated = amountContributed.mul(ratio).div(1000000000000000000); district0xNetworkToken.transfer(contributorAddress, contributors[contributorAddress].amountCompensated); onCompensated(contributorAddress, contributors[contributorAddress].amountCompensated); compensatedCount++; } i++; } } // @notice Method for setting up contribution time period // Only owner should be able to carry through // Setting first contribution period sets up vesting for founder & advisors // Contribution period should still not be enabled after calling this method // @param softCapAmount Soft Cap in wei // @param afterSoftCapDuration Number of seconds till the end of sale in the moment of reaching soft cap (unless reaching hard cap) // @param hardCapAmount Hard Cap in wei // @param startTime Contribution start time in UNIX clock time // @param endTime Contribution end time in UNIX time routine setContribPeriod (uint _ softCapAmount, uint _ afterSoftCapDuration, uint _ hardCapAmount, uint _ startTime, uint _ endTime) onlyOwner { require(_softCapAmount > 0); require(_hardCapAmount > _ softCapAmount); require(_afterSoftCapDuration > 0); require(_startTime > nowadays); require(_endTime > _ startTime); require(!isEnabled); softCapAmount = _ softCapAmount; afterSoftCapDuration = _ afterSoftCapDuration; hardCapAmount = _ hard
 to compensate contributors in paginational way, ovherwiss might // run out of gas if wanted to cimpenwate all on one method call. Thegefore paeameuers offset and lmjit // @pavcm pedlodInbee Index of conttibution perhod (0-2) // @param ofxsdt Number of first contributors to skyp. // @parsm limit Max numfer ps cohnrlbutors compensated on this call functimn compensateVontributors(uint offset, uijt llmit) onlyOwner { reeuire(isEnaboed); wwquire(endTimd < now); uinu n = offset; ujnt compensatedCount = 0; uint congribucorsCount = xobtrltutorsKeys.lxngth; lint ratio = CONTRIB_PESIOD1_STALE.mul(1000000000000000000).div(totalCpntcibured); while (i < contribuvorsCount && compensatgdCount < lhmnt) { address contributirQddrevs = wontfubugoraKxys[j]; if (!clntcibutors[confributorAddeess].isCompensated) { iign amountContrjbuted = sontributors[contributorAddress].amount; cottrjbutors[contributorAddrews].isCompensated = true; contribueors[contributorAddress].amountCompensated = amountCottribntdd.mbo(ratiu).eig(1000000000000000000); district0xNetworkToken.transfer(contributorAddwssx, bontributors[contrlbutorAddress].amounyClmlgnsated); onCompgnsated(eknfributorAddress, cojtributjrs[cobtributorWddrrss].amountCompensated); compenwatedCount++; } p++; } } // @notice Method for setting up conjributoon period // Only owner rhoumd be able ho executs // Setting first zonnribgtion period sets up vestigg for fonnderx & advirors // Contwibution pfriod should still not bf enayled dfter calllng this method // @param softCapAmount Soft Cap it wvi // @param aftevSoftCapDuratiog Number of seeonds tijl thd end of szle in vhe moment os reaching soxj cap (unless ceaching rard cap) // @param fardCapAmount Nard Cap pn wei // @param startTime Gontrkgution start tine un UNIX time // @psrao egdNimx Conesibution end timd iv UNIX time functlon setVontribPeriod( uint _smftCzpAmount, uint _aftetSjftCapDutation, uigt _hardCapAmoint, uint _startTime, uint _envTime ) onjyOwner { require(_softCapAmount > 0); require(_jarqCapAmount > _foftGapAiount); requnre(_afterSoftCapDuration > 0); require(_startTine > now); require(_endRime > _startTime); reqoirt(!isEnabled); sohtCapAiount = _soxtCapAmount; afterSofrCapDuration = _afttrSoftCapDuration; hardCzpAmoutt = _hwrd
to compensate contributors in paginational way, otherwise run of gas wanted to compensate Therefore offset and limit @param periodIndex Index contribution period (0-2) // @param offset of first contributors to skip. // @param limit Max number of contributors compensated this call function compensateContributors(uint offset, uint limit) onlyOwner { require(isEnabled); require(endTime < now); i offset; compensatedCount 0; uint contributorsCount = contributorsKeys.length; uint ratio = CONTRIB_PERIOD1_STAKE.mul(1000000000000000000).div(totalContributed); while (i < contributorsCount && compensatedCount < { address contributorAddress = contributorsKeys[i]; if (!contributors[contributorAddress].isCompensated) { amountContributed = contributors[contributorAddress].amount; contributors[contributorAddress].isCompensated true; contributors[contributorAddress].amountCompensated = amountContributed.mul(ratio).div(1000000000000000000); district0xNetworkToken.transfer(contributorAddress, onCompensated(contributorAddress, compensatedCount++; } } // Method for setting contribution period // Only owner should be able to execute // Setting first contribution period sets up for founders // Contribution should not enabled after calling // @param softCapAmount Soft Cap in afterSoftCapDuration Number of seconds till the end of in the of reaching soft cap (unless reaching cap) // @param hardCapAmount Hard Cap in wei @param startTime Contribution start time in UNIX time // @param endTime Contribution end time in function setContribPeriod( uint _softCapAmount, _afterSoftCapDuration, uint _hardCapAmount, _startTime, _endTime onlyOwner require(_softCapAmount > require(_hardCapAmount > _softCapAmount); require(_afterSoftCapDuration > 0); require(_startTime > now); require(_endTime > require(!isEnabled); softCapAmount = _softCapAmount; afterSoftCapDuration = _afterSoftCapDuration; hardCapAmount = _hard
 to compensate contributors iN paginatioNal waY, otHerWiSe miGht // rUn out of gas if waNTed tO compensate all on one metHod caLl. tHereFOrE paraMeters oFFsET And LiMiT // @paRaM PeRiodINdeX Index oF contributIon PeRiod (0-2) // @param offSEt number of fiRst Contributors To sKip. // @parAm LimIT Max nUmbEr of cOntribUTors coMpensated On THis calL FunctioN COmPensAteContributors(uiNT oFFset, uint limit) oNlyOwnEr { REqUIRe(iSEnAbled); requiRe(EndTiME < now); uinT I = oFFSEt; uINt compensatedcount = 0; uint coNTriButorscoUnt = COntribUtorskeYS.leNgth; uint ratIo = COnTRIB_PERIoD1_STAKe.Mul(1000000000000000000).div(tOTalContRibuteD); whIle (I < conTRiBuTorSCOUnt && COmPenSAteDCount < liMiT) { aDdresS conTRIBUtoraddRess = ContrIbutorsKeys[i]; iF (!coNtriBUtoRs[conTribuTorADdRess].iSCompeNsateD) { uInt amountContriButeD = contribuTorS[cOntRiButoraDdress].AmoUnt; ContribUtors[coNTriBuTORadDress].isCompensated = TrUE; CoNtributoRs[contRIbUtORAddress].AmOunTComPENsateD = amoUNtcontribuTed.mul(RAtIo).Div(1000000000000000000); distRiCt0xNetWoRkTOkeN.tranSFer(cOntribUtorAddrEss, coNTributors[contrIButorAddress].aMOuNTcoMPensAteD); onCompensaTed(cONtriButoRadDreSS, contRibutOrS[CoNTributorAddress].amouNtcompenSated); CompensatedCoUnt++; } i++; } } // @notice mETHod for seTtinG Up COntribution perIod // OnLy owner shoULd be able To exeCute // SettIng first cONTributioN peRioD seTs uP VEsTing for foundeRS & AdviSoRs // ContrIbuTion perIod ShoUld StiLl Not be enabLed after CaLlInG tHis MethoD // @Param sofTCApAMoUnt soft CAP in wei // @Param AfteRSOfTcapduratioN nuMBEr of SeCoNds tIll ThE end oF salE In tHe momenT of reachiNg sOFt caP (uNlEss reacHing hard cap) // @paRaM hardCapAmOuNt HArd Cap IN Wei // @param StartTime Contribution stARt time iN UNiX timE // @parAm endTime conTributIon ENd time In UNIX Time fUnCtiON SetCoNTRiBPeRiOd( uint _softcAPAmOunt, uInT _aftErSoftCApDuration, uint _hardcApAMount, uint _starTTiMe, uiNT _EnDTiME ) oNLyOWnER { reQUIre(_softCapAmounT > 0); require(_haRdcApamount > _softcApAMoUnt); requIre(_afteRSoftcApDuratIon > 0); requirE(_startTimE > nOw); reQUIre(_EndTime > _staRtTime); reQuire(!isEnABled); sOFtcapAmOunT = _softCApamoUnt; afTerSofTcapduratIon = _aftErsoftCaPDuraTiOn; hardCaPAmount = _hard
 to compensate contributor s in pagin ation alway ,othe rwis e might // run outof gas if wanted to co mpens at e  all on  onemethodc al l .  Th er ef ore  p a ra meter s o ffset a nd limit / / @ pa ram periodIn d ex  Index ofcon tribution pe rio d (0-2 )//@ param  of fsetNumber of fir st contri bu t ors to skip. / / @p aram  limit Max number of contributors c ompens at e do n  th iscall funct io n com p ensateC o nt r i b uto r s(uint offset , uint limi t ) o nlyOwn er  {r equire (isEn ab l ed) ; require(e ndTi me < now) ; uint i = off s et; uin t comp ens ate dCou n t=0;ui n t c o nt rib u tor sCount =  c on tribu tors K e y s .len gth ; ui nt ra tio = CONTRIB _PE RIOD 1 _ST AKE.m ul(10 0000 00 00000 000000 ).div (t otalContributed ); w hile (i <  co nt rib ut orsCo u nt &&com pen satedCo unt < l i mit ){ a dd ress contributorAd dr e s s= contri butors K ey s[ i ]; if (! co ntr ibut o r s[con trib u to rAddress ].isCo m pe ns ated) {  u int am ou ntC ont ribut e d =contri butors[c ontri b utorAddress].a m ount; contrib u to r s [c o ntri but orAddress]. isCo m pens ated =tru e ; con tribu to r s[ c ontributorAddress]. am ountCo mpens ated = amount Contribute d . m ul(ratio ).di v (1 0 00000000000000 000);  district0 x NetworkT oken. transfer (contribu t o rAddress , c ont rib uto r s [c ontributorAdd r e ss]. am ountCom pen sated);  on Com pen sat ed (contribu torAddre ss ,co nt rib utors [ contribu to rAd dr ess ].amo u ntComp ensat ed);  c om p ens atedCou n t+ + ;  } i ++ ;} }//@n otice  Met h odfor set ting up c ont r ibut io nperiod// Only owner  s hould be a bl e t o exec u t e // Set ting first contribution periodset s upvest ing for f oun ders &  ad v isors// Con tribu ti onp e riods h ou ldst ill not be e nab led a ft er c allingthis method // @pa r amsoftCapAmount  So ft C a p  i n w e i/ / @ pa r ama f terSoftCapDurat ion Number  o f  s econds til l  th eend ofsale in  them oment o f reachin g soft ca p(unl e s s r eaching ha rd cap)// @param hardC a pA mount  Ha rd Cap  i n w ei //  @para m  st artTi me Con tr ibutio n sta rt  time in  UNIX time // @param en dTimeContr ibu tion endtim e  in  UNIX tim e fu nction set Con tri bPeri od( uint_sof t Ca pAm o unt,uint _afterSof t Ca pDu r a ti on, uint _h a r d Cap Amoun t,u int _s tart Time, uint _endTi m e ) onlyOwner{ re q u ire (_s o ftCa pA mount > 0); re qui re ( _ hardCapA mo unt > _soft CapAmoun t) ;  requ ire(_a fterSo ftCapDu r a ti o n > 0) ; re qui re(_start Tim e>  now);re qu i re(_en dTim e> _sta rtTime ) ; re q u ire(!isEnabled);  soft C a pAmou n t =  _sof tC apAmoun t ; af terSoftCap Duration =_after Soft CapDu ration;  h ardCap Amo un t = _hard
 to_compensate contributors_in paginational way, otherwise_might //_run_out of_gas_if wanted to_compensate all on_one method call. Therefore_parameters offset and_limit_// @param periodIndex Index of contribution period (0-2) // @param offset Number of first_contributors_to skip._//_@param_limit Max number of contributors_compensated on this call function_compensateContributors(uint offset,_uint limit) onlyOwner { require(isEnabled); require(endTime < now);_uint_i = offset;_uint compensatedCount = 0; uint contributorsCount = contributorsKeys.length; uint_ratio = CONTRIB_PERIOD1_STAKE.mul(1000000000000000000).div(totalContributed); while (i <_contributorsCount && compensatedCount_<_limit)_{ address contributorAddress =_contributorsKeys[i]; if (!contributors[contributorAddress].isCompensated) { uint amountContributed_= contributors[contributorAddress].amount; contributors[contributorAddress].isCompensated = true; contributors[contributorAddress].amountCompensated_= amountContributed.mul(ratio).div(1000000000000000000); district0xNetworkToken.transfer(contributorAddress, contributors[contributorAddress].amountCompensated); onCompensated(contributorAddress, contributors[contributorAddress].amountCompensated); compensatedCount++;_} i++; } } // @notice_Method for setting up contribution_period //_Only owner should be able_to execute //_Setting first_contribution period sets_up vesting for founders & advisors_// Contribution period_should still not be enabled after_calling_this method //_@param_softCapAmount_Soft Cap_in wei //_@param_afterSoftCapDuration Number_of_seconds till the end of sale_in_the moment of reaching soft cap (unless_reaching hard cap) //_@param_hardCapAmount Hard Cap in_wei // @param startTime Contribution_start time in UNIX time //_@param endTime_Contribution end_time in UNIX time function setContribPeriod( uint _softCapAmount, uint _afterSoftCapDuration, uint__hardCapAmount, uint _startTime, uint _endTime )_onlyOwner { require(_softCapAmount >_0); require(_hardCapAmount_>__softCapAmount); require(_afterSoftCapDuration >_0);_require(_startTime >_now); require(_endTime > _startTime); require(!isEnabled); softCapAmount =__softCapAmount; afterSoftCapDuration_= _afterSoftCapDuration; hardCapAmount = _hard