-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathS9token.sol
43 lines (35 loc) · 981 Bytes
/
S9token.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
pragma solidity ^0.4.15;
contract S9token {
address owner;
string public name="S9token";
uint8 public constant decimals = 0;
string public constant version = "1";
uint256 _totalSupply;
mapping (address => uint256) public balances;
function S9token() {
owner=msg.sender;
_totalSupply=200;
balances[msg.sender]=200;
}
event Transfer( address indexed from, address indexed to, uint value);
function totalSupply() public constant returns (uint supply){
return _totalSupply;
}
function balanceOf(address _owner) constant returns(uint256 balanceof){
return balances[_owner];
}
function transfer(address _to, uint256 _amount) returns (bool success){
require(msg.sender==owner);
if (balances[msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]){
balances[msg.sender] -= _amount;
balances[_to] += _amount;
return true;
Transfer(msg.sender,_to,_amount);
}
else{
return false;
}
}
}