-
Notifications
You must be signed in to change notification settings - Fork 47
/
DAO.sol
96 lines (85 loc) · 2.31 KB
/
DAO.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
pragma solidity ^0.4.0;
import "EventFactory/AbstractEventFactory.sol";
/// @title DAO contract - Placeholder contract to be updated with governance logic at a later stage.
/// @author Stefan George - <[email protected]>
contract DAO {
/*
* External contracts
*/
EventFactory public eventFactory;
/*
* Storage
*/
address public wallet;
address public owner;
/*
* Modifiers
*/
modifier isOwner() {
if (msg.sender != owner) {
// Only owner is allowed to do this action.
throw;
}
_;
}
modifier isWallet() {
if (msg.sender != wallet) {
// Only wallet is allowed to do this action.
throw;
}
_;
}
/*
* Read and write functions
*/
/// @dev Exchanges DAO contract and updates events and token contracts.
/// @param daoAddress Address of new DAO contract.
function changeDAO(address daoAddress)
external
isWallet
{
eventFactory.changeDAO(daoAddress);
}
/// @dev Setup function sets external contracts' addresses.
/// @param eventFactoryAddress Events address.
/// @param walletAddress Wallet address.
function setup(address eventFactoryAddress, address walletAddress)
external
isOwner
{
if (address(eventFactory) != 0 || wallet != 0) {
// Setup was executed already
throw;
}
eventFactory = EventFactory(eventFactoryAddress);
wallet = walletAddress;
}
/// @dev Contract constructor function sets owner.
function DAO() {
owner = msg.sender;
}
/*
* Read functions
*/
/// @dev Returns base fee for amount of tokens.
/// @param sender Buyers address.
/// @param tokenCount Amount of invested tokens.
/// @return fee Returns fee.
function calcBaseFee(address sender, uint tokenCount)
constant
external
returns (uint fee)
{
return 0;
}
/// @dev Returns base fee for wanted amount of shares.
/// @param shareCount Amount of shares to buy.
/// @return fee Returns fee.
function calcBaseFeeForShares(address sender, uint shareCount)
constant
external
returns (uint fee)
{
return 0;
}
}