@@ -82,9 +82,12 @@ contract USDTieredSTO is ISTO, ReentrancyGuard {
8282 // List of accredited investors
8383 mapping (address => bool ) public accredited;
8484
85- // Limit in USD for non-accredited investors multiplied by 10**18
85+ // Default limit in USD for non-accredited investors multiplied by 10**18
8686 uint256 public nonAccreditedLimitUSD;
8787
88+ // Overrides for default limit in USD for non-accredited investors multiplied by 10**18
89+ mapping (address => uint256 ) public nonAccreditedLimitUSDOverride;
90+
8891 // Minimum investable amount in USD
8992 uint256 public minimumInvestmentUSD;
9093
@@ -102,6 +105,8 @@ contract USDTieredSTO is ISTO, ReentrancyGuard {
102105 ////////////
103106
104107 event SetAllowBeneficialInvestments (bool _allowed );
108+ event SetNonAccreditedLimit (address _investor , uint256 _limit );
109+ event SetAccredited (address _investor , bool _accredited );
105110 event TokenPurchase (address indexed _purchaser , address indexed _beneficiary , uint256 _tokens , uint256 _usdAmount , uint256 _tierPrice , uint8 _tier );
106111 event FundsReceivedETH (address indexed _purchaser , address indexed _beneficiary , uint256 _usdAmount , uint256 _receivedValue , uint256 _spentValue , uint256 _rate );
107112 event FundsReceivedPOLY (address indexed _purchaser , address indexed _beneficiary , uint256 _usdAmount , uint256 _receivedValue , uint256 _spentValue , uint256 _rate );
@@ -331,6 +336,22 @@ contract USDTieredSTO is ISTO, ReentrancyGuard {
331336 require (_investors.length == _accredited.length );
332337 for (uint256 i = 0 ; i < _investors.length ; i++ ) {
333338 accredited[_investors[i]] = _accredited[i];
339+ emit SetAccredited (_investors[i], _accredited[i]);
340+ }
341+ }
342+
343+ /**
344+ * @notice Modify the list of overrides for non-accredited limits in USD
345+ * @param _investors Array of investor addresses to modify
346+ * @param _nonAccreditedLimit Array of uints specifying non-accredited limits
347+ */
348+ function changeNonAccreditedLimit (address [] _investors , uint256 [] _nonAccreditedLimit ) public onlyOwner {
349+ //nonAccreditedLimitUSDOverride
350+ require (_investors.length == _nonAccreditedLimit.length );
351+ for (uint256 i = 0 ; i < _investors.length ; i++ ) {
352+ require (_nonAccreditedLimit[i] > 0 , "Limit cannot be 0 " );
353+ nonAccreditedLimitUSDOverride[_investors[i]] = _nonAccreditedLimit[i];
354+ emit SetNonAccreditedLimit (_investors[i], _nonAccreditedLimit[i]);
334355 }
335356 }
336357
@@ -409,9 +430,10 @@ contract USDTieredSTO is ISTO, ReentrancyGuard {
409430
410431 // Check for non-accredited cap
411432 if (! accredited[_beneficiary]) {
412- require (investorInvestedUSD[_beneficiary] < nonAccreditedLimitUSD, "Non-accredited investor has already reached nonAccreditedLimitUSD " );
413- if (investedUSD.add (investorInvestedUSD[_beneficiary]) > nonAccreditedLimitUSD)
414- investedUSD = nonAccreditedLimitUSD.sub (investorInvestedUSD[_beneficiary]);
433+ uint256 investorLimitUSD = (nonAccreditedLimitUSDOverride[_beneficiary] == 0 ) ? nonAccreditedLimitUSD : nonAccreditedLimitUSDOverride[_beneficiary];
434+ require (investorInvestedUSD[_beneficiary] < investorLimitUSD, "Non-accredited investor has already reached nonAccreditedLimitUSD " );
435+ if (investedUSD.add (investorInvestedUSD[_beneficiary]) > investorLimitUSD)
436+ investedUSD = investorLimitUSD.sub (investorInvestedUSD[_beneficiary]);
415437 }
416438
417439 uint256 spentUSD;
0 commit comments