Skip to content

Commit

Permalink
events added
Browse files Browse the repository at this point in the history
  • Loading branch information
enkogu committed Feb 11, 2019
1 parent eafe9b4 commit b42e0f8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions contracts/Daico/Daico.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ contract Daico is IDaico {

event InvestEvent(uint _amount, address _sender, uint _total, uint _tapSum, uint _startedAt);
event Vote(uint _amount, address _sender, bool _vote);

event ReturnTokensToInvestor(address _investor, uint _amount);
event FundsWithdrawal(address _owner, uint _amount);
event NewRoadmapProposed(uint _fromTap, uint _roadmapNum, uint[] _nextTapFunds, uint[] _nextTapDurations);

// Voting result
enum VR {
Expand Down Expand Up @@ -141,7 +143,13 @@ contract Daico is IDaico {
newRoadmapProposed = false;
}

emit InvestEvent(_amount, _investorAddress, _amountOfAllInvestments(curTapNum), _tapAmountsSum(curTapNum), startedAt);
emit InvestEvent(
_amount,
_investorAddress,
_amountOfAllInvestments(curTapNum),
_tapAmountsSum(curTapNum),
startedAt
);
}

/**
Expand All @@ -161,6 +169,7 @@ contract Daico is IDaico {
investor = roadmaps[rmNum].investors[invNum];
part = ((investor.invested * remainder) / _amountOfAllInvestments(curTapNum));
daiToken.transfer(investor.addr, part);
emit ReturnTokensToInvestor(investor.addr, part);
}
}

Expand All @@ -179,6 +188,7 @@ contract Daico is IDaico {
roadmaps[rmNum].taps[_tapNum].isWithdrawed = true;

daiToken.transfer(owner, roadmaps[rmNum].taps[_tapNum].funds);
emit FundsWithdrawal(owner, roadmaps[rmNum].taps[_tapNum].funds);
}

/**
Expand Down Expand Up @@ -276,6 +286,8 @@ contract Daico is IDaico {
roadmaps[roadmapsCount].investors[invNum] = roadmaps[roadmapsCount - 1].investors[invNum];
}

emit NewRoadmapProposed((curTapNum + 1), roadmapsCount, _tapFunds, _tapDurations);

roadmapsCount += 1;
newRoadmapProposed = true;
}
Expand Down

0 comments on commit b42e0f8

Please sign in to comment.