-
Notifications
You must be signed in to change notification settings - Fork 0
/
Daico.sol
54 lines (42 loc) · 1.08 KB
/
Daico.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pragma solidity ^0.4.24;
// import ERC20
contract Daico {
address public investorsContract;
ERC20 public token;
uint public momentAmountReceived;
address prowectOwner;
uint public stagesCount;
uint public stageAmount;
uint public stageDays;
modifier onlyProjectOwner() {
require(msg.sender==projectOwner);
_;
}
enum Decision {
OK,
NoDecision,
Pause,
Remove
}
constructor(uint _stagesCount, uint _stageAmount, uint _stageDays, ERC20 _token) {
stagesCount = _stagesCount;
stageAmount = _stageAmount;
stageDays = _stageDays;
token = _token;
prowectOwner = msg.sender;
}
function getNeededAmount() public view returns(uint) {
return stagesCount*stageAmount;
}
function approveTokens() public {
token.transferFrom(msg.sender, address(this), getNeededAmount());
momentAmountReceived = now;
investorsContract = msg.sender;
}
// function getAvailableAmount() ???
function receiveAmount(uint _amount) public onlyProjectOwner {
token.transfer(prowectOwner, _amount);
}
function setInvestorsDecision(Decision decision) public onlyInvestorsContract {
}
}