-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPegkeToken.sol
36 lines (29 loc) · 924 Bytes
/
PegkeToken.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
pragma solidity ^0.4.0;
contract PegkeToken {
uint256 public totalTokens;
uint256 initialTokens;
string public tokenName;
string public tokenSymbol;
mapping (address => uint256) public balanceOf;
event SendLog(address indexed_from, address indexed_to, uint256 value);
function PegkeToken() {
initialTokens = 10000;
totalTokens = initialTokens;
tokenName = "PegkeCoin";
tokenSymbol = "℗";
balanceOf[msg.sender] = initialTokens;
}
function sendToken(address reciever,uint256 tokenAmount) {
if (balanceOf[msg.sender] < tokenAmount) throw;
balanceOf[msg.sender] -= tokenAmount;
balanceOf[reciever] += tokenAmount;
SendLog(msg.sender, reciever, tokenAmount);
}
function loyaltyStake(address reciever, uint256 tokenAmount, uint8 tokenPercentage){
if (balanceOf[reciever] < tokenAmount) throw;
balanceOf[reciever] += (tokenPercentage/100) * tokenAmount;
}
function () {
throw;
}
}