-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy path0x83eea00d838f92dec4d1475697b9f4d3537b56e3-VOISE-VOISE.sol
87 lines (70 loc) · 3.25 KB
/
0x83eea00d838f92dec4d1475697b9f4d3537b56e3-VOISE-VOISE.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
pragma solidity ^0.4.6;
contract SafeMath {
//internals
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function assert(bool assertion) internal {
if (!assertion) throw;
}
}
contract VOISE is SafeMath {
/* Public variables of the token */
string public standard = 'ERC20';
string public name = 'VOISE';
string public symbol = 'VOISE';
uint8 public decimals = 8;
uint256 public totalSupply;
address public owner;
uint256 public startTime = 1492560000;
/* tells if tokens have been burned already */
bool burned;
/* This creates an array with all the balances */
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
/* This generates a public event on the blockchain that will notify all clients */
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Burned(uint amount);
/* Initializes contract with initial supply tokens and gives them to the voise team adress */
function VOISE() {
owner = msg.sender;
balanceOf[owner] = 82557800000000000; // All of them are stored in the voise team adress until they are bought
totalSupply = 82557800000000000; // total supply of tokens
}
/* Send some of your tokens to a given address (Press bounties) */
function transfer(address _to, uint256 _value) returns (bool success){
if (now < startTime) throw; //check if the crowdsale is already over
balanceOf[msg.sender] = safeSub(balanceOf[msg.sender],_value); // Subtract from the sender
balanceOf[_to] = safeAdd(balanceOf[_to],_value); // Add the same to the recipient
Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
return true;
}
/* Allow another contract or person to spend some tokens in your behalf */
function approve(address _spender, uint256 _value) returns (bool success) {
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/* A contract or person attempts to get the tokens of somebody else. */
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (now < startTime && _from!=owner) throw; //check if the crowdsale is already over
var _allowance = allowance[_from][msg.sender];
balanceOf[_from] = safeSub(balanceOf[_from],_value); // Subtract from the sender
balanceOf[_to] = safeAdd(balanceOf[_to],_value); // Add the same to the recipient
allowance[_from][msg.sender] = safeSub(_allowance,_value);
Transfer(_from, _to, _value);
return true;
}
}