Skip to content
Permalink
Browse files

Removed single-use modifiers. Added one line require

  • Loading branch information...
shanefontaine committed Oct 3, 2017
1 parent a86758b commit f676dcd60923616faf7f0cfc2638142686a67486
Showing with 6 additions and 20 deletions.
  1. +3 −3 contracts/ParticipantAdditionProxy.sol
  2. +3 −17 contracts/TokenDistribution.sol
@@ -57,8 +57,8 @@ contract ParticipantAdditionProxy is Ownable {
/// @param approvedPresaleParticipantsAllocations Array of allocations
function allocatePresaleBalances(address[] approvedPresaleParticipants, uint256[] approvedPresaleParticipantsAllocations)
onlyOwner
presaleParticipantAdditionOngoing
{
require(!presaleAdditionDone); // Presale participant allocation cannot be completed
require(approvedPresaleParticipants.length == approvedPresaleParticipantsAllocations.length); // The arrays passed in must be of equal length
// Does not need to be global variable since they are saved in mapping. Can use as many arrays/tx as needed.
for (uint256 i = 0; i < approvedPresaleParticipants.length; i++) {
@@ -76,8 +76,8 @@ contract ParticipantAdditionProxy is Ownable {
/// @param approvedSaleParticipantsAllocations Array of allocations
function allocateSaleBalances(address[] approvedSaleParticipants, uint256[] approvedSaleParticipantsAllocations)
onlyOwner
saleParticipantAdditionOngoing
{
require(!saleAdditionDone); // Sale participant allocation cannot be completed
require(approvedSaleParticipants.length == approvedSaleParticipantsAllocations.length); // The arrays passed in must be of equal length
// Does not need to be global variable since they are saved in mapping. Can use as many arrays/tx as needed.
for (uint256 j = 0; j < approvedSaleParticipants.length; j++) {
@@ -95,8 +95,8 @@ contract ParticipantAdditionProxy is Ownable {
/// @param approvedLockedParticipantsAllocations Array of allocations
function allocateLockedBalances(address[] approvedLockedParticipants, uint256[] approvedLockedParticipantsAllocations)
onlyOwner
lockedParticipantAdditionOngoing
{
require(!lockedAdditionDone); // Locked participant allocation cannot be completed
require(approvedLockedParticipants.length == approvedLockedParticipantsAllocations.length); // The arrays passed in must be of equal length
// Does not need to be global variable since they are saved in mapping. Can use as many arrays/tx as needed.
for (uint256 j = 0; j < approvedLockedParticipants.length; j++) {
@@ -99,20 +99,6 @@ contract TokenDistribution is Ownable, StandardToken {
_;
}

modifier presaleTokensStillAvailable {
require(numPresaleTokensDistributed < PRESALE_TOKEN_ALLOCATION_CAP);
_;
}

modifier saleTokensStillAvailable {
require(numSaleTokensDistributed < SALE_TOKEN_ALLOCATION_CAP);
_;
}

modifier lockedTokensStillAvailable {
require(numLockedTokensDistributed < LOCKED_TOKEN_ALLOCATION_CAP);
_;
}
/// @dev TokenDistribution(): Constructor for the sale contract
/// @param _ukgDepositAddr Address to deposit pre-allocated UKG
/// @param _proxyContractAddress Address of contract holding participant data
@@ -152,8 +138,8 @@ contract TokenDistribution is Ownable, StandardToken {
function claimSaleTokens()
notCanceled
distributionStarted
saleTokensStillAvailable
{
require(numSaleTokensDistributed < SALE_TOKEN_ALLOCATION_CAP); // Cannot distribute more tokens than available
require(!saleParticipantCollected[msg.sender]); // Participant's funds cannot have been collected already

ProxyContract participantData = ProxyContract(proxyContractAddress);
@@ -255,8 +241,8 @@ contract TokenDistribution is Ownable, StandardToken {
function claimPresaleTokens()
notCanceled
distributionStarted
presaleTokensStillAvailable
{
require(numPresaleTokensDistributed < PRESALE_TOKEN_ALLOCATION_CAP); // Cannot distribute more tokens than available
for (uint i = 1; i <= currentPhase(); i++) {
claimPresaleTokensIterate(i); // Calls claim function
}
@@ -283,8 +269,8 @@ contract TokenDistribution is Ownable, StandardToken {
notCanceled
distributionStarted
lockupOver
lockedTokensStillAvailable
{
require(numLockedTokensDistributed < LOCKED_TOKEN_ALLOCATION_CAP); // Cannot distribute more tokens than available
require(!lockedParticipantCollected[msg.sender]); // Participant's funds cannot have been collected already

ProxyContract participantData = ProxyContract(proxyContractAddress);

0 comments on commit f676dcd

Please sign in to comment.
You can’t perform that action at this time.