-
Notifications
You must be signed in to change notification settings - Fork 47
/
DAOToken.sol
68 lines (60 loc) · 1.99 KB
/
DAOToken.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
pragma solidity ^0.4.0;
import "Tokens/StandardToken.sol";
import "DAO/AbstractDAOAuction.sol";
/// @title Gnosis token contract - Holds tokens of Gnosis.
/// @author Stefan George - <[email protected]>
contract DAOToken is StandardToken {
/*
* Token meta data
*/
string constant public name = "Gnosis Token";
string constant public symbol = "GNO";
uint8 constant public decimals = 18;
/*
* External contracts
*/
DAOAuction public daoAuction;
/*
* Modifiers
*/
modifier tokenLaunched() {
if (!daoAuction.tokenLaunched() && msg.sender != address(daoAuction)) {
// Token was not launched yet and sender is not auction contract
throw;
}
_;
}
/*
* Read and write functions
*/
/// @dev Transfers sender's tokens to a given address. Returns success.
/// @param to Address of token receiver.
/// @param value Number of tokens to transfer.
/// @return success Returns success of function call.
function transfer(address to, uint256 value)
public
tokenLaunched
returns (bool success)
{
return super.transfer(to, value);
}
/// @dev Allows allowed third party to transfer tokens from one address to another. Returns success.
/// @param from Address from where tokens are withdrawn.
/// @param to Address to where tokens are sent.
/// @param value Number of tokens to transfer.
/// @return success Returns success of function call.
function transferFrom(address from, address to, uint256 value)
public
tokenLaunched
returns (bool success)
{
return super.transferFrom(from, to, value);
}
/// @dev Contract constructor function sets owner.
function DAOToken(address _daoAuction) {
daoAuction = DAOAuction(_daoAuction);
uint _totalSupply = 10000000 * 10**18;
balances[_daoAuction] = _totalSupply;
totalSupply = _totalSupply;
}
}